private void SetRowData(DataGridViewRow row, QcContentRecord item)
 {
     if (item == null)
     {
         return;
     }
     row.Tag = item;
     row.Cells[this.colBugClass.Index].Value      = item.BugClass == 0 ? "警告" : "错误";
     row.Cells[this.colBugType.Index].Value       = item.BugType == "1" ? "内容" : "元素";
     row.Cells[this.colCheckDate.Index].Value     = item.CheckDate == item.DefaultTime?"":item.CheckDate.ToString();
     row.Cells[this.colCheckName.Index].Value     = item.CheckerName;
     row.Cells[this.colCreateID.Index].Value      = item.CreateID;
     row.Cells[this.colCreateName.Index].Value    = item.CreateName;
     row.Cells[this.colDeptIncharge.Index].Value  = item.DeptIncharge;
     row.Cells[this.colDocID.Index].Value         = item.DocSetID;
     row.Cells[this.colDocIncharge.Index].Value   = item.DocIncharge;
     row.Cells[this.colDocTime.Index].Value       = item.DocTime;
     row.Cells[this.colDocTitle.Index].Value      = item.DocTitle;
     row.Cells[this.colDocTypeID.Index].Value     = item.DocTypeID;
     row.Cells[this.colModifyTime.Index].Value    = item.ModifyTime;
     row.Cells[this.colPaitentID.Index].Value     = item.PatientID;
     row.Cells[this.colPatientName.Index].Value   = item.PatientName;
     row.Cells[this.colPoint.Index].Value         = item.Point;
     row.Cells[this.colQCExpalin.Index].Value     = item.QCExplain;
     row.Cells[this.colVisitID.Index].Value       = item.VisitID;
     row.Cells[this.colBugCreateTime.Index].Value = item.BugCreateTime;
 }
Ejemplo n.º 2
0
        private void SaveContentRecord(PatVisitInfo patVisitInfo, MedDocInfo docInfo, List <DocuemntBugInfo> lstDocuemntBugList, List <ElementBugInfo> lstElementBugList)
        {
            if (patVisitInfo == null || docInfo == null)
            {
                return;
            }
            List <EMRDBLib.Entity.QcContentRecord> lstQcContentRecord = new List <EMRDBLib.Entity.QcContentRecord>();

            //内容错误赋值
            if (lstDocuemntBugList != null)
            {
                foreach (var item in lstDocuemntBugList)
                {
                    QcContentRecord record = CreateQcContentRecord(patVisitInfo, docInfo);
                    record.BugClass = (int)item.BugLevel;
                    record.BugType  = "1";
                    //去掉 (双击定位到缺陷)、(双击定位到错误)
                    record.QCExplain = item.BugDesc.Replace("(双击定位到缺陷)", "").Replace("(双击定位到错误)", "");

                    lstQcContentRecord.Add(record);
                }
            }
            //元素错误赋值
            if (lstElementBugList != null)
            {
                foreach (var item in lstElementBugList)
                {
                    QcContentRecord record = CreateQcContentRecord(patVisitInfo, docInfo);
                    record.BugClass  = item.IsFatalBug ? 1 : 0;
                    record.BugType   = "2";
                    record.QCExplain = item.BugDesc;
                    lstQcContentRecord.Add(record);
                }
            }
            //保存
            QcContentRecordAccess.Instance.SaveQCContentRecord(lstQcContentRecord);
        }
