Example #1
0
        private void ShowQuestionTypeForm(DataTableViewRow row)
        {
            if (row == null || row.Index < 0 || this.dataGridView1.IsDeletedRow(row))
            {
                return;
            }
            QuestionTypeForm frmQuestionType = new QuestionTypeForm();

            frmQuestionType.Text = "选择缺陷点和分类";
            DataGridViewCell cell         = row.Cells[this.colCheckPointContent.Index];
            QcCheckPoint     qcCheckPoint = row.Tag as QcCheckPoint;

            if (frmQuestionType.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            qcCheckPoint.MsgDictCode    = frmQuestionType.QcMsgCode;
            qcCheckPoint.MsgDictMessage = frmQuestionType.Message;
            qcCheckPoint.QaEventType    = frmQuestionType.QaEventType;
            qcCheckPoint.Score          = frmQuestionType.Score != null?float.Parse(frmQuestionType.Score) : 0;

            row.Cells[this.colMsgDictMessage.Index].Value = qcCheckPoint.MsgDictMessage;
            row.Cells[this.colQaEventType.Index].Value    = qcCheckPoint.QaEventType;
            row.Cells[this.colQCScore.Index].Value        = qcCheckPoint.Score;
            row.Tag = qcCheckPoint;
            if (this.dataGridView1.IsNormalRowUndeleted(row))
            {
                this.dataGridView1.SetRowState(row, RowState.Update);
            }
        }
Example #2
0
        /// <summary>
        /// 更新一条自动核查规则配置信息
        /// </summary>
        /// <param name="timeQCRule">自动核查规则配置信息</param>
        /// <returns>SystemData.ReturnValue</returns>
        public short Update(QcCheckPoint qcCheckPoint)
        {
            if (qcCheckPoint == null)
            {
                LogManager.Instance.WriteLog("QcCheckPointAccess.UpdateQcCheckPoint", new string[] { "qcCheckPoint" }
                                             , new object[] { qcCheckPoint }, "参数不能为空");
                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},{20}='{21}',{22}='{23}',{24}='{25}',{26}='{27}',{28}='{29}',{30}={31},{32}='{33}',{34}='{35}',{36}='{37}'"
                                           , SystemData.QcCheckPointTable.CHECK_POINT_ID, qcCheckPoint.CheckPointID
                                           , SystemData.QcCheckPointTable.CHECK_POINT_CONTENT, qcCheckPoint.CheckPointContent
                                           , SystemData.QcCheckPointTable.DOCTYPE_ID, base.MedQCAccess.GetSqlParamName("DocTypeID")
                                           , SystemData.QcCheckPointTable.DOCTYPE_NAME, base.MedQCAccess.GetSqlParamName("DocTypeName")
                                           , SystemData.QcCheckPointTable.HANDLER_COMMAND, qcCheckPoint.HandlerCommand
                                           , SystemData.QcCheckPointTable.IS_VALID, qcCheckPoint.IsValid ? 1 : 0
                                           , SystemData.QcCheckPointTable.MSG_DICT_CODE, qcCheckPoint.MsgDictCode
                                           , SystemData.QcCheckPointTable.MSG_DICT_MESSAGE, qcCheckPoint.MsgDictMessage
                                           , SystemData.QcCheckPointTable.ORDER_VALUE, qcCheckPoint.OrderValue.ToString()
                                           , SystemData.QcCheckPointTable.SCORE, qcCheckPoint.Score.ToString()
                                           , SystemData.QcCheckPointTable.WRITTEN_PERIOD, qcCheckPoint.WrittenPeriod
                                           , SystemData.QcCheckPointTable.QA_EVENT_TYPE, qcCheckPoint.QaEventType
                                           , SystemData.QcCheckPointTable.EXPRESSION, qcCheckPoint.Expression
                                           , SystemData.QcCheckPointTable.CHECK_TYPE, qcCheckPoint.CheckType
                                           , SystemData.QcCheckPointTable.EVENT_ID, qcCheckPoint.EventID
                                           , SystemData.QcCheckPointTable.IS_REPEAT, qcCheckPoint.IsRepeat ? 1 : 0
                                           , SystemData.QcCheckPointTable.ELEMENT_NAME, qcCheckPoint.ELEMENT_NAME
                                           , SystemData.QcCheckPointTable.SCRIPT_ID, qcCheckPoint.ScriptID
                                           , SystemData.QcCheckPointTable.SCRIPT_NAME, qcCheckPoint.ScriptName);

            string szCondition = string.Format("{0}='{1}'", SystemData.QcCheckPointTable.CHECK_POINT_ID, qcCheckPoint.CheckPointID);
            string szSQL       = string.Format(SystemData.SQL.UPDATE, SystemData.DataTable.QC_CHECK_POINT, szField, szCondition);

            DbParameter[] pmi = new DbParameter[2];
            pmi[0] = new DbParameter("DocTypeID", qcCheckPoint.DocTypeID == null ? string.Empty : qcCheckPoint.DocTypeID);
            pmi[1] = new DbParameter("DocTypeName", qcCheckPoint.DocTypeName == null ? string.Empty : qcCheckPoint.DocTypeName);

            int nCount = 0;

            try
            {
                nCount = base.MedQCAccess.ExecuteNonQuery(szSQL, CommandType.Text, ref pmi);
            }
            catch (Exception ex)
            {
                LogManager.Instance.WriteLog("QcCheckPointAccess.UpdateQcCheckPoint", new string[] { "szSQL" }, new object[] { szSQL }, ex);
                return(SystemData.ReturnValue.EXCEPTION);
            }
            if (nCount <= 0)
            {
                LogManager.Instance.WriteLog("QcCheckPointAccess.UpdateQcCheckPoint", new string[] { "szSQL" }, new object[] { szSQL }, "SQL语句执行后返回0!");
                return(SystemData.ReturnValue.EXCEPTION);
            }
            return(SystemData.ReturnValue.OK);
        }
