private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > this.dataGridView1.Rows.Count - 1) { return; } if (e.ColumnIndex > this.dataGridView1.Columns.Count - 1) { return; } if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex]; EMRDBLib.QcTimeRecord checkResultInfo = row.Tag as EMRDBLib.QcTimeRecord; if (checkResultInfo == null || string.IsNullOrEmpty(checkResultInfo.DocID)) { return; } if (this.MainForm == null || this.MainForm.IsDisposed) { return; } GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor); this.ShowStatusMessage("正在准备打开病历,请稍候..."); MedDocInfo docInfo = null; short shRet = EmrDocAccess.Instance.GetDocInfo(checkResultInfo.DocID, ref docInfo); if (shRet == EMRDBLib.SystemData.ReturnValue.OK) { PatVisitInfo patVisitInfo = null; shRet = PatVisitAccess.Instance.GetPatVisit(docInfo.PATIENT_ID, docInfo.VISIT_ID, ref patVisitInfo); if (shRet != SystemData.ReturnValue.OK) { MessageBoxEx.Show("患者信息查找失败,无法打开病历!"); this.ShowStatusMessage(null); GlobalMethods.UI.SetCursor(this, Cursors.Default); return; } this.MainForm.SwitchPatient(patVisitInfo, docInfo); //this.MainForm.OpenDocument(info.TOPIC_ID, info.PATIENT_ID, info.VISIT_ID); } //this.MainForm.OpenDocument(docInfo); else { MessageBoxEx.Show("病历详细信息下载失败,无法打开病历!"); } this.ShowStatusMessage(null); GlobalMethods.UI.SetCursor(this, Cursors.Default); }
/// <summary> /// 装载时效记录信息 /// </summary> private void LoadQcTimeRecord(List <EMRDBLib.QcTimeRecord> lstQcTimeRecord) { this.dataGridView1.Rows.Clear(); if (lstQcTimeRecord == null || lstQcTimeRecord.Count <= 0) { return; } WorkProcess.Instance.Initialize(this, lstQcTimeRecord.Count , string.Format("正在加载时效记录,请稍候...")); for (int index = 0; index < lstQcTimeRecord.Count; index++) { WorkProcess.Instance.Show(string.Format("加载到{0},请稍候...", index.ToString()), index); if (WorkProcess.Instance.Canceled) { break; } EMRDBLib.QcTimeRecord record = lstQcTimeRecord[index]; int nRowIndex = this.dataGridView1.Rows.Add(); DataGridViewRow row = this.dataGridView1.Rows[nRowIndex]; row.Tag = record; //将记录信息保存到该行 row.Cells[this.colDocTitle.Index].Value = record.DocTitle; row.Cells[this.colDeptName.Index].Value = record.DeptStayed; row.Cells[this.colDoctorInCharge.Index].Value = record.DoctorInCharge; row.Cells[this.colPatientName.Index].Value = record.PatientName; row.Cells[this.colPatientID.Index].Value = record.PatientID; row.Cells[this.colVisitID.Index].Value = record.VisitID; row.Cells[this.colBeginTime.Index].Value = record.BeginDate.ToString("yyyy-MM-dd HH:mm"); row.Cells[this.colCreateName.Index].Value = record.CreateName; row.Cells[this.colPoint.Index].Value = record.Point; row.Cells[this.colCheckDate.Index].Value = record.CheckDate.ToString("yyyy-MM-dd HH:mm"); row.Cells[this.colQcExplain.Index].Value = record.QcExplain; row.Cells[this.colStatus.Index].Value = EMRDBLib.SystemData.WrittenState.GetCnWrittenState(record.QcResult); if (record.DischargeTime != record.DefaultTime) { row.Cells[this.col_DISCHARGE_TIME.Index].Value = record.DischargeTime.ToString("yyyy-MM-dd HH:mm"); } //记录时间和作者 if (record.QcResult == EMRDBLib.SystemData.WrittenState.Normal || record.QcResult == EMRDBLib.SystemData.WrittenState.Timeout || record.QcResult == EMRDBLib.SystemData.WrittenState.Early) { row.Cells[this.colRecordTime.Index].Value = record.RecordTime.ToString("yyyy-MM-dd HH:mm"); row.Cells[this.colDocTime.Index].Value = record.DocTime.ToString("yyyy-MM-dd HH:mm"); row.Cells[this.colCreateName.Index].Value = record.CreateName; } row.Cells[this.colEndTime.Index].Value = record.EndDate.ToString("yyyy-MM-dd HH:mm"); if (record.CheckDate.CompareTo(record.EndDate) < 0) { row.Cells[this.colLeave.Index].Value = Math.Round((record.EndDate - record.CheckDate).TotalHours, 0, MidpointRounding.ToEven); } else { if (record.QcResult != EMRDBLib.SystemData.WrittenState.Normal && record.QcResult != EMRDBLib.SystemData.WrittenState.UnwriteNormal && record.QcResult != EMRDBLib.SystemData.WrittenState.Early) { row.Cells[this.colLeave.Index].Value = "已超时"; } } if (record.QcResult == EMRDBLib.SystemData.WrittenState.Timeout) { row.Cells[this.colTimeout.Index].Value = Math.Round((record.DocTime - record.EndDate).TotalHours, 0, MidpointRounding.ToEven); } } WorkProcess.Instance.Close(); string szMessage = string.Format("共找到{0}条记录", lstQcTimeRecord.Count.ToString()); this.ShowStatusMessage(szMessage); }