Ejemplo n.º 3
0
        public short GetQcContentRecord(DateTime dtModifyBeginTime, DateTime dtModifyEndTime, List <DeptInfo> lstDeptInfos, bool bIsChecked, ref List <QcContentRecord> lstQcContentRecord)
        {
            if (base.MedQCAccess == null)
            {
                return(SystemData.ReturnValue.PARAM_ERROR);
            }

            string szCondition = string.Format("MODIFY_TIME >={0} and MODIFY_TIME <{1}",
                                               base.MedQCAccess.GetSqlTimeFormat(dtModifyBeginTime), base.MedQCAccess.GetSqlTimeFormat(dtModifyEndTime));

            if (lstDeptInfos != null && lstDeptInfos.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append(" AND DEPT_IN_CHARGE IN (");
                for (int index = 0; index < lstDeptInfos.Count; index++)
                {
                    DeptInfo item = lstDeptInfos[index];
                    sb.Append(string.Format("'{0}'", item.DEPT_NAME));
                    if (index != lstDeptInfos.Count - 1)
                    {
                        sb.Append(",");
                    }
                }
                sb.Append(") ");
                szCondition += sb.ToString();
            }

            if (bIsChecked)
            {
                szCondition += "AND CHECKER_ID IS NOT NULL";
            }
            else
            {
                szCondition += "AND CHECKER_ID IS  NULL";
            }

            string szField = "CONTENT_RECORD_ID,PATIENT_ID,VISIT_ID," +
                             "DOCTYPE_ID,POINT,CHECKER_NAME," +
                             "CHECK_DATE,DOC_SETID,DOC_TITLE," +
                             "MODIFY_TIME,BUG_CLASS,CREATE_ID," +
                             "CREATE_NAME,QC_EXPLAIN,DOCTOR_IN_CHARGE," +
                             "PATIENT_NAME,DOC_TIME,BUG_TYPE," +
                             "BUG_CREATE_ITME,CHECKER_ID,DEPT_IN_CHARGE,Dept_Code";
            string szSQL = string.Format("SELECT {0} FROM QC_CONTENT_RECORD_T WHERE {1}",
                                         szField, szCondition);

            //关联文档状态
            szSQL = string.Format("SELECT A.*,B.SIGN_CODE FROM ({0}) A,EMR_DOC_T B WHERE A.DOC_SETID=B.DOC_SETID", szSQL);
            IDataReader reader = null;

            try
            {
                reader = base.MedQCAccess.ExecuteReader(szSQL);
                if (reader == null || reader.IsClosed || !reader.Read())
                {
                    return(SystemData.ReturnValue.RES_NO_FOUND);
                }
                if (lstQcContentRecord == null)
                {
                    lstQcContentRecord = new List <QcContentRecord>();
                }
                do
                {
                    QcContentRecord item = new QcContentRecord();
                    if (!reader.IsDBNull(0))
                    {
                        item.ContentRecordID = Convert.ToInt32(reader.GetValue(0));
                    }
                    if (!reader.IsDBNull(1))
                    {
                        item.PatientID = reader.GetString(1);
                    }
                    if (!reader.IsDBNull(2))
                    {
                        item.VisitID = reader.GetString(2);
                    }
                    if (!reader.IsDBNull(3))
                    {
                        item.DocTypeID = reader.GetString(3);
                    }
                    if (!reader.IsDBNull(4))
                    {
                        item.Point = float.Parse(reader.GetValue(4).ToString());
                    }
                    if (!reader.IsDBNull(5))
                    {
                        item.CheckerName = reader.GetString(5);
                    }
                    if (!reader.IsDBNull(6))
                    {
                        item.CheckDate = reader.GetDateTime(6);
                    }
                    if (!reader.IsDBNull(7))
                    {
                        item.DocSetID = reader.GetString(7);
                    }
                    if (!reader.IsDBNull(8))
                    {
                        item.DocTitle = reader.GetString(8);
                    }
                    if (!reader.IsDBNull(9))
                    {
                        item.ModifyTime = reader.GetDateTime(9);
                    }
                    if (!reader.IsDBNull(10))
                    {
                        item.BugClass = Convert.ToInt32(reader.GetValue(10));
                    }
                    if (!reader.IsDBNull(11))
                    {
                        item.CreateID = reader.GetString(11);
                    }
                    if (!reader.IsDBNull(12))
                    {
                        item.CreateName = reader.GetString(12);
                    }
                    if (!reader.IsDBNull(13))
                    {
                        item.QCExplain = reader.GetString(13);
                    }
                    if (!reader.IsDBNull(14))
                    {
                        item.DocIncharge = reader.GetString(14);
                    }
                    if (!reader.IsDBNull(15))
                    {
                        item.PatientName = reader.GetString(15);
                    }
                    if (!reader.IsDBNull(16))
                    {
                        item.DocTime = reader.GetDateTime(16);
                    }
                    if (!reader.IsDBNull(17))
                    {
                        item.BugType = reader.GetString(17);
                    }
                    if (!reader.IsDBNull(18))
                    {
                        item.BugCreateTime = reader.GetDateTime(18);
                    }
                    if (!reader.IsDBNull(19))
                    {
                        item.CheckerID = reader.GetString(19);
                    }
                    if (!reader.IsDBNull(20))
                    {
                        item.DeptIncharge = reader.GetString(20);
                    }
                    if (!reader.IsDBNull(21))
                    {
                        item.DeptCode = reader.GetString(21);
                    }
                    if (!reader.IsDBNull(22))
                    {
                        item.SignCode = reader.GetString(22);
                    }
                    lstQcContentRecord.Add(item);
                } while (reader.Read());
                return(SystemData.ReturnValue.OK);
            }
            catch (Exception ex)
            {
                LogManager.Instance.WriteLog("DBAccess.GetQcContentRecord", new string[] { "szSQL" }, new object[] { szSQL }, ex);
                return(SystemData.ReturnValue.EXCEPTION);
            }
            finally
            {
                base.MedQCAccess.CloseConnnection(false);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取文档内容质检
        /// </summary>
        /// <param name="dtpModifyBeginTime">文档修改开始时间</param>
        /// <param name="dtpModifyEndTime">文档修改结束时间</param>
        /// <param name="szDeptName"></param>
        /// <param name="szPatientId"></param>
        /// <param name="szVisitId"></param>
        /// <param name="lstQcContentRecord"></param>
        /// <returns></returns>
        public short GetQcContentRecord(DateTime dtBeginTime, DateTime dtEndTime, string szDeptCode, ref List <QcContentRecord> lstQcContentRecord)
        {
            if (base.MedQCAccess == null)
            {
                return(SystemData.ReturnValue.PARAM_ERROR);
            }

            string szCondition = string.Format("BUG_CREATE_ITME >={0} and BUG_CREATE_ITME <{1}",
                                               base.MedQCAccess.GetSqlTimeFormat(dtBeginTime), base.MedQCAccess.GetSqlTimeFormat(dtEndTime));

            if (!string.IsNullOrEmpty(szDeptCode))
            {
                szCondition += string.Format(" AND DEPT_CODE='{0}'", szDeptCode);
            }

            string szField = "CONTENT_RECORD_ID,PATIENT_ID,VISIT_ID,DOCTYPE_ID,POINT,CHECKER_NAME," +
                             "CHECK_DATE,DOC_SETID,DOC_TITLE,MODIFY_TIME,BUG_CLASS,CREATE_ID,CREATE_NAME," +
                             "QC_EXPLAIN,DOCTOR_IN_CHARGE,DEPT_IN_CHARGE,PATIENT_NAME,DOC_TIME,BUG_TYPE,BUG_CREATE_ITME,CHECKER_ID,DEPT_CODE";
            string szOrderby = string.Format("{0}"
                                             , "DOC_SETID");
            string szSQL = string.Format("SELECT {0} FROM QC_CONTENT_RECORD_T WHERE {1} ORDER BY {2}",
                                         szField, szCondition, szOrderby);

            IDataReader reader = null;

            try
            {
                reader = base.MedQCAccess.ExecuteReader(szSQL);
                if (reader == null || reader.IsClosed || !reader.Read())
                {
                    return(SystemData.ReturnValue.EXCEPTION);
                }
                if (lstQcContentRecord == null)
                {
                    lstQcContentRecord = new List <QcContentRecord>();
                }
                do
                {
                    QcContentRecord item = new QcContentRecord();
                    if (!reader.IsDBNull(0))
                    {
                        item.ContentRecordID = Convert.ToInt32(reader.GetValue(0));
                    }
                    if (!reader.IsDBNull(1))
                    {
                        item.PatientID = reader.GetString(1);
                    }
                    if (!reader.IsDBNull(2))
                    {
                        item.VisitID = reader.GetString(2);
                    }
                    if (!reader.IsDBNull(3))
                    {
                        item.DocTypeID = reader.GetString(3);
                    }
                    if (!reader.IsDBNull(4))
                    {
                        item.Point = float.Parse(reader.GetValue(4).ToString());
                    }
                    if (!reader.IsDBNull(5))
                    {
                        item.CheckerName = reader.GetString(5);
                    }
                    if (!reader.IsDBNull(6))
                    {
                        item.CheckDate = reader.GetDateTime(6);
                    }
                    if (!reader.IsDBNull(7))
                    {
                        item.DocSetID = reader.GetString(7);
                    }
                    if (!reader.IsDBNull(8))
                    {
                        item.DocTitle = reader.GetString(8);
                    }
                    if (!reader.IsDBNull(9))
                    {
                        item.ModifyTime = reader.GetDateTime(9);
                    }
                    if (!reader.IsDBNull(10))
                    {
                        item.BugClass = Convert.ToInt32(reader.GetValue(10));
                    }
                    if (!reader.IsDBNull(11))
                    {
                        item.CreateID = reader.GetString(11);
                    }
                    if (!reader.IsDBNull(12))
                    {
                        item.CreateName = reader.GetString(12);
                    }
                    if (!reader.IsDBNull(13))
                    {
                        item.QCExplain = reader.GetString(13);
                    }
                    if (!reader.IsDBNull(14))
                    {
                        item.DocIncharge = reader.GetString(14);
                    }
                    if (!reader.IsDBNull(15))
                    {
                        item.DeptIncharge = reader.GetString(15);
                    }
                    if (!reader.IsDBNull(16))
                    {
                        item.PatientName = reader.GetString(16);
                    }
                    if (!reader.IsDBNull(17))
                    {
                        item.DocTime = reader.GetDateTime(17);
                    }
                    if (!reader.IsDBNull(18))
                    {
                        item.BugType = reader.GetString(18);
                    }
                    if (!reader.IsDBNull(19))
                    {
                        item.BugCreateTime = reader.GetDateTime(19);
                    }
                    if (!reader.IsDBNull(20))
                    {
                        item.CheckerID = reader.GetString(20);
                    }
                    if (!reader.IsDBNull(21))
                    {
                        item.DeptCode = reader.GetString(21);
                    }
                    lstQcContentRecord.Add(item);
                } while (reader.Read());
                return(SystemData.ReturnValue.OK);
            }
            catch (Exception ex)
            {
                LogManager.Instance.WriteLog("DBAccess.GetQcContentRecord", new string[] { "szSQL" }, new object[] { szSQL }, ex);
                return(SystemData.ReturnValue.EXCEPTION);
            }
            finally
            {
                base.MedQCAccess.CloseConnnection(false);
            }
        }