Example #3
0
 /// <summary>
 /// 设置指定行显示的数据,以及绑定的数据
 /// </summary>
 /// <param name="row">指定行</param>
 /// <param name="qcCheckPoint">绑定的数据</param>
 private void SetRowData(DataTableViewRow row, QcCheckPoint qcCheckPoint)
 {
     if (row == null || row.Index < 0 || qcCheckPoint == null)
     {
         return;
     }
     row.Tag = qcCheckPoint;
     row.Cells[this.colQaEventType.Index].Value       = qcCheckPoint.QaEventType;
     row.Cells[this.colCheckType.Index].Value         = qcCheckPoint.CheckType;
     row.Cells[this.colCheckPointContent.Index].Value = qcCheckPoint.CheckPointContent;
     row.Cells[this.colCheckPointID.Index].Tag        = qcCheckPoint.CheckPointID;
     row.Cells[this.colCheckPointID.Index].Value      = qcCheckPoint.CheckPointID;
     row.Cells[this.colDocType.Index].Tag             = qcCheckPoint.DocTypeID;
     row.Cells[this.colDocType.Index].Value           = qcCheckPoint.DocTypeName;
     row.Cells[this.colWrittenPeriod.Index].Value     = qcCheckPoint.WrittenPeriod;
     if (qcCheckPoint.Score > 0)
     {
         row.Cells[this.colQCScore.Index].Value = qcCheckPoint.Score;
     }
     row.Cells[this.colIsValid.Index].Value        = qcCheckPoint.IsValid;
     row.Cells[this.colMsgDictMessage.Index].Value = qcCheckPoint.MsgDictMessage;
     row.Cells[this.colExpression.Index].Value     = qcCheckPoint.Expression;
     row.Cells[this.colHandlerCommand.Index].Value = qcCheckPoint.HandlerCommand;
     row.Cells[this.colEvent.Index].Value          = qcCheckPoint.EventName;
     row.Cells[this.colEvent.Index].Tag            = qcCheckPoint.EventID;
     row.Cells[this.colIsRepeat.Index].Value       = qcCheckPoint.IsRepeat;
     row.Cells[this.colQaEventType.Index].Value    = qcCheckPoint.QaEventType;
 }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
        }
Example #7
0
        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>
 /// <param name="szElementName">元素名称</param>
 /// <param name="szElementValue">返回的元素值</param>
 /// <returns>执行结果</returns>
 protected virtual bool GetElementValue(QcCheckPoint qcCheckPoint, PatVisitInfo patVisitInfo, string szElementName, out string szElementValue)
 {
     szElementValue = string.Empty;
     if (this.m_getElementValueCallback != null)
     {
         return(this.m_getElementValueCallback.Invoke(qcCheckPoint, patVisitInfo, szElementName, out szElementValue));
     }
     return(false);
 }
Example #9
0
        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);
        }
