private void dataTableView2_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } MedicalQcMsg medicalQcMsg = this.dataTableView2.Rows[e.RowIndex].Tag as MedicalQcMsg; if (medicalQcMsg == null) { return; } QcMsgDict qcMsgDict = null; QcMsgDictAccess.Instance.GetQcMsgDict(medicalQcMsg.QC_MSG_CODE, ref qcMsgDict); PatVisitInfo patVisit = new PatVisitInfo(); patVisit.PATIENT_ID = medicalQcMsg.PATIENT_ID; patVisit.VISIT_ID = medicalQcMsg.VISIT_ID; patVisit.VISIT_NO = medicalQcMsg.VISIT_NO; this.MainForm.SwitchPatient(patVisit); PatientPageForm patientPageForm = this.MainForm.GetPatientPageForm(patVisit); if (string.IsNullOrEmpty(qcMsgDict.MESSAGE_TITLE) || qcMsgDict.QA_EVENT_TYPE.Contains("入院记录")) { patientPageForm.LoadModule(medicalQcMsg.QA_EVENT_TYPE); } else { patientPageForm.LoadModule(qcMsgDict.MESSAGE_TITLE); } }
private bool Recursion(QcMsgDict qcMsgDict, TreeNode node) { foreach (TreeNode item in node.Nodes) { QcMsgDict nodeQcMsgDict = item.Tag as QcMsgDict; if (nodeQcMsgDict != null) { if (nodeQcMsgDict.QC_MSG_CODE == qcMsgDict.QC_MSG_CODE) { ExpendNode(item); item.BackColor = Color.LightGray; return(true); } else { item.Collapse(); item.BackColor = Color.White; } } if (Recursion(qcMsgDict, item)) { return(true); } } return(false); }
private void SetQcMessage(QcMsgDict qcMessage) { this.QaEventType = qcMessage.QA_EVENT_TYPE; this.Message = qcMessage.MESSAGE; this.MessageTitle = string.IsNullOrEmpty(qcMessage.MESSAGE_TITLE) ? qcMessage.QA_EVENT_TYPE : qcMessage.MESSAGE_TITLE; this.QcMsgCode = qcMessage.QC_MSG_CODE; this.Score = qcMessage.SCORE.ToString(); }
/// <summary> /// 新增一条自动核查规则配置信息 /// </summary> /// <param name="qcMsgDict">自动核查规则配置信息</param> /// <returns>SystemData.ReturnValue</returns> public short Insert(QcMsgDict qcMsgDict) { if (qcMsgDict == null) { LogManager.Instance.WriteLog("QcCheckPointAccess.Insert", new string[] { "timeQCRule" } , new object[] { qcMsgDict }, "参数不能为空"); return(SystemData.ReturnValue.PARAM_ERROR); } string szField = string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}" , SystemData.QcMsgDictTable.APPLY_ENV , SystemData.QcMsgDictTable.INPUT_CODE , SystemData.QcMsgDictTable.ISVETO , SystemData.QcMsgDictTable.MESSAGE , SystemData.QcMsgDictTable.MESSAGE_TITLE , SystemData.QcMsgDictTable.QA_EVENT_TYPE , SystemData.QcMsgDictTable.QC_MSG_CODE , SystemData.QcMsgDictTable.SCORE , SystemData.QcMsgDictTable.SERIAL_NO , SystemData.QcMsgDictTable.IS_VALID); string szValue = string.Format("'{0}','{1}','{2}','{3}','{4}','{5}','{6}',{7},{8},{9}" , qcMsgDict.APPLY_ENV , qcMsgDict.INPUT_CODE , qcMsgDict.ISVETO ? 1 : 0 , qcMsgDict.MESSAGE , qcMsgDict.MESSAGE_TITLE , qcMsgDict.QA_EVENT_TYPE , qcMsgDict.QC_MSG_CODE , qcMsgDict.SCORE , qcMsgDict.SERIAL_NO , qcMsgDict.IS_VALID); string szSQL = string.Format(SystemData.SQL.INSERT, SystemData.DataTable.QC_MSG_DICT, szField, szValue); int nCount = 0; try { nCount = base.MedQCAccess.ExecuteNonQuery(szSQL, CommandType.Text); } catch (Exception ex) { LogManager.Instance.WriteLog("", new string[] { "szSQL" }, new object[] { szSQL }, ex); return(SystemData.ReturnValue.EXCEPTION); } if (nCount <= 0) { LogManager.Instance.WriteLog("", new string[] { "szSQL" }, new object[] { szSQL }, "SQL语句执行后返回0!"); return(SystemData.ReturnValue.EXCEPTION); } return(SystemData.ReturnValue.OK); }
/// <summary> /// 加载系统检查扣分信息 /// </summary> private void LoadSystemScoreInfos() { string szPatientID = SystemParam.Instance.PatVisitInfo.PATIENT_ID; string szVisitID = SystemParam.Instance.PatVisitInfo.VISIT_ID; List <QcCheckResult> lstQcCheckResult = null; short shRet = QcCheckResultAccess.Instance.GetQcCheckResults(SystemParam.Instance.DefaultTime, SystemParam.Instance.DefaultTime, szPatientID, szVisitID, null, null, null, SystemData.StatType.System, ref lstQcCheckResult); if (shRet != SystemData.ReturnValue.OK && shRet != SystemData.ReturnValue.RES_NO_FOUND) { MessageBoxEx.Show("质控质检问题下载失败!"); return; } foreach (DataGridViewRow item in this.dgvSystemScore.Rows) { QcMsgDict qcMsgDict = item.Tag as QcMsgDict; if (qcMsgDict == null) { continue; } if (lstQcCheckResult == null) { item.Cells[this.col_2_QC_EXPLAIN.Index].Tag = null; item.Visible = false; continue; } QcCheckResult qcCheckResult = lstQcCheckResult.Where(m => m.MSG_DICT_CODE == qcMsgDict.QC_MSG_CODE && m.QC_RESULT == SystemData.QcResult.UnPass).FirstOrDefault(); if (qcCheckResult != null) { item.Cells[this.col_2_ErrorCount.Index].Value = qcCheckResult.ERROR_COUNT; item.Cells[this.col_2_QC_EXPLAIN.Index].Value = qcCheckResult.QC_EXPLAIN; item.Cells[this.col_2_Score.Index].Value = qcCheckResult.SCORE; item.Cells[this.col_2_QC_EXPLAIN.Index].Tag = qcCheckResult; item.DefaultCellStyle.ForeColor = Color.Red; item.Visible = true; } else { item.Cells[this.col_2_QC_EXPLAIN.Index].Tag = null; item.Visible = false; } } //加载评分结果 this.CalSystemScore(); QCScore qcScore = new QCScore(); shRet = QcScoreAccess.Instance.GetQCScore(szPatientID, szVisitID, ref qcScore); this.tpHummanScore.Tag = qcScore; }
/// <summary> /// 病历质控系统,修改一条质控反馈信息 /// </summary> /// <param name="item">质控反馈信息</param> /// <param name="szOldQCMsgCode">旧的反馈信息代码</param> /// <returns>SystemData.ReturnValue</returns> public short Update(QcMsgDict qcMsgDict, string szOldQCMsgCode) { if (qcMsgDict == null) { LogManager.Instance.WriteLog("QcMsgDictAccess.Update", new string[] { "qcMsgDict" } , new object[] { qcMsgDict }, "参数不能为空"); return(SystemData.ReturnValue.PARAM_ERROR); } if (base.MedQCAccess == null) { return(SystemData.ReturnValue.PARAM_ERROR); } string szField = string.Format("{0}='{1}',{2}='{3}',{4}='{5}',{6}='{7}',{8}='{9}',{10}='{11}',{12}='{13}',{14}={15},{16}={17},{18}={19}" , SystemData.QcMsgDictTable.APPLY_ENV, qcMsgDict.APPLY_ENV , SystemData.QcMsgDictTable.INPUT_CODE, qcMsgDict.INPUT_CODE , SystemData.QcMsgDictTable.ISVETO, qcMsgDict.ISVETO ? 1 : 0 , SystemData.QcMsgDictTable.MESSAGE, qcMsgDict.MESSAGE , SystemData.QcMsgDictTable.MESSAGE_TITLE, qcMsgDict.MESSAGE_TITLE , SystemData.QcMsgDictTable.QA_EVENT_TYPE, qcMsgDict.QA_EVENT_TYPE , SystemData.QcMsgDictTable.QC_MSG_CODE, qcMsgDict.QC_MSG_CODE , SystemData.QcMsgDictTable.SCORE, qcMsgDict.SCORE , SystemData.QcMsgDictTable.SERIAL_NO, qcMsgDict.SERIAL_NO , SystemData.QcMsgDictTable.IS_VALID, qcMsgDict.IS_VALID); string szCondition = string.Format("{0}='{1}'", SystemData.QcMsgDictTable.QC_MSG_CODE, szOldQCMsgCode); string szSQL = string.Format(SystemData.SQL.UPDATE, SystemData.DataTable.QC_MSG_DICT, szField, szCondition); int nCount = 0; try { nCount = base.MedQCAccess.ExecuteNonQuery(szSQL, CommandType.Text); } catch (Exception ex) { LogManager.Instance.WriteLog("", new string[] { "szSQL" }, new object[] { szSQL }, ex); return(SystemData.ReturnValue.EXCEPTION); } if (nCount <= 0) { LogManager.Instance.WriteLog("", new string[] { "szSQL" }, new object[] { szSQL }, "SQL语句执行后返回0!"); return(SystemData.ReturnValue.EXCEPTION); } return(SystemData.ReturnValue.OK); }
private void dgvHummanScore_OnBindDataDetail(object item, int rowIndex, bool isMainItem) { DataGridViewRow row = this.dgvHummanScore.Rows[rowIndex]; QcMsgDict singleModel = item as QcMsgDict; row.ReadOnly = true; //Country if (isMainItem) { row.Cells[this.colItem.Index].Value = singleModel.QA_EVENT_TYPE; row.DefaultCellStyle.BackColor = Color.FromArgb(185, 185, 185); } else { if (string.IsNullOrEmpty(singleModel.MESSAGE)) { //二级分类 row.Cells[this.colItem.Index].Value = " " + singleModel.MESSAGE_TITLE; row.DefaultCellStyle.BackColor = Color.FromArgb(235, 235, 235); } else { //评分项 row.Cells[this.colItem.Index].Value = " " + singleModel.OrderNo.ToString() + "、" + singleModel.MESSAGE; row.Cells[this.colPoint.Index].Value = singleModel.SCORE; row.DefaultCellStyle.BackColor = Color.FromArgb(255, 255, 255); //if (m_lstQcCheckResult != null) //{ // QcCheckResult qcCheckResult = m_lstQcCheckResult.Where(m => m.MSG_DICT_CODE == singleModel.QC_MSG_CODE).FirstOrDefault(); // if (qcCheckResult != null) // { // row.Cells[this.colRemark.Index].Value = qcCheckResult.REMARKS; // row.Cells[this.colCheckBox.Index].Value = true; // row.Cells[this.colErrorCount.Index].Value = qcCheckResult.ERROR_COUNT; // row.Cells[this.colErrorCount.Index].ReadOnly = false; // row.Cells[this.colRemark.Index].ReadOnly = false; // } //} } } //Name //Gender }
/// <summary> /// 显示文档类型设置对话框 /// </summary> /// <param name="row">指定行</param> private void ShowMsgDictSelectForm() { MsgDictSelectForm msgDictSelectForm = new MsgDictSelectForm(); msgDictSelectForm.DefaultMsgCode = txtMsgDict.Tag as string; msgDictSelectForm.MultiSelect = true; msgDictSelectForm.Description = "请选择缺陷内容:"; if (msgDictSelectForm.ShowDialog() != DialogResult.OK) { return; } List <QcMsgDict> lstQcMsgDicts = msgDictSelectForm.SelectedQcMsgDicts; if (lstQcMsgDicts == null || lstQcMsgDicts.Count <= 0) { this.txtMsgDict.Text = "<双击选择>"; this.txtMsgDict.Tag = null; return; } StringBuilder sbMsgCodeList = new StringBuilder(); StringBuilder sbMessageList = new StringBuilder(); for (int index = 0; index < lstQcMsgDicts.Count; index++) { QcMsgDict qcMsgDict = lstQcMsgDicts[index]; if (qcMsgDict == null) { continue; } sbMsgCodeList.Append(qcMsgDict.QC_MSG_CODE); if (index < lstQcMsgDicts.Count - 1) { sbMsgCodeList.Append(";"); } sbMessageList.Append(qcMsgDict.MESSAGE); if (index < lstQcMsgDicts.Count - 1) { sbMessageList.Append(";"); } } txtMsgDict.Text = sbMessageList.ToString(); txtMsgDict.Tag = sbMsgCodeList.ToString(); }
/// <summary> /// 获取当前TreeView树中已勾选的病历类型信息列表 /// </summary> /// <returns>病历类型信息列表</returns> private List <QcMsgDict> GetSelectedQcMsgDictList() { List <QcMsgDict> lstQcMsgDicts = new List <QcMsgDict>(); if (!this.treeView1.CheckBoxes) { TreeNode selectedNode = this.treeView1.SelectedNode; if (selectedNode == null) { return(lstQcMsgDicts); } QcMsgDict qcMsgDict = selectedNode.Tag as QcMsgDict; if (qcMsgDict == null) { return(lstQcMsgDicts); } lstQcMsgDicts.Add(qcMsgDict); return(lstQcMsgDicts); } for (int parentIndex = 0; parentIndex < this.treeView1.Nodes.Count; parentIndex++) { TreeNode parentNode = this.treeView1.Nodes[parentIndex]; for (int childIndex = 0; childIndex < parentNode.Nodes.Count; childIndex++) { TreeNode childNode = parentNode.Nodes[childIndex]; if (childNode.Tag is QaEventTypeDict) { foreach (TreeNode item in childNode.Nodes) { if (item.Tag is QcMsgDict && item.Checked) { lstQcMsgDicts.Add(item.Tag as QcMsgDict); } } } else if (childNode.Checked) { lstQcMsgDicts.Add(childNode.Tag as QcMsgDict); } } } return(lstQcMsgDicts); }
/// <summary> /// 增加一行记录 /// </summary> private void AddRow() { if (SystemParam.Instance.UserRight == null) { return; } EMRDBLib.QcMsgDict qcMessageTemplet = null; DataTableViewRow currRow = this.dataGridView1.CurrentRow; if (currRow != null && currRow.Index >= 0) { qcMessageTemplet = currRow.Tag as EMRDBLib.QcMsgDict; } if (qcMessageTemplet == null) { qcMessageTemplet = new QcMsgDict(); } else { qcMessageTemplet = qcMessageTemplet.Clone() as QcMsgDict; } int nRowIndex = 0; if (currRow != null) { nRowIndex = currRow.Index + 1; DataTableViewRow dataTableViewRow = new DataTableViewRow(); this.dataGridView1.Rows.Insert(nRowIndex, dataTableViewRow); } else { nRowIndex = this.dataGridView1.Rows.Add(); } DataTableViewRow row = this.dataGridView1.Rows[nRowIndex]; this.SetRowData(row, qcMessageTemplet); this.dataGridView1.Focus(); this.dataGridView1.SelectRow(row); this.dataGridView1.SetRowState(row, RowState.New); this.dataGridView1.CurrentCell = row.Cells[this.colSerialNO.Index]; this.dataGridView1.BeginEdit(true); }
private void cboQcMsgDict_SelectedIndexChanged(object sender, EventArgs e) { try { if (cboQcMsgDict.SelectedItem == null) { return; } QcMsgDict qcMsgDict = cboQcMsgDict.SelectedItem as QcMsgDict; foreach (TreeNode n in this.treeView1.Nodes) { if (Recursion(qcMsgDict, n)) { break; } } } catch (Exception ex) { LogManager.Instance.WriteLog(ex.ToString()); } }
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { TreeNode selectedNode = this.treeView1.SelectedNode; if (selectedNode == null) { return; } if (selectedNode.Parent == null) { return; } EMRDBLib.QcMsgDict qcMessage = selectedNode.Tag as EMRDBLib.QcMsgDict; if (qcMessage == null) { return; } SetQcMessage(qcMessage); this.selectedQCMessageTemplet = qcMessage; this.DialogResult = DialogResult.OK; }
/// <summary> /// 设置扣分上限信息 /// </summary> /// <param name="frmQuestionType"></param> private void SetScoreInfos(QcMsgDict qcMessageTemplet) { string szLevel1Socre = string.Empty; string szLevel2Socre = string.Empty; string szPatientID = SystemParam.Instance.PatVisitInfo.PATIENT_ID; string szVisitID = SystemParam.Instance.PatVisitInfo.VISIT_ID; List <MedicalQcMsg> lstQCQuestionInfos = null; short shRet = MedicalQcMsgAccess.Instance.GetMedicalQcMsgList(szPatientID, szVisitID, ref lstQCQuestionInfos); if (shRet != SystemData.ReturnValue.OK && shRet != SystemData.ReturnValue.RES_NO_FOUND) { MessageBoxEx.Show("质控质检问题下载失败!"); return; } if (lstQCQuestionInfos == null || lstQCQuestionInfos.Count <= 0) { szLevel1Socre = "0.0"; szLevel2Socre = "0.0"; } else { double scoreLevel1Count = 0.0; double scoreLevel2Count = 0.0; foreach (MedicalQcMsg qcQuestionInfo in lstQCQuestionInfos) { if (qcQuestionInfo.QA_EVENT_TYPE == qcMessageTemplet.QA_EVENT_TYPE)//问题大类扣分累计 { scoreLevel1Count += (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(qcQuestionInfo.POINT, 0f)), 1); } QcMsgDict itemQCMessageTemplet = ListQcMsgDict.Find(delegate(QcMsgDict p) { return(p.QC_MSG_CODE == qcQuestionInfo.QC_MSG_CODE); }); if (itemQCMessageTemplet == null) { continue; } //子类问题扣分累加 //添加了子类标题按照子类标题计算 if (!string.IsNullOrEmpty(qcMessageTemplet.MESSAGE_TITLE) && itemQCMessageTemplet.MESSAGE_TITLE == qcMessageTemplet.MESSAGE_TITLE) { scoreLevel2Count += (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(qcQuestionInfo.POINT, 0f)), 1); } //没有添加子类标题的按照原来的问题类型CODE计算 else if (string.IsNullOrEmpty(qcMessageTemplet.MESSAGE_TITLE) && itemQCMessageTemplet.QC_MSG_CODE == qcMessageTemplet.QC_MSG_CODE) { scoreLevel2Count += (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(qcQuestionInfo.POINT, 0f)), 1); } } this.txtLevel1Score.Text = scoreLevel1Count.ToString(); this.txtLevel2Socre.Text = scoreLevel2Count.ToString(); } //上限分数设置 if (LstQCEventTypes != null) { double scoreLevel1Max = 0.0; double scoreLevel2Max = 0.0; foreach (QaEventTypeDict qcEventType in LstQCEventTypes) { //问题大类分数上限 if (qcEventType.QA_EVENT_TYPE == qcMessageTemplet.QA_EVENT_TYPE) { scoreLevel1Max = (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(qcEventType.MAX_SCORE, 0f)), 1); if (scoreLevel1Max == 0.0) { this.lblevel1MaxScore.Text = "类型上限分数:无限制"; } else { this.lblevel1MaxScore.Text = "类型上限分数:" + scoreLevel1Max.ToString(); this.lblevel1MaxScore.Tag = scoreLevel1Max; } } //子类问题类型分数上限 if (!string.IsNullOrEmpty(qcEventType.PARENT_CODE) && qcEventType.QA_EVENT_TYPE == qcMessageTemplet.MESSAGE_TITLE) { scoreLevel2Max = (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(qcEventType.MAX_SCORE, 0f)), 1); if (scoreLevel2Max == 0.0) { this.lblevel2MaxScore.Text = "子类上限分数:无限制"; } else { this.lblevel2MaxScore.Text = "子类上限分数:" + scoreLevel2Max.ToString(); this.lblevel2MaxScore.Tag = scoreLevel2Max; } } //没有MessageTitle的问题类型 if (string.IsNullOrEmpty(qcMessageTemplet.MESSAGE_TITLE)) { this.lblevel2MaxScore.Text = "子类上限分数:无限制"; } } } else { this.lblevel1MaxScore.Text = "类型上限分数:未知"; this.lblevel2MaxScore.Text = "子类上限分数:未知"; } }
/// <summary> /// 病历质控系统,获取质控反馈信息字典列表 /// </summary> /// <param name="lstQcMsgDicts">质控反馈信息字典列表</param> /// <returns>SystemData.ReturnValue</returns> public short GetAllQcMsgDictList(ref List <QcMsgDict> lstQcMsgDicts) { if (base.MedQCAccess == null) { return(SystemData.ReturnValue.PARAM_ERROR); } string szField = string.Format("*"); string szCondtion = string.Format("1=1 "); string szOrderBy = string.Format("{0},{1}" , SystemData.QcMsgDictTable.SERIAL_NO , SystemData.QcMsgDictTable.QC_MSG_CODE); string szSQL = string.Format(SystemData.SQL.SELECT_WHERE_ORDER_ASC, szField, SystemData.DataTable.QC_MSG_DICT, szCondtion , szOrderBy); IDataReader dataReader = null; try { dataReader = base.MedQCAccess.ExecuteReader(szSQL, CommandType.Text); if (dataReader == null || dataReader.IsClosed || !dataReader.Read()) { return(SystemData.ReturnValue.RES_NO_FOUND); } if (lstQcMsgDicts == null) { lstQcMsgDicts = new List <QcMsgDict>(); } lstQcMsgDicts.Clear(); do { QcMsgDict model = new QcMsgDict(); for (int i = 0; i < dataReader.FieldCount; i++) { if (dataReader.IsDBNull(i)) { continue; } //PropertyInfo propertyInfo = m_htProperty[dataReader.GetName(i)]; //bool result = Reflect.SetPropertyValue(model, propertyInfo, dataReader.GetValue(i)); switch (dataReader.GetName(i)) { case SystemData.QcMsgDictTable.APPLY_ENV: model.APPLY_ENV = dataReader.GetValue(i).ToString(); break; case SystemData.QcMsgDictTable.INPUT_CODE: model.INPUT_CODE = dataReader.GetValue(i).ToString(); break; case SystemData.QcMsgDictTable.ISVETO: model.ISVETO = dataReader.GetValue(i).ToString() == "1"; break; case SystemData.QcMsgDictTable.IS_VALID: model.IS_VALID = decimal.Parse(dataReader.GetValue(i).ToString()); break; case SystemData.QcMsgDictTable.MESSAGE: model.MESSAGE = dataReader.GetValue(i).ToString(); break; case SystemData.QcMsgDictTable.MESSAGE_TITLE: model.MESSAGE_TITLE = dataReader.GetValue(i).ToString(); break; case SystemData.QcMsgDictTable.QA_EVENT_TYPE: model.QA_EVENT_TYPE = dataReader.GetValue(i).ToString(); break; case SystemData.QcMsgDictTable.QC_MSG_CODE: model.QC_MSG_CODE = dataReader.GetValue(i).ToString(); break; case SystemData.QcMsgDictTable.SCORE: model.SCORE = float.Parse(dataReader.GetValue(i).ToString()); break; case SystemData.QcMsgDictTable.SERIAL_NO: model.SERIAL_NO = int.Parse(dataReader.GetValue(i).ToString()); break; default: break; } } lstQcMsgDicts.Add(model); } while (dataReader.Read()); return(SystemData.ReturnValue.OK); } catch (Exception ex) { LogManager.Instance.WriteLog("", new string[] { "szSQL" }, new object[] { szSQL }, ex); return(SystemData.ReturnValue.EXCEPTION); } finally { if (dataReader != null) { dataReader.Close(); dataReader.Dispose(); dataReader = null; } base.MedQCAccess.CloseConnnection(false); } }
/// <summary> /// 加载人工评分项目 /// </summary> public void LoadHummanQcMsgDict() { this.dgvHummanScore.Rows.Clear(); List <QaEventTypeDict> lstQaEventTypeDict = null; short shRet = QaEventTypeDictAccess.Instance.GetQCEventTypeList(ref lstQaEventTypeDict); List <QcMsgDict> lstQcMsgDict = null; shRet = QcMsgDictAccess.Instance.GetQcMsgDictList(ref lstQcMsgDict); lstQcMsgDict = lstQcMsgDict.Where(m => m.IS_VALID == 1).ToList(); if (shRet != SystemData.ReturnValue.OK && shRet != SystemData.ReturnValue.RES_NO_FOUND) { MessageBoxEx.Show("质控质检问题下载失败!"); return; } var firstQaEventTypeDict = lstQaEventTypeDict.Where(m => m.PARENT_CODE == string.Empty).ToList(); GroupQcMsgDict groupQcMsgDict = new GroupQcMsgDict(); foreach (var item in firstQaEventTypeDict) { //添加一级分类 ListQcMsgDict listQcMsgDict = new ListQcMsgDict(); QcMsgDict firstQaEventType = new QcMsgDict(); firstQaEventType.QA_EVENT_TYPE = item.QA_EVENT_TYPE; listQcMsgDict.Add(firstQaEventType); var firstMsgDict = lstQcMsgDict.Where(m => m.MESSAGE_TITLE == string.Empty && m.QA_EVENT_TYPE == item.QA_EVENT_TYPE).ToList(); if (firstMsgDict.Count > 0) { foreach (var item3 in firstMsgDict) { item3.OrderNo = firstMsgDict.IndexOf(item3) + 1; //添加一级分类下的质检问题项 listQcMsgDict.Add(item3); } } var secondQaEventTypeDict = lstQaEventTypeDict.Where(m => m.PARENT_CODE == item.INPUT_CODE).ToList(); if (secondQaEventTypeDict.Count > 0) { foreach (var childItem in secondQaEventTypeDict) { //增加二级分类 QcMsgDict secondQaEventType = new QcMsgDict(); secondQaEventType.QA_EVENT_TYPE = item.QA_EVENT_TYPE; secondQaEventType.MESSAGE_TITLE = childItem.QA_EVENT_TYPE; listQcMsgDict.Add(secondQaEventType); var secondMsgdict = lstQcMsgDict.Where(m => m.MESSAGE_TITLE == childItem.QA_EVENT_TYPE).ToList(); if (secondMsgdict.Count > 0) { foreach (var itemMsgDict in secondMsgdict) { itemMsgDict.OrderNo = secondMsgdict.IndexOf(itemMsgDict) + 1; //添加二级分类下的质检问题项 listQcMsgDict.Add(itemMsgDict); } } } } if (listQcMsgDict.Count > 0) { groupQcMsgDict.Add(listQcMsgDict); } } this.dgvHummanScore.BindDataSource <GroupQcMsgDict, QcMsgDict>(groupQcMsgDict); //默认展开第一组 this.dgvHummanScore.Expand(0); }
private bool SaveQcCheckResult(DataGridViewRow row) { short shRet = SystemData.ReturnValue.OK; QcMsgDict qcMsgDict = row.Tag as QcMsgDict; if (qcMsgDict == null || string.IsNullOrEmpty(qcMsgDict.MESSAGE)) { return(false); } if (this.m_lstQcCheckResult == null) { this.m_lstQcCheckResult = new List <QcCheckResult>(); } QcCheckResult qcCheckResult = this.m_lstQcCheckResult.Where(m => m.MSG_DICT_CODE == qcMsgDict.QC_MSG_CODE).FirstOrDefault(); if (row.Cells[this.colCheckBox.Index].Value == null) { return(false); } bool isCheck = bool.Parse(row.Cells[this.colCheckBox.Index].Value.ToString()); //如果扣分项未勾选并且系统已经有扣分记录,则删除 if (!isCheck && qcCheckResult != null) { shRet = QcCheckResultAccess.Instance.Delete(qcCheckResult.CHECK_RESULT_ID); if (!string.IsNullOrEmpty(qcCheckResult.MSG_ID)) { MedicalQcMsgAccess.Instance.Delete(qcCheckResult.MSG_ID); } if (shRet != SystemData.ReturnValue.OK) { //MessageBoxEx.Show(string.Format("第{0}行取消病历扣分信息保存失败!", row.Index + 1), MessageBoxIcon.Error); return(false); } } if (!isCheck) { return(false); } DateTime dtCheckTime = DateTime.Now; string szMessgCode = string.Empty; if (qcCheckResult == null) { qcCheckResult = new EMRDBLib.QcCheckResult(); qcCheckResult.VISIT_ID = SystemParam.Instance.PatVisitInfo.VISIT_ID; qcCheckResult.CHECKER_NAME = SystemParam.Instance.UserInfo.USER_NAME; qcCheckResult.CHECKER_ID = SystemParam.Instance.UserInfo.USER_ID; qcCheckResult.CHECK_DATE = SysTimeHelper.Instance.Now; qcCheckResult.BUG_CLASS = SystemData.BugClass.ERROR; qcCheckResult.CHECK_POINT_ID = string.Empty; qcCheckResult.CHECK_RESULT_ID = qcCheckResult.MakeID(); qcCheckResult.CHECK_TYPE = string.Empty; qcCheckResult.CREATE_ID = string.Empty; qcCheckResult.CREATE_NAME = string.Empty; qcCheckResult.DEPT_CODE = SystemParam.Instance.PatVisitInfo.DEPT_CODE; qcCheckResult.DEPT_IN_CHARGE = SystemParam.Instance.PatVisitInfo.DEPT_NAME; qcCheckResult.INCHARGE_DOCTOR = SystemParam.Instance.PatVisitInfo.INCHARGE_DOCTOR; qcCheckResult.INCHARGE_DOCTOR_ID = SystemParam.Instance.PatVisitInfo.INCHARGE_DOCTOR_ID; qcCheckResult.DOCTYPE_ID = string.Empty; qcCheckResult.DOC_SETID = string.Empty; qcCheckResult.DOC_TIME = SysTimeHelper.Instance.DefaultTime; qcCheckResult.DOC_TITLE = string.Empty; qcCheckResult.ERROR_COUNT = int.Parse(row.Cells[this.colErrorCount.Index].Value.ToString()); qcCheckResult.ISVETO = false; qcCheckResult.MODIFY_TIME = SysTimeHelper.Instance.DefaultTime; qcCheckResult.MR_STATUS = SystemParam.Instance.PatVisitInfo.MR_STATUS; qcCheckResult.MSG_DICT_CODE = qcMsgDict.QC_MSG_CODE; qcCheckResult.MSG_DICT_MESSAGE = qcMsgDict.MESSAGE; qcCheckResult.PATIENT_ID = SystemParam.Instance.PatVisitInfo.PATIENT_ID; qcCheckResult.PATIENT_NAME = SystemParam.Instance.PatVisitInfo.PATIENT_NAME; qcCheckResult.QA_EVENT_TYPE = qcMsgDict.QA_EVENT_TYPE; qcCheckResult.QC_EXPLAIN = string.Empty; qcCheckResult.QC_RESULT = SystemData.QcResult.UnPass; qcCheckResult.SCORE = qcMsgDict.SCORE; qcCheckResult.ORDER_VALUE = qcMsgDict.SERIAL_NO; qcCheckResult.STAT_TYPE = SystemData.StatType.Artificial; qcCheckResult.VISIT_ID = SystemParam.Instance.PatVisitInfo.VISIT_ID; qcCheckResult.VISIT_NO = SystemParam.Instance.PatVisitInfo.VISIT_NO; if (row.Cells[this.colRemark.Index].Value != null) { qcCheckResult.REMARKS = row.Cells[this.colRemark.Index].Value.ToString(); } shRet = QcCheckResultAccess.Instance.Insert(qcCheckResult); if (shRet != SystemData.ReturnValue.OK) { //MessageBoxEx.Show(string.Format("第{0}行病历扣分信息保存失败!", row.Index + 1), MessageBoxIcon.Error); return(false); } } else { qcCheckResult.CHECKER_ID = SystemParam.Instance.UserInfo.USER_ID; qcCheckResult.CHECKER_NAME = SystemParam.Instance.UserInfo.USER_NAME; qcCheckResult.ORDER_VALUE = qcMsgDict.SERIAL_NO; qcCheckResult.MR_STATUS = SystemParam.Instance.PatVisitInfo.MR_STATUS; qcCheckResult.CHECK_DATE = SysTimeHelper.Instance.Now; qcCheckResult.ERROR_COUNT = int.Parse(row.Cells[this.colErrorCount.Index].Value.ToString()); if (row.Cells[this.colRemark.Index].Value != null) { qcCheckResult.REMARKS = row.Cells[this.colRemark.Index].Value.ToString(); } shRet = QcCheckResultAccess.Instance.Update(qcCheckResult); if (shRet != SystemData.ReturnValue.OK) { //MessageBoxEx.Show(string.Format("第{0}行病历扣分信息更新失败!", row.Index + 1), MessageBoxIcon.Error); return(false); } } return(true); }
private bool CheckBoxScore() { if (string.IsNullOrEmpty(MedicalQcMsg.QC_MSG_CODE)) { return(false); } string szText = this.txtBoxScore.Text; try { if (string.IsNullOrEmpty(szText)) { this.txtBoxScore.Text = "0.0"; } int result = 0; if (szText.Contains(".")) { result = szText.Length - szText.IndexOf('.') - 1; } if (result > 1) { MessageBox.Show("扣分仅需精确到小数点一位"); this.txtBoxScore.Text = szText.Remove(szText.IndexOf('.') + 2, result - 1); return(false); } double level1ScoreCount = (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(this.txtLevel1Score.Text, 0f)), 1); double level2ScoreCount = (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(this.txtLevel2Socre.Text, 0f)), 1); double level1ScoreMax = this.lblevel1MaxScore.Tag == null ? 9999.9 : (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(this.lblevel1MaxScore.Tag.ToString(), 0f)), 1); double level2ScoreMax = this.lblevel2MaxScore.Tag == null ? 9999.9 : (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(this.lblevel2MaxScore.Tag.ToString(), 0f)), 1); double currentScore = (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(szText, 0f)), 1); QcMsgDict qcMessageTemplet = this.lbCurrentScoreInfo.Tag as QcMsgDict; double templetScore = 0.0; if (qcMessageTemplet == null) { qcMessageTemplet = ListQcMsgDict.Find(delegate(QcMsgDict t) { return(t.QC_MSG_CODE == MedicalQcMsg.QC_MSG_CODE); }); } if (qcMessageTemplet == null) { MessageBox.Show("质检标准信息获取失败"); return(false); } else { templetScore = (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(qcMessageTemplet.SCORE, 0f)), 1); } double leftLevel_1_Socre = (double)Math.Round(level1ScoreMax - level1ScoreCount - currentScore, 1); double leftLevel_2_Socre = (double)Math.Round(level2ScoreMax - level2ScoreCount - currentScore, 1); if (leftLevel_2_Socre < 0.0) { MessageBoxEx.Show("分数不得超过问题子类可扣分数!", MessageBoxIcon.Warning); if ((level2ScoreMax - level2ScoreCount - templetScore) <= 0.0) { templetScore = level2ScoreMax - level2ScoreCount; } if (templetScore < 0) { templetScore = 0.0; } this.txtBoxScore.Text = templetScore.ToString("F1"); return(false); } else if (leftLevel_1_Socre < 0.0) { MessageBoxEx.Show("分数不得超过问题大类可扣分数!", MessageBoxIcon.Warning); if ((level1ScoreMax - level1ScoreCount - templetScore) <= 0.0) { templetScore = level1ScoreMax - level1ScoreCount; } if (templetScore < 0) { templetScore = 0.0; } this.txtBoxScore.Text = templetScore.ToString("F1"); return(false); } else { this.txtBoxScore.Text = currentScore.ToString("F1"); return(true); } } catch { } return(false); }
/// <summary> /// 根据问题类型获取质控反馈信息字典列表 /// </summary> /// <param name="szQaEventType">问题类型</param> /// <param name="lstQCMessageTemplets">质控反馈信息字典列表</param> /// <returns>MedDocSys.Common.SystemData.ReturnValue</returns> public short GetQcMsgDictList(string szQaEventType, ref List <EMRDBLib.QcMsgDict> lstQCMessageTemplets) { if (base.MedQCAccess == null) { return(SystemData.ReturnValue.PARAM_ERROR); } string szField = string.Format("{0},{1},{2},{3},{4},{5},{6},{7}" , SystemData.QcMsgDictTable.SERIAL_NO, SystemData.QcMsgDictTable.QC_MSG_CODE, SystemData.QcMsgDictTable.QA_EVENT_TYPE , SystemData.QcMsgDictTable.MESSAGE, SystemData.QcMsgDictTable.SCORE, SystemData.QcMsgDictTable.INPUT_CODE , SystemData.QcMsgDictTable.MESSAGE_TITLE, SystemData.QcMsgDictTable.ISVETO); string szCondition = string.Format(" 1=1 and {0}=1", SystemData.QcMsgDictTable.IS_VALID); if (!string.IsNullOrEmpty(szQaEventType)) { szCondition = string.Format("{0} AND {1}='{2}'" , szCondition , SystemData.QcMsgDictTable.QA_EVENT_TYPE, szQaEventType); } string szSQL = string.Format(SystemData.SQL.SELECT_WHERE_ORDER_ASC, szField , SystemData.DataTable.QC_MSG_DICT, szCondition, SystemData.QcMsgDictTable.SERIAL_NO); IDataReader dataReader = null; try { dataReader = base.MedQCAccess.ExecuteReader(szSQL, CommandType.Text); if (dataReader == null || dataReader.IsClosed || !dataReader.Read()) { return(SystemData.ReturnValue.RES_NO_FOUND); } if (lstQCMessageTemplets == null) { lstQCMessageTemplets = new List <QcMsgDict>(); } do { QcMsgDict qcMessageTemplet = new QcMsgDict(); if (!dataReader.IsDBNull(0)) { qcMessageTemplet.SERIAL_NO = int.Parse(dataReader.GetValue(0).ToString()); } if (!dataReader.IsDBNull(1)) { qcMessageTemplet.QC_MSG_CODE = dataReader.GetString(1); } if (!dataReader.IsDBNull(2)) { qcMessageTemplet.QA_EVENT_TYPE = dataReader.GetString(2); } if (!dataReader.IsDBNull(3)) { qcMessageTemplet.MESSAGE = dataReader.GetString(3); } if (!dataReader.IsDBNull(4)) { qcMessageTemplet.SCORE = float.Parse(dataReader.GetValue(4).ToString()); } if (!dataReader.IsDBNull(5)) { qcMessageTemplet.INPUT_CODE = dataReader.GetString(5); } if (!dataReader.IsDBNull(6)) { qcMessageTemplet.MESSAGE_TITLE = dataReader.GetString(6); } if (!dataReader.IsDBNull(7)) { qcMessageTemplet.ISVETO = dataReader.GetString(7) == "1"; } lstQCMessageTemplets.Add(qcMessageTemplet); } while (dataReader.Read()); return(SystemData.ReturnValue.OK); } catch (Exception ex) { LogManager.Instance.WriteLog("MedQCAccess.GetQCMessageTempletList", new string[] { "szSQL" }, new object[] { szSQL }, ex); return(SystemData.ReturnValue.EXCEPTION); } finally { if (dataReader != null) { dataReader.Close(); dataReader.Dispose(); dataReader = null; } base.MedQCAccess.CloseConnnection(false); } }
protected override void OnShown(EventArgs e) { base.OnShown(e); this.txtChecker.Text = SystemParam.Instance.UserInfo.USER_ID; if (SystemParam.Instance.PatVisitInfo == null) { return; } if (String.IsNullOrEmpty(SystemParam.Instance.PatVisitInfo.DISCHARGE_MODE)) { this.rdbIn.Checked = true; } else if (SystemParam.Instance.PatVisitInfo.DISCHARGE_MODE == "死亡") { this.rdbDeath.Checked = true; } else { this.rdbOut.Checked = true; } this.txtPatientID.Text = SystemParam.Instance.PatVisitInfo.PATIENT_ID; this.txtPatName.Text = SystemParam.Instance.PatVisitInfo.PATIENT_NAME; this.txtPatSex.Text = SystemParam.Instance.PatVisitInfo.PATIENT_SEX; this.txtDocTitle.Text = this.m_MedicalQcMsg.TOPIC; this.txtQuestionType.Text = "<双击选择>"; this.txt_ISSUED_DATE_TIME.Text = this.m_MedicalQcMsg.ISSUED_DATE_TIME.ToString("yyyy-M-d HH:mm"); if (this.MedicalQcMsg != null && !string.IsNullOrEmpty(this.m_MedicalQcMsg.QC_MSG_CODE)) { if (this.m_MedicalQcMsg.ASK_DATE_TIME != this.m_MedicalQcMsg.DefaultTime) { this.txtAskDateTime.Text = this.m_MedicalQcMsg.ASK_DATE_TIME.ToString(); } this.txtDoctorComment.Text = this.m_MedicalQcMsg.DOCTOR_COMMENT; this.txtQuestionType.Text = this.MedicalQcMsg.QA_EVENT_TYPE; this.txtMessage.Text = this.MedicalQcMsg.MESSAGE; this.txtMessage.Focus(); this.txtMessage.SelectAll(); this.txtMessage.Tag = this.MedicalQcMsg.QC_MSG_CODE; this.txtBoxScore.Text = this.MedicalQcMsg.POINT.ToString(); //修改或者浏览 //设置病历类型 if (this.MedicalQcMsg.QCDOC_TYPE == SystemData.QCDocType.INHOSPITAL) { this.rdbIn.Checked = true; } else if (this.MedicalQcMsg.QCDOC_TYPE == SystemData.QCDocType.OUTHOSPITAL) { this.rdbOut.Checked = true; } else { this.rdbDeath.Checked = true; } if (!string.IsNullOrEmpty(this.m_MedicalQcMsg.QC_MSG_CODE)) { QcMsgDict qcMsgDict = ListQcMsgDict.Where(m => m.QC_MSG_CODE == this.m_MedicalQcMsg.QC_MSG_CODE).FirstOrDefault(); this.txtMesssageTitle.Text = qcMsgDict.MESSAGE_TITLE; if (qcMsgDict != null) { this.lbCurrentScoreInfo.Text = "问题标准分数:" + Math.Round(new decimal(GlobalMethods.Convert.StringToValue(qcMsgDict.SCORE, 0f)), 1).ToString("F1"); } this.lbCurrentScoreInfo.Tag = qcMsgDict; List <QcMsgDict> lstQCMessageTemplet = ListQcMsgDict; if (lstQCMessageTemplet == null) { MessageBoxEx.Show("质控质检问题字典表获取失败!"); } var item = lstQCMessageTemplet.Where(m => m.QC_MSG_CODE == this.m_MedicalQcMsg.QC_MSG_CODE).FirstOrDefault(); if (item != null) { this.SetScoreInfos(item); //在修改分数的时候,减去当前选中的 double scoreLevel1Count = 0.0; //大类分数 double scoreLevel2Count = 0.0; //子类分数 double currentScore = (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(this.txtBoxScore.Text, 0f)), 1); scoreLevel1Count = (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(this.txtLevel1Score.Text, 0f)), 1); scoreLevel2Count = (double)Math.Round(new decimal(GlobalMethods.Convert.StringToValue(this.txtLevel2Socre.Text, 0f)), 1); scoreLevel1Count -= currentScore; scoreLevel2Count -= currentScore; this.txtLevel1Score.Text = scoreLevel1Count.ToString(); this.txtLevel2Socre.Text = scoreLevel2Count.ToString(); } } } LoadComboboxDoctorInCharge(); }
public short GetQcMsgDict(string szQcMsgCode, ref QcMsgDict msgTemplet) { if (base.MedQCAccess == null) { return(SystemData.ReturnValue.PARAM_ERROR); } string szField = string.Format("{0},{1},{2},{3},{4},{5},{6},{7}" , SystemData.QcMsgDictTable.SERIAL_NO , SystemData.QcMsgDictTable.QC_MSG_CODE , SystemData.QcMsgDictTable.QA_EVENT_TYPE , SystemData.QcMsgDictTable.MESSAGE , SystemData.QcMsgDictTable.SCORE , SystemData.QcMsgDictTable.INPUT_CODE , SystemData.QcMsgDictTable.MESSAGE_TITLE , SystemData.QcMsgDictTable.ISVETO); string szCondtion = string.Format("{0}='{1}'" , SystemData.QcMsgDictTable.QC_MSG_CODE, szQcMsgCode); string szSQL = string.Format(SystemData.SQL.SELECT_WHERE_ORDER_ASC, szField, SystemData.DataTable.QC_MSG_DICT, szCondtion , SystemData.QcMsgDictTable.SERIAL_NO); IDataReader dataReader = null; try { dataReader = base.MedQCAccess.ExecuteReader(szSQL, CommandType.Text); if (dataReader == null || dataReader.IsClosed || !dataReader.Read()) { return(SystemData.ReturnValue.RES_NO_FOUND); } if (msgTemplet == null) { msgTemplet = new QcMsgDict(); } if (!dataReader.IsDBNull(0)) { msgTemplet.SERIAL_NO = int.Parse(dataReader.GetValue(0).ToString()); } if (!dataReader.IsDBNull(1)) { msgTemplet.QC_MSG_CODE = dataReader.GetString(1); } if (!dataReader.IsDBNull(2)) { msgTemplet.QA_EVENT_TYPE = dataReader.GetString(2); } if (!dataReader.IsDBNull(3)) { msgTemplet.MESSAGE = dataReader.GetString(3); } if (!dataReader.IsDBNull(4)) { msgTemplet.SCORE = float.Parse(dataReader.GetValue(4).ToString()); } if (!dataReader.IsDBNull(5)) { msgTemplet.INPUT_CODE = dataReader.GetString(5); } if (!dataReader.IsDBNull(6)) { msgTemplet.MESSAGE_TITLE = dataReader.GetString(6); } if (!dataReader.IsDBNull(7)) { msgTemplet.ISVETO = dataReader.GetString(7) == "1"; } return(SystemData.ReturnValue.OK); } catch (Exception ex) { LogManager.Instance.WriteLog("", new string[] { "szSQL" }, new object[] { szSQL }, ex); return(SystemData.ReturnValue.EXCEPTION); } finally { if (dataReader != null) { dataReader.Close(); dataReader.Dispose(); dataReader = null; } base.MedQCAccess.CloseConnnection(false); } }