/// <summary> /// 运行某患者病案自动检查缺陷内容 /// </summary> public void CheckPatient(PatVisitInfo patVisitLog) { //初始化患者病案资料 Heren.MedQC.CheckPoint.CheckPointHelper.Instance.InitPatientInfo(patVisitLog); //获取缺陷自动检查配置规则列表 List <QcCheckPoint> lstQcCheckPoint = null; short shRet = QcCheckPointAccess.Instance.GetQcCheckPoints(ref lstQcCheckPoint); if (shRet != SystemData.ReturnValue.OK) { return; } foreach (var item in lstQcCheckPoint) { if (string.IsNullOrEmpty(item.HandlerCommand)) { continue; } object result = null; CommandHandler.Instance.SendCommand(item.HandlerCommand, item, patVisitLog, out result); QcCheckResult qcCheckResult = result as QcCheckResult; if (qcCheckResult == null) { continue; } QcCheckResultAccess.Instance.SaveQcCheckResult(qcCheckResult); } }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; string szSQl = string.Format("select t.HBSAG_INDICATOR, t.HCV_AB_INDICATOR, t.HIV_AB_INDICATOR from PAT_VISIT_V t where t.PATIENT_ID = '{0}' and t.VISIT_NO = '{1}' " , patVisitLog.PATIENT_ID , patVisitLog.VISIT_ID); DataSet ds = null; short shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } //检验结果乙肝表面抗原、丙肝抗体、艾滋病抗体,还不太清楚如何判断阳性,规则默认为通过 qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); }
private void button1_Click(object sender, EventArgs e) { PatVisitInfo patVisitLog = new PatVisitInfo(); patVisitLog.PATIENT_ID = "P099634"; patVisitLog.VISIT_ID = "20150722000000000002"; patVisitLog.VISIT_TIME = DateTime.Now.AddDays(-2); CheckPointHelper.Instance.InitPatientInfo(patVisitLog); QcCheckPoint qcCheckPoint = new QcCheckPoint(); qcCheckPoint.CheckPointID = "P201608261507573079"; short shRet = QcCheckPointAccess.Instance.GetQcCheckPoint(qcCheckPoint.CheckPointID, ref qcCheckPoint); Object result = null; CommandHandler.Instance.SendCommand(qcCheckPoint.HandlerCommand, qcCheckPoint, patVisitLog, out result); QcCheckResult qcCheckResult = result as QcCheckResult; shRet = QcCheckResultAccess.Instance.SaveQcCheckResult(qcCheckResult); if (qcCheckResult.QC_RESULT == 1) { MessageBox.Show("检查通过"); return; } MessageBox.Show(qcCheckResult.QC_EXPLAIN); }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; //查询是否有检验记录 string szSQl = string.Format("select b.ITEM_RESULT from LAB_MASTER_V a,LAB_RESULT_V b where a.TEST_ID = b.TEST_ID and b.ITEM_NAME like '%血型%' and a.PATIENT_ID = '{0}' and a.VISIT_ID = '{1}' " , patVisitLog.PATIENT_ID , patVisitLog.VISIT_ID); DataSet ds = null; short shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } string ITEM_RESULT = ds.Tables[0].Rows[0]["ITEM_RESULT"].ToString(); if (string.IsNullOrEmpty(ITEM_RESULT)) { qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } //查询首页血型填写情况 szSQl = string.Format("select BLOOD_TYPE_NAME from pat_visit_v a where a.PATIENT_ID ='{0}' and a.VISIT_NO ='{1}'" , patVisitLog.PATIENT_ID , patVisitLog.VISIT_NO); shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_EXPLAIN = string.Format("检验记录中有血型结果{0}型,但首页未填", ITEM_RESULT); qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; return(true); } string CODE_NAME = ds.Tables[0].Rows[0]["BLOOD_TYPE_NAME"].ToString(); if (string.IsNullOrEmpty(CODE_NAME)) { qcCheckResult.QC_EXPLAIN = string.Format("检验记录中有血型结果{0}型,但首页未填", ITEM_RESULT); qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; return(true); } if (CODE_NAME != ITEM_RESULT) { qcCheckResult.QC_EXPLAIN = string.Format("检验记录中有血型结果{0}型,首页填写血型为{1}型", ITEM_RESULT, CODE_NAME); qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; return(true); } qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; //查询患者指定文书类型ID号 List <MedDocInfo> documentlist = TimeCheckHelper.Instance.GetDocumentList(qcCheckPoint.DocTypeID, patVisitLog.MedDocInfos); if (documentlist == null || documentlist.Count == 0) { qcCheckResult.QC_EXPLAIN = "未写出院记录,规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } //获取文书xml内容 string szXMLFile = null; MedXMLAccess.Instance.GetDocXml(documentlist[0], ref szXMLFile); if (string.IsNullOrEmpty(szXMLFile)) { qcCheckResult.QC_EXPLAIN = "未写出院记录,规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } qcCheckResult.DOC_SETID = documentlist[0].DOC_SETID; qcCheckResult.DOC_TITLE = documentlist[0].DOC_TITLE; qcCheckResult.DOCTYPE_ID = documentlist[0].DOC_TYPE; qcCheckResult.DOC_TIME = documentlist[0].DOC_TIME; XmlDocument doc = new XmlDocument(); doc.Load(szXMLFile); string[] items = { "入院情况", "入院诊断", "诊疗经过", "出院诊断", "出院后注意事项" }; StringBuilder sb = new StringBuilder(); for (int i = 0; i < items.Length; i++) { XmlNode child = doc.SelectSingleNode(string.Format("//Field[@Name='{0}']", items[i])); if (child == null || string.IsNullOrEmpty(child.InnerText))//存在一项为空则直接返回不继续判断 { sb.AppendFormat("{0}为空,", items[i]); } } if (sb.ToString() != string.Empty) { qcCheckResult.QC_EXPLAIN = sb.ToString(); qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; return(true); } qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); }
/// <summary> /// 加载评分结果,切换患者刷新只需要更新评分结果 /// </summary> public void LoadHummanScoreInfos() { string szPatientID = SystemParam.Instance.PatVisitInfo.PATIENT_ID; string szVisitID = SystemParam.Instance.PatVisitInfo.VISIT_ID; if (m_lstQcCheckResult == null) { m_lstQcCheckResult = new List <QcCheckResult>(); } m_lstQcCheckResult.Clear(); short shRet = QcCheckResultAccess.Instance.GetQcCheckResults(SystemParam.Instance.DefaultTime, SystemParam.Instance.DefaultTime, szPatientID, szVisitID, null, null, null, SystemData.StatType.Artificial, ref m_lstQcCheckResult); if (shRet != SystemData.ReturnValue.OK && shRet != SystemData.ReturnValue.RES_NO_FOUND) { MessageBoxEx.Show("质控质检问题下载失败!"); return; } foreach (DataGridViewRow row in this.dgvHummanScore.Rows) { if (row is CollapseDataGridViewRow) { //第一级分类行 CollapseDataGridViewRow FirstRow = (row as CollapseDataGridViewRow); foreach (var item in FirstRow.Rows) { var qcMsgDict = item.Tag as QcMsgDict; if (qcMsgDict == null || string.IsNullOrEmpty(qcMsgDict.MESSAGE)) { continue; } if (m_lstQcCheckResult != null) { QcCheckResult qcCheckResult = m_lstQcCheckResult.Where(m => m.MSG_DICT_CODE == qcMsgDict.QC_MSG_CODE).FirstOrDefault(); if (qcCheckResult != null) { item.Cells[this.colRemark.Index].Value = qcCheckResult.REMARKS; item.Cells[this.colCheckBox.Index].Value = true; item.Cells[this.colErrorCount.Index].Value = qcCheckResult.ERROR_COUNT; item.Cells[this.colErrorCount.Index].ReadOnly = false; item.Cells[this.colRemark.Index].ReadOnly = false; } else { item.Cells[this.colRemark.Index].Value = null; item.Cells[this.colCheckBox.Index].Value = false; item.Cells[this.colErrorCount.Index].Value = null; item.Cells[this.colErrorCount.Index].ReadOnly = true; item.Cells[this.colRemark.Index].ReadOnly = true; } } } } } //默认展开第一组 //this.dgvHummanScore.Expand(0); this.CalHummanScore(); }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; //查询患者指定文书类型ID号 List <MedDocInfo> documentlist = TimeCheckHelper.Instance.GetDocumentList(qcCheckPoint.DocTypeID, patVisitLog.MedDocInfos); if (documentlist == null || documentlist.Count == 0) { qcCheckResult.QC_EXPLAIN = "未写围手术期记录,规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } string 手术记录输血量 = string.Empty; string 术后首次病程输血量 = string.Empty; foreach (var docinfo in documentlist) { //获取文书xml内容 string szXMLFile = null; MedXMLAccess.Instance.GetDocXml(docinfo, ref szXMLFile); if (string.IsNullOrEmpty(szXMLFile)) { qcCheckResult.QC_EXPLAIN = "未写围手术期记录,规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } XmlDocument doc = new XmlDocument(); doc.Load(szXMLFile); XmlNode node = doc.SelectSingleNode(string.Format("/EmrDoc/Body/Section[@ID='{0}']//Field[@Name='术中输血量']", docinfo.DOC_ID)); if (node != null && !string.IsNullOrEmpty(node.InnerText)) { if (docinfo.DOC_TITLE == "手术记录") { 手术记录输血量 = node.InnerText; } else if (docinfo.DOC_TITLE == "术后首次病程") { 术后首次病程输血量 = node.InnerText; } } } if (手术记录输血量 != 术后首次病程输血量) { qcCheckResult.QC_EXPLAIN = string.Format("手术记录内填写{0}ml输血量,术后首次病程内填写{1}ml输血量,两者不一致", 手术记录输血量, 术后首次病程输血量); qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; return(true); } qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); }
/// <summary> /// 新增整改通知书 /// </summary> private void InsertModifyNotice(QcModifyNotice qcModifyNotice) { if (MessageBoxEx.ShowConfirm("评分结果将以消息形式发送到医生工作台,确认发送通知书吗?") != DialogResult.OK) { return; } qcModifyNotice.MODIFY_NOTICE_ID = qcModifyNotice.MakeID(); qcModifyNotice.MODIFY_PERIOD = this.cbo_MODIFY_PERIOD.Text; qcModifyNotice.MODIFY_REMARK = this.rtb_MODIFY_REMARK.Text; qcModifyNotice.MODIFY_SCORE = float.Parse(this.lbl_MODIFY_SCORE.Text); qcModifyNotice.NOTICE_TIME = DateTime.Parse(this.lbl_NOTICE_TIME.Text); qcModifyNotice.PATIENT_ID = SystemParam.Instance.PatVisitInfo.PATIENT_ID; qcModifyNotice.PATIENT_NAME = SystemParam.Instance.PatVisitInfo.PATIENT_NAME; qcModifyNotice.QC_DEPT_CODE = SystemParam.Instance.UserInfo.DEPT_CODE; qcModifyNotice.QC_DEPT_NAME = SystemParam.Instance.UserInfo.DEPT_NAME; qcModifyNotice.QC_LEVEL = SystemData.QcLevel.GetCodeByMrStatus(SystemParam.Instance.PatVisitInfo.MR_STATUS); qcModifyNotice.QC_MAN = SystemParam.Instance.UserInfo.USER_NAME; qcModifyNotice.QC_MAN_ID = SystemParam.Instance.UserInfo.USER_ID; qcModifyNotice.RECEIVER = SystemParam.Instance.PatVisitInfo.INCHARGE_DOCTOR; qcModifyNotice.RECEIVER_ID = SystemParam.Instance.PatVisitInfo.INCHARGE_DOCTOR_ID; qcModifyNotice.RECEIVER_DEPT_CODE = SystemParam.Instance.PatVisitInfo.DEPT_CODE; qcModifyNotice.RECEIVER_DEPT_NAME = SystemParam.Instance.PatVisitInfo.DEPT_NAME; qcModifyNotice.VISIT_ID = SystemParam.Instance.PatVisitInfo.VISIT_ID; qcModifyNotice.VISIT_NO = SystemParam.Instance.PatVisitInfo.VISIT_NO; qcModifyNotice.NOTICE_STATUS = SystemData.NotifyStatus.Sended; short shRet = QcModifyNoticeAccess.Instance.Insert(qcModifyNotice); //新增质检信息 更新人工质控结果 新增 foreach (DataGridViewRow item in this.dataTableView1.Rows) { QcCheckResult qcCheckResult = item.Tag as QcCheckResult; qcCheckResult.MODIFY_NOTICE_ID = qcModifyNotice.MODIFY_NOTICE_ID; MedicalQcMsg medicalQcMsg = item.Cells[this.col_MSG_ID.Index].Tag as MedicalQcMsg; UserInfo userInfo = item.Cells[this.col_INCHARGE_DOCTOR.Index].Tag as UserInfo; if (userInfo != null) { qcCheckResult.DEPT_CODE = userInfo.DEPT_CODE; qcCheckResult.DEPT_IN_CHARGE = userInfo.DEPT_NAME; qcCheckResult.INCHARGE_DOCTOR = userInfo.USER_NAME; qcCheckResult.INCHARGE_DOCTOR_ID = userInfo.USER_ID; } if (medicalQcMsg == null) { medicalQcMsg = this.ToQcMsg(qcCheckResult); shRet = MedicalQcMsgAccess.Instance.Insert(medicalQcMsg); } qcCheckResult.MSG_ID = medicalQcMsg.MSG_ID; shRet = QcCheckResultAccess.Instance.Update(qcCheckResult); } if (shRet == SystemData.ReturnValue.OK) { MessageBoxEx.ShowMessage("发送成功"); this.lbl_NOTICE_STATUS.Text = SystemData.NotifyStatus.GetCnName(qcModifyNotice.NOTICE_STATUS); this.lbl_NOTICE_STATUS.ForeColor = Color.Blue; this.herenButton1.Text = "修改整改通知单"; } }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; //查询患者指定文书类型ID号 List <MedDocInfo> documentlist = TimeCheckHelper.Instance.GetDocumentList(qcCheckPoint.DocTypeID, patVisitLog.MedDocInfos); if (documentlist == null || documentlist.Count == 0) { qcCheckResult.QC_EXPLAIN = "未写入院记录,规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } //获取文书xml内容 string szXMLFile = null; MedXMLAccess.Instance.GetDocXml(documentlist[0], ref szXMLFile); if (string.IsNullOrEmpty(szXMLFile)) { qcCheckResult.QC_EXPLAIN = "未写入院记录,规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } qcCheckResult.DOC_SETID = documentlist[0].DOC_SETID; qcCheckResult.DOC_TITLE = documentlist[0].DOC_TITLE; qcCheckResult.DOCTYPE_ID = documentlist[0].DOC_TYPE; qcCheckResult.DOC_TIME = documentlist[0].DOC_TIME; XmlDocument doc = new XmlDocument(); doc.Load(szXMLFile); XmlNode node = doc.SelectSingleNode(string.Format("//Field[@Name='{0}']", "现病史")); if (node == null || string.IsNullOrEmpty(node.InnerText))//存在一项为空则直接返回不继续判断 { qcCheckResult.QC_EXPLAIN = string.Format("{0}为空", "现病史"); qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; return(true); } if (node.InnerText.IndexOf("食") < 0 || node.InnerText.IndexOf("眠") < 0 && node.InnerText.IndexOf("便") < 0) { qcCheckResult.QC_EXPLAIN = string.Format("缺食欲、睡眠或大便情况描述信息"); qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; return(true); } qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; string szSQl = string.Format("select t.SPEC_LEVEL_NURS_DAYS,t.FIRST_LEVEL_NURS_DAYS,t.SECOND_LEVEL_NURS_DAYS,t.ADMISSION_DATE_TIME,t.DISCHARGE_DATE_TIME from PAT_VISIT_V t where t.PATIENT_ID = '{0}' and t.VISIT_NO = '{1}' " , patVisitLog.PATIENT_ID , patVisitLog.VISIT_NO); DataSet ds = null; short shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } string SPEC_LEVEL_NURS_DAYS = ds.Tables[0].Rows[0]["SPEC_LEVEL_NURS_DAYS"].ToString(); string FIRST_LEVEL_NURS_DAYS = ds.Tables[0].Rows[0]["FIRST_LEVEL_NURS_DAYS"].ToString(); string SECOND_LEVEL_NURS_DAYS = ds.Tables[0].Rows[0]["SECOND_LEVEL_NURS_DAYS"].ToString(); string ADMISSION_DATE_TIME = ds.Tables[0].Rows[0]["ADMISSION_DATE_TIME"].ToString(); string DISCHARGE_DATE_TIME = ds.Tables[0].Rows[0]["DISCHARGE_DATE_TIME"].ToString(); if (string.IsNullOrEmpty(DISCHARGE_DATE_TIME) || string.IsNullOrEmpty(ADMISSION_DATE_TIME)) { qcCheckResult.QC_EXPLAIN = "患者未出院,规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } DateTime dtAdmisson = DateTime.Parse(ADMISSION_DATE_TIME); DateTime dtDischarge = DateTime.Parse(DISCHARGE_DATE_TIME); int period = (dtDischarge - dtAdmisson).Days; int nspec = 0; int nfirst = 0; int nsecond = 0; int.TryParse(SPEC_LEVEL_NURS_DAYS, out nspec); int.TryParse(FIRST_LEVEL_NURS_DAYS, out nfirst); int.TryParse(SECOND_LEVEL_NURS_DAYS, out nsecond); if (period < (nspec + nfirst + nsecond)) { qcCheckResult.QC_EXPLAIN = "特级、一级护理、二级护理、三级护理之和大于住院天数"; qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; return(true); } qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; string szSQl = string.Format("select a.DIAGNOSIS_CODE,a.DIAG_TYPE,a.DIAGNOSIS_DESC from DIAGNOSIS_V a where a.VISIT_NO ='{1}' and a.PATIENT_ID ='{0}' and a.DIAG_TYPE = 7 " , patVisitLog.PATIENT_ID , patVisitLog.VISIT_NO); DataSet ds = null; short shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } string DIAGNOSIS_CODE = ds.Tables[0].Rows[0]["DIAGNOSIS_CODE"].ToString(); string DIAG_TYPE = ds.Tables[0].Rows[0]["DIAG_TYPE"].ToString(); string DIAG_DESC = ds.Tables[0].Rows[0]["DIAGNOSIS_DESC"].ToString(); if (DIAGNOSIS_CODE != "X59.801" && DIAGNOSIS_CODE != "W28.801") { qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } szSQl = string.Format("select TRAINING_INJURY from pat_visit_v a where a.PATIENT_ID='{0}' and a.VISIT_NO='{1}'" , patVisitLog.PATIENT_ID , patVisitLog.VISIT_NO); shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } string TRAINING_INJURY = ds.Tables[0].Rows[0]["TRAINING_INJURY"].ToString(); if (string.IsNullOrEmpty(TRAINING_INJURY) || TRAINING_INJURY == "0") { qcCheckResult.QC_EXPLAIN = string.Format("外部损伤原因诊断编码为{0},但军事训练上不为是", DIAGNOSIS_CODE); qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; return(true); } qcCheckResult.QC_RESULT = 1; qcCheckResult.QC_EXPLAIN = "规则通过"; return(true); }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; string szSQl = string.Format("select a.ANAESTHESIA_METHOD_NAME,a.ANESTHESIA_DOCTOR,a.OPERATING_DATE,a.operation_desc from operation_v a where a.VISIT_NO = '{1}' and a.PATIENT_ID = '{0}' " , patVisitLog.PATIENT_ID , patVisitLog.VISIT_NO); DataSet ds = null; short shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_EXPLAIN = "未找到手术记录,规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } StringBuilder sb = new StringBuilder(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string ANAESTHESIA_METHOD_NAME = ds.Tables[0].Rows[i]["ANAESTHESIA_METHOD_NAME"].ToString(); string ANESTHESIA_DOCTOR = ds.Tables[0].Rows[i]["ANESTHESIA_DOCTOR"].ToString(); string OPERATING_DATE = ds.Tables[0].Rows[i]["OPERATING_DATE"].ToString(); string operation_desc = ds.Tables[0].Rows[i]["operation_desc"].ToString(); if (ANAESTHESIA_METHOD_NAME.IndexOf("全麻") >= 0 || ANAESTHESIA_METHOD_NAME.IndexOf("全身麻醉") >= 0) { if (string.IsNullOrEmpty(ANESTHESIA_DOCTOR)) { sb.AppendFormat("{0}行{1}手术,使用{2},未记录麻醉医师姓名" , OPERATING_DATE , operation_desc , ANAESTHESIA_METHOD_NAME ); } } } if (sb.Length == 0) { qcCheckResult.QC_RESULT = 1; qcCheckResult.QC_EXPLAIN = "规则通过"; return(true); } qcCheckResult.QC_RESULT = 0; qcCheckResult.QC_EXPLAIN = sb.ToString(); qcCheckResult.ERROR_COUNT = 1; return(true); }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex < 0) { return; } DataGridViewColumn column = dataGridView1.Columns[e.ColumnIndex]; if (!(column is DataGridViewButtonColumn)) { return; } QcCheckPoint qcCheckPoint = this.dataGridView1.Rows[e.RowIndex].Tag as QcCheckPoint; if (string.IsNullOrEmpty(qcCheckPoint.HandlerCommand)) { return; } Object result = null; DateTime startTime = DateTime.Now; PatVisitInfo patVisitLog = new PatVisitInfo() { PATIENT_ID = this.txtPatientID.Text, VISIT_ID = this.txtVisitID.Text }; Heren.MedQC.CheckPoint.CheckPointHelper.Instance.InitPatientInfo(patVisitLog); CommandHandler.Instance.SendCommand(qcCheckPoint.HandlerCommand, qcCheckPoint, patVisitLog, out result); //这里可以编写你需要的任意关于按钮事件的操作~ QcCheckResult qcCheckResult = result as QcCheckResult; short shRet = QcCheckResultAccess.Instance.SaveQcCheckResult(qcCheckResult); string time = (DateTime.Now - startTime).TotalSeconds.ToString(); this.label3.Text = "耗时:" + time; if (qcCheckResult == null) { return; } if (qcCheckResult.QC_RESULT == 1) { MessageBoxEx.ShowMessage("规则通过"); return; } MessageBox.Show(qcCheckResult.QC_EXPLAIN); } catch (Exception ex) { LogManager.Instance.WriteLog("单规则测试出错", ex); MessageBoxEx.ShowErrorFormat("单规则测试出错", ex.ToString(), null); } }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; //查询患者指定文书类型ID号 string szPeriodDesc = string.Empty; DateTime dtEndTime = TimeCheckHelper.Instance.GetWrittenPeriod(qcCheckPoint.WrittenPeriod, patVisitLog.VISIT_TIME, ref szPeriodDesc); List <MedDocInfo> documentlist = TimeCheckHelper.Instance.GetDocumentList(qcCheckPoint.DocTypeID, patVisitLog.MedDocInfos); foreach (var item in documentlist) { //找到文书入院记录相关的文书,判断文档创建时间是否在入院24小时之内 if (item.DOC_TIME > dtEndTime) { qcCheckResult.QC_RESULT = 0; qcCheckResult.QC_EXPLAIN = string.Format("患者{0}入院,书写{1}时间{2},结果超时", patVisitLog.VISIT_TIME.ToString(), item.DOC_TITLE, item.DOC_TIME.ToString()); qcCheckResult.ERROR_COUNT = 1; } else { qcCheckResult.QC_RESULT = 1; qcCheckResult.QC_EXPLAIN = string.Format("患者{0}入院,书写{1}时间{2},结果正常", patVisitLog.VISIT_TIME.ToString(), item.DOC_TITLE, item.DOC_TIME.ToString()); } qcCheckResult.DOC_TITLE = item.DOC_TITLE; qcCheckResult.DOC_TIME = item.DOC_TIME; qcCheckResult.DOC_SETID = item.DOC_SETID; qcCheckResult.DOCTYPE_ID = item.DOC_TYPE; qcCheckResult.MODIFY_TIME = item.MODIFY_TIME; qcCheckResult.CREATE_ID = item.CREATOR_ID; qcCheckResult.CREATE_NAME = item.CREATOR_NAME; break; } if (string.IsNullOrEmpty(qcCheckResult.QC_EXPLAIN) && DateTime.Now > dtEndTime) { qcCheckResult.QC_RESULT = 0; qcCheckResult.QC_EXPLAIN = string.Format("患者{0}入院,相关病历未书写,期限已到,结果超时", patVisitLog.VISIT_TIME.ToString()); qcCheckResult.ERROR_COUNT = 1; } else if (string.IsNullOrEmpty(qcCheckResult.QC_EXPLAIN)) { qcCheckResult.QC_RESULT = 1; qcCheckResult.QC_EXPLAIN = string.Format("患者{0}入院,相关病历未书写,期限未到,结果正常", patVisitLog.VISIT_TIME.ToString()); return(true); } return(true); }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; string szSQl = string.Format("select DEPT_DISCHARGE_FROM,DEPT_ADMISSION_TO,ADMISSION_DATE_TIME from pat_visit_v t where t.patient_id ='{0}' and t.visit_no = '{1}'" , patVisitLog.PATIENT_ID , patVisitLog.VISIT_NO); DataSet ds = null; short shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_RESULT = 1; return(false); } StringBuilder description = new StringBuilder(); string DEPT_DISCHARGE_FROM = ds.Tables[0].Rows[0]["DEPT_DISCHARGE_FROM"].ToString(); if (string.IsNullOrEmpty(DEPT_DISCHARGE_FROM)) { description.Append("出院科室为空;"); } string DEPT_ADMISSION_TO = ds.Tables[0].Rows[0]["DEPT_ADMISSION_TO"].ToString(); if (string.IsNullOrEmpty(DEPT_ADMISSION_TO)) { description.Append("入院科室为空;"); } string ADMISSION_DATE_TIME = ds.Tables[0].Rows[0]["ADMISSION_DATE_TIME"].ToString(); if (string.IsNullOrEmpty(ADMISSION_DATE_TIME)) { description.Append("入院时间为空;"); } if (description.Length == 0) { qcCheckResult.QC_RESULT = 1; qcCheckResult.QC_EXPLAIN = "规则通过"; return(true); } qcCheckResult.QC_RESULT = 0; qcCheckResult.QC_EXPLAIN = description.ToString(); qcCheckResult.ERROR_COUNT = 1; return(true); }
/// <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; }
private void dataGridView2_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } DataGridViewRow row = this.dataGridView2.Rows[e.RowIndex]; QcCheckResult docCheckResult = row.Tag as QcCheckResult; if (docCheckResult == null) { return; } this.MainForm.OpenDocument(string.Empty, docCheckResult.PATIENT_ID, docCheckResult.VISIT_ID); }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } DataGridViewColumn column = dataGridView1.Columns[e.ColumnIndex]; if (!(column is DataGridViewButtonColumn)) { return; } QcCheckPoint qcCheckPoint = this.dataGridView1.Rows[e.RowIndex].Tag as QcCheckPoint; if (string.IsNullOrEmpty(qcCheckPoint.HandlerCommand)) { return; } Object result = null; PatVisitInfo patVisitLog = SystemParam.Instance.PatVisitInfo; if (SystemParam.Instance.PatVisitInfo == null) { MessageBoxEx.Show("请在患者列表中选择患者"); return; } Heren.MedQC.CheckPoint.CheckPointHelper.Instance.InitPatientInfo(patVisitLog); CommandHandler.Instance.SendCommand(qcCheckPoint.HandlerCommand, qcCheckPoint, patVisitLog, out result); //这里可以编写你需要的任意关于按钮事件的操作~ QcCheckResult qcCheckResult = result as QcCheckResult; if (qcCheckResult == null) { return; } short shRet = QcCheckResultAccess.Instance.SaveQcCheckResult(qcCheckResult); if (qcCheckResult.QC_RESULT == 1) { MessageBoxEx.ShowMessage("规则通过"); return; } MessageBox.Show(qcCheckResult.QC_EXPLAIN); }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; //查询是否有检验记录 string szSQl = string.Format("select EMER_TREAT_TIMES,ESC_EMER_TIMES from PAT_VISIT_V a where a.PATIENT_ID ='{0}' and a.VISIT_NO ='{1}'" , patVisitLog.PATIENT_ID , patVisitLog.VISIT_NO); DataSet ds = null; short shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } string EMER_TREAT_TIMES = ds.Tables[0].Rows[0]["EMER_TREAT_TIMES"].ToString(); //抢救次数 string ESC_EMER_TIMES = ds.Tables[0].Rows[0]["ESC_EMER_TIMES"].ToString(); //抢救成功次数 if (string.IsNullOrEmpty(EMER_TREAT_TIMES) || string.IsNullOrEmpty(ESC_EMER_TIMES)) { qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } int nEmer = 0; int.TryParse(EMER_TREAT_TIMES, out nEmer); int nEsc = 0; int.TryParse(ESC_EMER_TIMES, out nEsc); if (nEmer < nEsc) { qcCheckResult.QC_EXPLAIN = string.Format("首页填写抢救次数为{0},抢救成功次数为{1}", nEmer, nEsc); qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; return(true); } qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); }
private void dataGridView4_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } if (e.ColumnIndex != this.col_4_QcResult.Index) { return; } QcCheckResult qcCheckResult = this.dataGridView4.Rows[e.RowIndex].Tag as QcCheckResult; if (qcCheckResult.QC_RESULT == 0) { MessageBoxEx.ShowWarning(qcCheckResult.QC_EXPLAIN); } }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; if (patVisitLog.DISCHARGE_TIME == DateTime.Parse("1900-01-01")) { qcCheckResult.QC_EXPLAIN = "患者未出院,规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } string szSQl = string.Format("select a.order_text,a.END_DATE_TIME,a.START_DATE_TIME from orders_v a where a.VISIT_ID ='{1}' and a.PATIENT_ID ='{0}' and a.ORDER_STATUS not in (4,7) and (END_DATE_TIME is null or START_DATE_TIME is null)" , patVisitLog.PATIENT_ID , patVisitLog.VISIT_ID); DataSet ds = null; short shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_RESULT = 1;//通过 qcCheckResult.QC_EXPLAIN = "规则通过"; return(true); } StringBuilder sb = new StringBuilder(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string order_text = ds.Tables[0].Rows[i]["order_text"].ToString(); string END_DATE_TIME = ds.Tables[0].Rows[i]["END_DATE_TIME"].ToString(); string START_DATE_TIME = ds.Tables[0].Rows[i]["START_DATE_TIME"].ToString(); sb.AppendFormat("医嘱{0},开始时间为{1},停止时间为{2};" , order_text , string.IsNullOrEmpty(START_DATE_TIME) ? "空" : START_DATE_TIME , string.IsNullOrEmpty(END_DATE_TIME) ? "空" : END_DATE_TIME); sb.AppendLine(); } qcCheckResult.QC_EXPLAIN = sb.ToString(); qcCheckResult.QC_RESULT = 0;//通过 qcCheckResult.ERROR_COUNT = 1; return(true); }
private void button13_Click(object sender, EventArgs e) { string szPatientID = this.textBox1.Text; string szVisitID = this.textBox2.Text; PatVisitInfo patVisitInfo = new PatVisitInfo(); short shRet = PatVisitAccess.Instance.GetPatVisitInfo(szPatientID, szVisitID, ref patVisitInfo); QcCheckPoint qcCheckPoint = null; string szQcCheckPointID = "P201608281312459709"; shRet = QcCheckPointAccess.Instance.GetQcCheckPoint(szQcCheckPointID, ref qcCheckPoint); DebuggerForm frm = new DebuggerForm(); frm.PatVisitInfo = patVisitInfo; frm.QcCheckPoint = qcCheckPoint; QcCheckResult qcCheckResult = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitInfo); frm.QcCheckResult = qcCheckResult; frm.Show(); }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; string szSQl = string.Format("select DIAG_CORRESPONDENCE,DIAG_COMPARE_GROUP_NAME from DIAG_COMPARING_V where a.PATIENT_ID ='{0}' and a.VISIT_NO ='{1}'" , patVisitLog.PATIENT_ID , patVisitLog.VISIT_NO); DataSet ds = null; short shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } StringBuilder sb = new StringBuilder(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string DIAG_CORRESPONDENCE = ds.Tables[0].Rows[i]["DIAG_CORRESPONDENCE"].ToString(); //诊断符合情况 string DIAG_COMPARE_GROUP_NAME = ds.Tables[0].Rows[i]["DIAG_COMPARE_GROUP_NAME"].ToString(); //诊断符合情况名 if (string.IsNullOrEmpty(DIAG_CORRESPONDENCE)) { sb.AppendFormat("{0}诊断符合情况未填;", DIAG_COMPARE_GROUP_NAME); } } if (sb.Length > 0) { qcCheckResult.QC_EXPLAIN = sb.ToString(); qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; return(true); } qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; //查询患者军人标志 string szSQl = string.Format("select a.IDENTITY,a.TRAINING_INJURY,a.MILITARY_INDICATOR from PAT_VISIT_V a where a.PATIENT_ID = '{0}' and a.VISIT_NO = '{1}'" , patVisitLog.PATIENT_ID , patVisitLog.VISIT_NO); DataSet ds = null; short shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } string MILITARY_INDICATOR = ds.Tables[0].Rows[0]["MILITARY_INDICATOR"].ToString(); //军人标志0-地方 1-军人 string IDENTITY = ds.Tables[0].Rows[0]["IDENTITY"].ToString(); //军人标志0-地方 1-军人 string TRAINING_INJURY = ds.Tables[0].Rows[0]["TRAINING_INJURY"].ToString(); //训练伤0-否 1-是 if (MILITARY_INDICATOR == "0" && !string.IsNullOrEmpty(TRAINING_INJURY)) { qcCheckResult.QC_EXPLAIN = string.Format("患者身份为{0},训练伤不为空", IDENTITY); qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; return(true); } if (MILITARY_INDICATOR == "1" && string.IsNullOrEmpty(TRAINING_INJURY)) { qcCheckResult.QC_EXPLAIN = string.Format("患者身份为{0},训练伤为空", IDENTITY); qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; return(true); } qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); }
private void colRight_SelectedIndexChanged(object sender, EventArgs e) { Heren.Common.Controls.TableView.FindComboBoxEditingControl control = sender as Heren.Common.Controls.TableView.FindComboBoxEditingControl; if (control.SelectedItem != null) { UserInfo userInfo = control.SelectedItem as UserInfo; QcCheckResult qcCheckResult = this.dataTableView1.CurrentRow.Tag as QcCheckResult; if (qcCheckResult == null) { return; } qcCheckResult.INCHARGE_DOCTOR = userInfo.USER_NAME; qcCheckResult.INCHARGE_DOCTOR_ID = userInfo.USER_ID; qcCheckResult.DEPT_CODE = userInfo.DEPT_CODE; qcCheckResult.DEPT_IN_CHARGE = userInfo.DEPT_NAME; this.dataTableView1.CurrentRow.Cells[this.col_DEPT_IN_CHARGE.Index].Value = userInfo.DEPT_NAME; this.dataTableView1.CurrentRow.Cells[this.col_INCHARGE_DOCTOR.Index].Value = userInfo.USER_ID; this.dataTableView1.CurrentRow.Cells[this.col_INCHARGE_DOCTOR.Index].Tag = userInfo; } }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; string szSQl = string.Format("select DIAGNOSIS_CODE,a.DIAG_TYPE,a.DIAG_DESC from DIAGNOSIS_V A where a.DIAG_DESC =b.DIAGNOSIS_NAME(+) and a.VISIT_NO ='{1}' and a.PATIENT_ID ='{0}' and (a.DIAG_TYPE =3 or a.DIAG_TYPE = 7) " , patVisitLog.PATIENT_ID , patVisitLog.VISIT_NO); DataSet ds = null; short shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string DIAGNOSIS_CODE = ds.Tables[0].Rows[i]["DIAGNOSIS_CODE"].ToString(); string DIAG_TYPE = ds.Tables[0].Rows[i]["DIAG_TYPE"].ToString(); string DIAG_DESC = ds.Tables[0].Rows[i]["DIAG_DESC"].ToString(); if (DIAG_TYPE == "7") { qcCheckResult.QC_EXPLAIN = "规则通过"; qcCheckResult.QC_RESULT = 1; return(true); } if (!string.IsNullOrEmpty(DIAGNOSIS_CODE) && (DIAGNOSIS_CODE.IndexOf("S") >= 0 || DIAGNOSIS_CODE.IndexOf("T") >= 0)) { //诊断编码包含S、T qcCheckResult.QC_EXPLAIN = "诊断编码包含S、T,损伤原因未填,规则不通过"; qcCheckResult.QC_RESULT = 0; qcCheckResult.ERROR_COUNT = 1; } } return(true); }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; //查询本次住院是否有发血记录 string szSQl = string.Format("select * from BLOOD_TRANSFUSION_V b where b.PATIENT_ID = '{0}' and b.VISIT_ID = '{1}'" , patVisitLog.PATIENT_ID , patVisitLog.VISIT_ID); DataSet ds = null; short shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); if (ds == null || ds.Tables[0].Rows.Count <= 0) { qcCheckResult.QC_RESULT = 1;//通过 qcCheckResult.QC_EXPLAIN = "规则通过"; return(true); } //患者存在输血,查找检验结果中是否有乙肝表面抗原、丙型肝炎抗体、艾滋病抗体筛查试验、梅毒螺旋体特异抗体测定四项 szSQl = string.Format("select b.ITEM_NAME from LAB_RESULT_V b,lab_master_v a where A.PATIENT_ID = '{0}' and A.VISIT_NO = '{1}' and b.test_id=a.TEST_ID and B.ITEM_NAME in('乙肝表面抗原', '丙肝抗体', '艾滋病抗体', '梅毒血清特异抗体测定')" , patVisitLog.PATIENT_ID , patVisitLog.VISIT_ID); shRet = CommonAccess.Instance.ExecuteQuery(szSQl, out ds); StringBuilder description = new StringBuilder(); if (ds == null || ds.Tables[0].Rows.Count <= 0) { description.Append("患者有发血记录,但患者检验结果中不存在乙肝表面抗原,丙肝抗体,艾滋病抗体,梅毒血清特异抗体测定"); qcCheckResult.QC_RESULT = 0;//不通过 qcCheckResult.ERROR_COUNT = 1; } else { description.Append("规则通过"); qcCheckResult.QC_RESULT = 1;//通过 } qcCheckResult.QC_EXPLAIN = description.ToString(); return(true); }
public QcCheckResult InitQcCheckResult(QcCheckPoint qcCheckPoint, PatVisitInfo patVisitInfo) { QcCheckResult qcCheckResult = new QcCheckResult(); qcCheckResult.PATIENT_ID = patVisitInfo.PATIENT_ID; qcCheckResult.VISIT_ID = patVisitInfo.VISIT_ID; qcCheckResult.VISIT_NO = patVisitInfo.VISIT_NO; qcCheckResult.PATIENT_NAME = patVisitInfo.PATIENT_NAME; qcCheckResult.DEPT_CODE = patVisitInfo.DEPT_CODE; qcCheckResult.DEPT_IN_CHARGE = patVisitInfo.DEPT_NAME; qcCheckResult.INCHARGE_DOCTOR = patVisitInfo.INCHARGE_DOCTOR; qcCheckResult.CHECK_POINT_ID = qcCheckPoint.CheckPointID; qcCheckResult.MSG_DICT_MESSAGE = qcCheckPoint.MsgDictMessage; qcCheckResult.CHECK_DATE = DateTime.Now; qcCheckResult.SCORE = qcCheckPoint.Score; qcCheckResult.QA_EVENT_TYPE = qcCheckPoint.QaEventType; qcCheckResult.MSG_DICT_CODE = qcCheckPoint.MsgDictCode; qcCheckResult.ORDER_VALUE = qcCheckPoint.OrderValue; qcCheckResult.MR_STATUS = string.IsNullOrEmpty(patVisitInfo.MR_STATUS)?"O":patVisitInfo.MR_STATUS; qcCheckResult.STAT_TYPE = SystemData.StatType.System; return(qcCheckResult); }
/// <summary> /// 人工检查结果转为消息对象 /// </summary> /// <param name="qcCheckResult"></param> /// <returns></returns> private MedicalQcMsg ToQcMsg(QcCheckResult qcCheckResult) { MedicalQcMsg medicalQcMsg = new MedicalQcMsg(); medicalQcMsg.APPLY_ENV = "MEDDOC"; medicalQcMsg.CREATOR_ID = qcCheckResult.CREATE_ID; medicalQcMsg.DEPT_NAME = qcCheckResult.DEPT_IN_CHARGE; medicalQcMsg.DEPT_STAYED = qcCheckResult.DEPT_CODE; medicalQcMsg.ERROR_COUNT = qcCheckResult.ERROR_COUNT; medicalQcMsg.DOCTOR_IN_CHARGE = qcCheckResult.INCHARGE_DOCTOR; medicalQcMsg.ISSUED_BY = qcCheckResult.CHECKER_NAME; medicalQcMsg.ISSUED_DATE_TIME = SysTimeHelper.Instance.Now; medicalQcMsg.ISSUED_ID = qcCheckResult.CHECKER_ID; medicalQcMsg.ISSUED_TYPE = SystemData.IssuedType.NORMAL; medicalQcMsg.LOCK_STATUS = false; medicalQcMsg.LogDesc = string.Empty; medicalQcMsg.MESSAGE = qcCheckResult.MSG_DICT_MESSAGE; medicalQcMsg.MSG_STATUS = SystemData.MsgStatus.UnCheck; medicalQcMsg.PARENT_DOCTOR = string.Empty; medicalQcMsg.PATIENT_ID = qcCheckResult.PATIENT_ID; medicalQcMsg.PATIENT_NAME = qcCheckResult.PATIENT_NAME; medicalQcMsg.POINT = qcCheckResult.SCORE; medicalQcMsg.POINT_TYPE = SystemData.PointType.Artific; medicalQcMsg.QA_EVENT_TYPE = qcCheckResult.QA_EVENT_TYPE; medicalQcMsg.QCDOC_TYPE = SystemData.QCDocType.OUTHOSPITAL; medicalQcMsg.QC_MODULE = "DOCTOR_MR"; medicalQcMsg.QC_MSG_CODE = qcCheckResult.MSG_DICT_CODE; medicalQcMsg.SUPER_DOCTOR = string.Empty; medicalQcMsg.TOPIC = qcCheckResult.DOC_TITLE; medicalQcMsg.TOPIC_ID = qcCheckResult.DOC_SETID; medicalQcMsg.VISIT_ID = qcCheckResult.VISIT_ID; medicalQcMsg.VISIT_NO = qcCheckResult.VISIT_NO; medicalQcMsg.MODIFY_NOTICE_ID = qcCheckResult.MODIFY_NOTICE_ID; medicalQcMsg.DOCTOR_IN_CHARGE_ID = qcCheckResult.INCHARGE_DOCTOR_ID; return(medicalQcMsg); }
public override bool Execute(object param, object data, out object result) { QcCheckPoint qcCheckPoint = param as QcCheckPoint; PatVisitInfo patVisitLog = data as PatVisitInfo; result = CheckPointHelper.Instance.InitQcCheckResult(qcCheckPoint, patVisitLog); QcCheckResult qcCheckResult = result as QcCheckResult; if (patVisitLog == null || qcCheckPoint == null || qcCheckResult == null) { return(true); } if (string.IsNullOrEmpty(qcCheckPoint.ScriptID)) { return(true); } AutoCalcHandler autoCalcHandler = new AutoCalcHandler(); autoCalcHandler.Start(); autoCalcHandler.ExecuteElementCalculator(qcCheckPoint.ScriptID, patVisitLog, qcCheckPoint, qcCheckResult); result = qcCheckResult; return(true); }