Example #10
0
 private void RefreshOrderValue()
 {
     foreach (DataTableViewRow item in this.dataGridView1.Rows)
     {
         QcCheckPoint qcCheckPoint = item.Tag as QcCheckPoint;
         qcCheckPoint.OrderValue = item.Index;
         QcCheckPointAccess.Instance.Update(qcCheckPoint);
     }
 }
Example #11
0
        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);
        }
Example #12
0
        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);
        }
Example #13
0
        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);
        }
Example #15
0
        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);
        }
Example #17
0
        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);
        }
Example #18
0
        private bool GetElementValue(QcCheckPoint qcCheckPoint, PatVisitInfo patVisitInfo, string elementName, out string elementValue)
        {
            elementValue = null;
            if (qcCheckPoint == null || patVisitInfo == null)
            {
                return(false);
            }
            if (patVisitInfo.MedDocInfos == null)
            {
                return(false);
            }
            //查询患者指定文书类型ID号
            List <MedDocInfo> documentlist = this.GetDocumentList(qcCheckPoint.DocTypeID, patVisitInfo.MedDocInfos);

            if (documentlist == null || documentlist.Count == 0)
            {
                return(false);
            }
            //获取文书xml内容
            string      szXMLFile = null;
            short       shRet     = MedXMLAccess.Instance.GetDocXml(documentlist[0], ref szXMLFile);
            XmlDocument doc       = new XmlDocument();

            doc.Load(szXMLFile);
            XmlNode docNode = null;

            if (documentlist[0].DOC_ID != documentlist[0].DOC_SETID)
            {
                docNode = doc.SelectSingleNode(string.Format("//Section[@ID='{0}']", documentlist[0].DOC_ID));
            }
            XmlNode node = null;

            if (docNode != null)
            {
                node = docNode.SelectSingleNode(string.Format("//Field[@Name='{0}']", qcCheckPoint.ELEMENT_NAME));
            }
            else
            {
                node = doc.SelectSingleNode(string.Format("//Field[@Name='{0}']", elementName));
            }
            if (node == null)//存在一项为空则直接返回不继续判断
            {
                return(false);
            }
            elementValue = node.InnerText;
            return(true);
        }
Example #19
0
        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);
        }
Example #21
0
        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);
        }
Example #22
0
        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);
        }
Example #24
0
        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);
        }
        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);
        }
Example #26
0
        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);
        }
Example #27
0
        private bool GetElementValue(QcCheckPoint qcCheckPoint, PatVisitInfo patVisitInfo, string szElementName, out string szElementValue)
        {
            szElementValue = string.Empty;
            if (this.dataGridView1.Rows.Count <= 0)
            {
                return(false);
            }
            for (int index = 0; index < this.dataGridView1.Rows.Count; index++)
            {
                DataTableViewRow row = this.dataGridView1.Rows[index];
                if (row == null)
                {
                    continue;
                }
                if (row.Cells[this.colElementName.Index].Value == null)
                {
                    continue;
                }
                string szName = row.Cells[this.colElementName.Index].Value.ToString();
                if (szName != szElementName)
                {
                    continue;
                }

                if (row.Cells[this.colScriptValue.Index].Value != null)
                {
                    szElementValue = row.Cells[this.colScriptValue.Index].Value.ToString();
                }
                DataGridViewCell cell = this.dataGridView1.CurrentCell;
                if (cell.RowIndex == index && cell != null && cell.IsInEditMode)
                {
                    TextBox cellTextBox = this.dataGridView1.EditingControl as TextBox;
                    if (cellTextBox != null)
                    {
                        szElementValue = cellTextBox.Text.Trim();
                    }
                }
                break;
            }
            return(true);
        }
Example #28
0
        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);
        }
Example #29
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            QcCheckPoint     qcCheckPoint = null;
            DataTableViewRow currRow      = this.dataGridView1.CurrentRow;

            if (currRow != null && currRow.Index >= 0)
            {
                qcCheckPoint = currRow.Tag as QcCheckPoint;
            }
            if (qcCheckPoint == null)
            {
                qcCheckPoint = new QcCheckPoint();
            }
            else
            {
                qcCheckPoint = qcCheckPoint.Clone() as QcCheckPoint;
            }
            qcCheckPoint.CheckPointID = qcCheckPoint.MakeCheckPointID();
            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, qcCheckPoint);

            this.dataGridView1.Focus();
            this.dataGridView1.SelectRow(row);
            this.dataGridView1.SetRowState(row, RowState.New);
        }
        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);
        }