private void btnSearch_Click(object sender, EventArgs e) { this.colPatientName.Visible = true; this.dataGridView1.Rows.Clear(); string dept = string.Empty; if (this.cboDept.SelectedItem != null) { MDSDBLib.DeptInfo deptInfo = this.cboDept.SelectedItem as MDSDBLib.DeptInfo; dept = deptInfo.DeptCode; } if (string.IsNullOrEmpty(dept)) { return; } GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor); this.ShowStatusMessage("正在检查病历时效,请稍候..."); this.Update(); DateTime dtBegin = SystemConfig.Instance.Get(SystemData.ConfigKey.DEPT_DEFAULT_ADMISSION_BEGIN, DateTime.MinValue); DateTime dtEnd = SystemConfig.Instance.Get(SystemData.ConfigKey.DEPT_DEFAULT_ADMISSION_END, DateTime.MaxValue); List <EMRDBLib.PatVisitInfo> lstPatVisitLogs = new List <EMRDBLib.PatVisitInfo>(); PatVisitAccess.Instance.GetPatVisitList(dept, EMRDBLib.PatientType.PatInHosptial, dtBegin, dtEnd, ref lstPatVisitLogs); List <TimeCheckResult> lstCheckResults = new List <TimeCheckResult>(); TimeCheckQuery timeCheckQuery = new TimeCheckQuery(); foreach (EMRDBLib.PatVisitInfo log in lstPatVisitLogs) { timeCheckQuery.PatientID = log.PATIENT_ID; timeCheckQuery.PatientName = log.PATIENT_NAME; // timeCheckQuery.VisitID = log.VISIT_ID; //timeCheckQuery.VisitID = SystemParam.Instance.PatVisitLog.VISIT_ID; //编辑器VISIT_NO=VISIT_ID timeCheckQuery.VisitID = log.VISIT_NO; TimeCheckEngine.Instance.PerformTimeCheck(timeCheckQuery); lstCheckResults.AddRange(TimeCheckEngine.Instance.TimeCheckResults); } lstCheckResults.Sort(new Comparison <TimeCheckResult>(this.Compare)); if (lstCheckResults == null) { GlobalMethods.UI.SetCursor(this, Cursors.Default); this.ShowStatusMessage(null); return; } SetGridData(lstCheckResults); }
/// <summary> /// 加载QC时效检查记录 /// </summary> private void LoadTimeCheckResult() { GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor); this.ShowStatusMessage("正在检查病历时效,请稍候..."); this.Update(); TimeCheckQuery timeCheckQuery = new TimeCheckQuery(); if (SystemParam.Instance.PatVisitInfo != null) { timeCheckQuery.PatientID = SystemParam.Instance.PatVisitInfo.PATIENT_ID; timeCheckQuery.PatientName = SystemParam.Instance.PatVisitInfo.PATIENT_NAME; //timeCheckQuery.VisitID = SystemParam.Instance.PatVisitLog.VISIT_ID; //编辑器VISIT_NO=VISIT_ID timeCheckQuery.VisitID = SystemParam.Instance.PatVisitInfo.VISIT_NO; timeCheckQuery.VisitNO = SystemParam.Instance.PatVisitInfo.VISIT_NO; timeCheckQuery.DoctorLevel = "1";//默认只检查经治医生提交情况 } if (this.cboDept.SelectedItem != null) { MDSDBLib.DeptInfo dept = this.cboDept.SelectedItem as MDSDBLib.DeptInfo; timeCheckQuery.DeptCode = dept.DeptCode; } try { TimeCheckEngine.Instance.PerformTimeCheck(timeCheckQuery); } catch (Exception ex) { GlobalMethods.UI.SetCursor(this, Cursors.Default); LogManager.Instance.WriteLog("DocumentTimeForm.OnRefreshView", ex); return; } List <TimeCheckResult> lstCheckResults = TimeCheckEngine.Instance.TimeCheckResults; lstCheckResults.Sort(new Comparison <TimeCheckResult>(this.Compare)); if (lstCheckResults == null) { GlobalMethods.UI.SetCursor(this, Cursors.Default); this.ShowStatusMessage(null); return; } this.colPatientName.Visible = false; SetGridData(lstCheckResults); }
private void btnSearch_Click(object sender, EventArgs e) { this.colPatientName.Visible = true; this.dataGridView1.Rows.Clear(); string szPatientID = txtPatientID.Text.Trim(); string szVisitID = txtVisitID.Text.Trim(); if (string.IsNullOrEmpty(szPatientID) || string.IsNullOrEmpty(szVisitID)) { MessageBoxEx.Show("请输入病案号和就诊号"); return; } GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor); PatVisitInfo patVisitLog = new PatVisitInfo(); patVisitLog.PATIENT_ID = szPatientID; patVisitLog.VISIT_ID = szVisitID; short shRet = QcTimeRecordAccess.Instance.GetPatVisitLog(szPatientID, szVisitID, ref patVisitLog); if (shRet != SystemData.ReturnValue.OK) { MessageBoxEx.Show("病案查询失败"); return; } if (string.IsNullOrEmpty(patVisitLog.INCHARGE_DOCTOR)) { string doctorInCharge = string.Empty; shRet = EmrDocAccess.Instance.GetDoctorInChargeByEmrDoc(szPatientID, szVisitID, ref doctorInCharge); if (shRet == SystemData.ReturnValue.OK) { patVisitLog.INCHARGE_DOCTOR = doctorInCharge; } } List <TimeCheckResult> lstCheckResults = new List <TimeCheckResult>(); TimeCheckQuery timeCheckQuery = new TimeCheckQuery(); timeCheckQuery.PatientID = patVisitLog.PATIENT_ID; timeCheckQuery.PatientName = patVisitLog.PATIENT_NAME; //timeCheckQuery.VisitID = patVisitLog.VISIT_ID; //兼容电子病历配置VISIT_ID=VISIT_NO timeCheckQuery.VisitID = patVisitLog.VISIT_NO; timeCheckQuery.VisitNO = patVisitLog.VISIT_NO; TimeCheckEngine.Instance.PerformTimeCheck(timeCheckQuery); lstCheckResults.AddRange(TimeCheckEngine.Instance.TimeCheckResults); lstCheckResults.Sort(new Comparison <TimeCheckResult>(this.Compare)); if (lstCheckResults == null) { GlobalMethods.UI.SetCursor(this, Cursors.Default); this.ShowStatusMessage(null); return; } DateTime now = DateTime.Now; for (int index = 0; index < lstCheckResults.Count; index++) { TimeCheckResult resultInfo = lstCheckResults[index]; resultInfo.VisitID = patVisitLog.VISIT_ID; int nRowIndex = this.dataGridView1.Rows.Add(); DataGridViewRow row = this.dataGridView1.Rows[nRowIndex]; row.Tag = resultInfo; row.Cells[this.colPatientName.Index].Value = resultInfo.PatientName; row.Cells[this.colDocName.Index].Value = resultInfo.DocTitle; row.Cells[this.colDoctorInCharge.Index].Value = patVisitLog.INCHARGE_DOCTOR; if (resultInfo.WrittenState == WrittenState.Timeout) { row.Cells[this.colStatus.Index].Value = "书写超时"; } else if (resultInfo.WrittenState == WrittenState.Unwrite) { row.Cells[this.colStatus.Index].Value = "未书写"; } else if (resultInfo.WrittenState == WrittenState.Early) { row.Cells[this.colStatus.Index].Value = "书写提前"; } else if (resultInfo.WrittenState == WrittenState.Normal) { row.Cells[this.colStatus.Index].Value = "正常"; } if (resultInfo.WrittenState != WrittenState.Unwrite) { row.Cells[this.colCreateTime.Index].Value = resultInfo.DocTime.ToString("yyyy-M-d HH:mm"); row.Cells[this.colCreator.Index].Value = resultInfo.CreatorName; } row.Cells[this.colEndTime.Index].Value = resultInfo.EndTime.ToString("yyyy-M-d HH:mm"); if (now.CompareTo(resultInfo.EndTime) < 0) { row.Cells[this.colLeave.Index].Value = Math.Round((resultInfo.EndTime - now).TotalHours, 0, MidpointRounding.ToEven); } else { row.Cells[this.colLeave.Index].Value = "已超时"; } if (!resultInfo.IsRepeat) { row.Cells[this.colCheckBasis.Index].Value = string.Format("病人{0}{1},{2}内书写{3}" , resultInfo.EventTime.ToString("yyyy-M-d HH:mm") , resultInfo.EventName, resultInfo.WrittenPeriod, resultInfo.DocTypeName); } else { row.Cells[this.colCheckBasis.Index].Value = string.Format("病人{0}{1},每{2}书写一次{3}" , resultInfo.EventTime.ToString("yyyy-M-d HH:mm") , resultInfo.EventName, resultInfo.WrittenPeriod, resultInfo.DocTypeName); } row.Cells[this.colDocTypeID.Index].Value = resultInfo.DocTypeID; } GlobalMethods.UI.SetCursor(this, Cursors.Default); this.ShowStatusMessage(null); }