From 61a24e931018001dba586ba90532b86454ad789e Mon Sep 17 00:00:00 2001 From: leomon Date: Wed, 5 Jul 2023 11:57:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=8C=E5=87=BB=E9=A1=B5=E9=9D=A2=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=82=B9=E5=8A=A0=E8=BD=BD=E7=94=A8=E8=8D=AF=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AIMS/AIMS.xml | 2 +- .../frmAanesthesiaPainlessRecord.cs | 3 +- .../frmAanesthesiaRecord.cs | 72 ++++++++++++------- AIMS/OperationAanesthesia/frmFactDrugNew.cs | 4 ++ .../frmFactSpeedyDrug.Designer.cs | 6 -- .../OperationAanesthesia/frmFactSpeedyDrug.cs | 25 +++++-- AIMSEntity/Extensions/SelectPatient.cs | 10 +-- DrawGraph/AreaManage/DrugsManage.cs | 16 ++++- DrawGraph/AreaManage/OperationRecord.cs | 6 +- DrawGraph/AreaManage/PhysioDataManage.cs | 3 +- DrawGraph/AreaManage/SapManage.cs | 20 ++++-- 11 files changed, 107 insertions(+), 60 deletions(-) diff --git a/AIMS/AIMS.xml b/AIMS/AIMS.xml index 8fe8536..093bb06 100644 --- a/AIMS/AIMS.xml +++ b/AIMS/AIMS.xml @@ -1,6 +1,6 @@  - Data Source=.;Initial Catalog=AIMSDB_FJZPTFYY;User ID=sa;Password=Test2020; + Data Source=.;Initial Catalog=AIMSDB_QHDSGRYY;User ID=sa;Password=Test2020; Data Source=.;Initial Catalog=AIMSDB_DATA;User ID=sa;Password=Test2020; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.10.7)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl2))));Persist Security Info=True;User ID=smview;Password=i39; diff --git a/AIMS/OperationAanesthesia/frmAanesthesiaPainlessRecord.cs b/AIMS/OperationAanesthesia/frmAanesthesiaPainlessRecord.cs index 39582c8..d6db2ac 100644 --- a/AIMS/OperationAanesthesia/frmAanesthesiaPainlessRecord.cs +++ b/AIMS/OperationAanesthesia/frmAanesthesiaPainlessRecord.cs @@ -1105,11 +1105,12 @@ namespace AIMS.OperationAanesthesia } - private void _record_SpeedyDrugsParam(List factDrugs) + private void _record_SpeedyDrugsParam(List factDrugs, DateTime clickTime) { frmFactSpeedyDrug frmFact = new frmFactSpeedyDrug(); frmFact._record = _record; frmFact.factDrugs = factDrugs; + frmFact.ClickTime = clickTime; frmFact.zgcAnaesRecord = zgcAnaesRecord; frmFact.DrugTypeId = RecoverId; // 事件类型 1 麻醉单事件 2 麻醉恢复单 frmFact.DrugsParam += frmFactEventsNew_EventsParam; diff --git a/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs b/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs index b107089..1f7eb99 100644 --- a/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs +++ b/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs @@ -269,7 +269,7 @@ namespace AIMS.OperationAanesthesia pdg.Document = pDoc; pdg.PrintPreviewControl.Zoom = 1; pdg.ShowDialog(); - pdg.Focus(); + pdg.Focus(); } private void PageSetting_Click(object sender, EventArgs e) @@ -1103,41 +1103,41 @@ namespace AIMS.OperationAanesthesia LoadAnesRescue(); } - private System.Windows.Forms.Timer timerLoadAnesRescue; + //private System.Windows.Forms.Timer timerLoadAnesRescue; public void LoadAnesRescue() { - circularProgress1.IsRunning = true; - circularProgress1.Visible = true; - circularProgress1.AnimationSpeed = 0; - circularProgress2.IsRunning = true; - circularProgress2.Visible = true; - zgcAnaesRecord.Visible = false; - zgcAnaesRecord2.Visible = false; - timerLoadAnesRescue = new System.Windows.Forms.Timer(components); - timerLoadAnesRescue.Enabled = true;//调试时设置为FALSE , - timerLoadAnesRescue.Interval = 200; - timerLoadAnesRescue.Tick -= TimerLoadAnesRescue_Tick; - timerLoadAnesRescue.Tick += TimerLoadAnesRescue_Tick; - timerLoadAnesRescue.Start(); + //circularProgress1.IsRunning = true; + //circularProgress1.Visible = true; + //circularProgress1.AnimationSpeed = 0; + //circularProgress2.IsRunning = true; + //circularProgress2.Visible = true; + //zgcAnaesRecord.Visible = false; + //zgcAnaesRecord2.Visible = false; + //timerLoadAnesRescue = new System.Windows.Forms.Timer(components); + //timerLoadAnesRescue.Enabled = true;//调试时设置为FALSE , + //timerLoadAnesRescue.Interval = 200; + //timerLoadAnesRescue.Tick -= TimerLoadAnesRescue_Tick; + //timerLoadAnesRescue.Tick += TimerLoadAnesRescue_Tick; + //timerLoadAnesRescue.Start(); - //TimerLoadAnesRescue_Tick(null, null); + TimerLoadAnesRescue_Tick(null, null); } private void TimerLoadAnesRescue_Tick(object sender, EventArgs e) { - timerLoadAnesRescue.Dispose(); + //timerLoadAnesRescue.Dispose(); try { if (PatientId > 0 && State == AIMSExtension.EditState.ADD) { try - { + { _record = new OperationRecord(); _record.OperationApplyId = ApplyId; _record.PatientId = PatientId; _record.RecoverId = RecoverId; _record.Id = BOperationRecord.AddTitleTime(PatientId, ApplyId, RecoverId, 1, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:00")), NowRoom.Id.Value); - SelectPatient.UpdateApplyState(PatientId, ApplyId); //修改状态 + SelectPatient.UpdateApplyState(PatientId, ApplyId); //修改状态 ClearTimeText(); btnSelectPatient.Enabled = false; btnCancelOperation.Enabled = true; @@ -1225,15 +1225,33 @@ namespace AIMS.OperationAanesthesia PublicMethod.WriteLog(ex); } } - private void _record_SpeedyDrugsParam(List factDrugs) + private void _record_SpeedyDrugsParam(List factDrugs, DateTime clickTime) { - frmFactSpeedyDrug frmFact = new frmFactSpeedyDrug(); - frmFact._record = _record; - frmFact.factDrugs = factDrugs; - frmFact.zgcAnaesRecord = zgcAnaesRecord; - frmFact.DrugTypeId = RecoverId; // 事件类型 1 麻醉单事件 2 麻醉恢复单 - frmFact.DrugsParam += FrmFactDrug_DrugsParam; - frmFact.ShowDialog(); + if (PatientId != 0) + { + if (factDrugs != null && factDrugs.Count > 0) + { + frmFactSpeedyDrug frmFact = new frmFactSpeedyDrug(); + frmFact._record = _record; + frmFact.factDrugs = factDrugs; + frmFact.ClickTime = clickTime; + frmFact.zgcAnaesRecord = zgcAnaesRecord; + frmFact.DrugTypeId = RecoverId; // 事件类型 1 麻醉单事件 2 麻醉恢复单 + frmFact.DrugsParam += FrmFactDrug_DrugsParam; + frmFact.ShowDialog(); + } + else + { + PublicUI.UI.frmFactDrugNew frmFactDrug = new PublicUI.UI.frmFactDrugNew(); + frmFactDrug._record = _record; + frmFactDrug.zgcAnaesRecord = zgcAnaesRecord; + frmFactDrug.ClickTime = clickTime; + frmFactDrug.DrugTypeId = RecoverId; // 事件类型 1 麻醉单事件 2 麻醉恢复单 + frmFactDrug.DrugsParam += FrmFactDrug_DrugsParam; + frmFactDrug.ShowDialog(); + + } + } } private void btnOperationInfo_Click(object sender, EventArgs e) diff --git a/AIMS/OperationAanesthesia/frmFactDrugNew.cs b/AIMS/OperationAanesthesia/frmFactDrugNew.cs index 27988a5..86b9363 100644 --- a/AIMS/OperationAanesthesia/frmFactDrugNew.cs +++ b/AIMS/OperationAanesthesia/frmFactDrugNew.cs @@ -20,6 +20,7 @@ namespace AIMS.PublicUI.UI public int currentTabIndex = 2; public bool isCVhageAllSapDose = false; public int DrugTypeId; + public DateTime? ClickTime; #region 公共成员 int x = 0; @@ -674,6 +675,9 @@ namespace AIMS.PublicUI.UI VelocityUnit.DataSource = ControlExtension._VelocityUnit; VelocityUnit.DisplayMember = "Name"; VelocityUnit.ValueMember = "Id"; + + if (ClickTime != null) + _dataGridView.Rows[e.RowIndex].Cells[14].Value = ClickTime.Value.ToString("yyyy-MM-dd HH:mm"); } private void dgvDrugs_CellClick(object sender, DataGridViewCellEventArgs e) diff --git a/AIMS/OperationAanesthesia/frmFactSpeedyDrug.Designer.cs b/AIMS/OperationAanesthesia/frmFactSpeedyDrug.Designer.cs index f14dc5d..627f7f5 100644 --- a/AIMS/OperationAanesthesia/frmFactSpeedyDrug.Designer.cs +++ b/AIMS/OperationAanesthesia/frmFactSpeedyDrug.Designer.cs @@ -432,12 +432,6 @@ // this.dataGridViewTextBoxColumn8.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; this.dataGridViewTextBoxColumn8.HeaderText = "通路"; - this.dataGridViewTextBoxColumn8.Items.AddRange(new object[] { - "", - "1", - "2", - "3", - "4"}); this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8"; this.dataGridViewTextBoxColumn8.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.dataGridViewTextBoxColumn8.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; diff --git a/AIMS/OperationAanesthesia/frmFactSpeedyDrug.cs b/AIMS/OperationAanesthesia/frmFactSpeedyDrug.cs index bedfa88..37f8f59 100644 --- a/AIMS/OperationAanesthesia/frmFactSpeedyDrug.cs +++ b/AIMS/OperationAanesthesia/frmFactSpeedyDrug.cs @@ -20,6 +20,7 @@ namespace AIMS.PublicUI.UI public int currentTabIndex = 1; public bool isCVhageAllSapDose = false; public int DrugTypeId; + public DateTime ClickTime; #region 公共成员 int x = 0; @@ -78,13 +79,21 @@ namespace AIMS.PublicUI.UI private void frmFactDrugNew2_Load(object sender, EventArgs e) { - SetDGVNotSort(); - Initial(); - FullALLDGV(); - tabDrugs.SelectedTabIndex = currentTabIndex; - _dataGridView = dgvDrugsSZ; - dgvYP.Visible = false; - dgvYP.AutoGenerateColumns = false; + try + { + if (factDrugs == null) factDrugs = new List(); + SetDGVNotSort(); + Initial(); + FullALLDGV(); + tabDrugs.SelectedTabIndex = currentTabIndex; + _dataGridView = dgvDrugsSZ; + dgvYP.Visible = false; + dgvYP.AutoGenerateColumns = false; + } + catch (Exception ex) + { + PublicMethod.WriteLog(ex); + } } @@ -400,6 +409,8 @@ namespace AIMS.PublicUI.UI VelocityUnit.DataSource = ControlExtension._VelocityUnit; VelocityUnit.DisplayMember = "Name"; VelocityUnit.ValueMember = "Id"; + + _dataGridView.Rows[e.RowIndex].Cells[14].Value = ClickTime.ToString("yyyy-MM-dd HH:mm"); } private void dgvDrugs_CellClick(object sender, DataGridViewCellEventArgs e) diff --git a/AIMSEntity/Extensions/SelectPatient.cs b/AIMSEntity/Extensions/SelectPatient.cs index 5979c78..42cd79f 100644 --- a/AIMSEntity/Extensions/SelectPatient.cs +++ b/AIMSEntity/Extensions/SelectPatient.cs @@ -66,10 +66,10 @@ namespace AIMSBLL { if (isEnOpe == false) { - string strSql = "SELECT of1.PatientId, of1.ApplyId, of1.ApplyDepName, of1.OperationType, of1.MdrecNo, of1.PatientName, " + + string strSql = "SELECT of1.PatientId, of1.ApplyId, of1.DeptName, of1.OperationType, of1.MdrecNo, of1.PatientName, " + "of1.ApplyOperationInfoName, of1.OperationDoctor, of1.State ," + "of1.AnesthesiaDoctor,of1.OperationRoomId,of1.InstrumentNurse,of1.TourNurse,of1.OperationRoom,of1.PlanOrder " + - "FROM V_OperationFront of1 WHERE of1.OrderOperationTime>='" + BeginDate + "' AND of1.OrderOperationTime<'" + EndDate + "' "; + "FROM V_OperationRecordInfo of1 WHERE of1.OrderOperationTime>='" + BeginDate + "' AND of1.OrderOperationTime<'" + EndDate + "' "; if (isLoginPerson == true) { strSql += " and (AnesthesiaDoctor like '%" + person + "%' or InstrumentNurse like '%" + person + "%' or TourNurse like '%" + person + "%')"; @@ -78,10 +78,10 @@ namespace AIMSBLL } else { - string strSql = "SELECT of1.PatientId, of1.ApplyId, of1.ApplyDepName, of1.OperationType, of1.MdrecNo, of1.PatientName, " + + string strSql = "SELECT of1.PatientId, of1.ApplyId, of1.DeptName, of1.OperationType, of1.MdrecNo, of1.PatientName, " + "of1.ApplyOperationInfoName, of1.OperationDoctor, of1.State ," + "of1.AnesthesiaDoctor,of1.OperationRoomId,of1.InstrumentNurse,of1.TourNurse,of1.OperationRoom,of1.PlanOrder,InRoomTime " + - "FROM [V_OperationRecordALL] of1 WHERE of1.OrderOperationTime>='" + BeginDate + "' AND of1.OrderOperationTime<'" + EndDate + "' and SZstate =2 "; + "FROM [V_OperationRecordInfo] of1 WHERE of1.OrderOperationTime>='" + BeginDate + "' AND of1.OrderOperationTime<'" + EndDate + "' and State ='手术结束' "; if (isLoginPerson == true) { strSql += " and (AnesthesiaDoctor like '%" + person + "%' or InstrumentNurse like '%" + person + "%' or TourNurse like '%" + person + "%')"; @@ -93,7 +93,7 @@ namespace AIMSBLL public static DataTable GetSelectPatientChart() { - string strSql = "select * from (select CONVERT(nvarchar(7), InRoomTime,120) dat, SUM(ROUND((DATEDIFF(minute, InRoomTime, OutRoomTime)) / CONVERT(FLOAT, 60), 1)) AS DiffDate from OperationRecord where State=2 group by CONVERT(nvarchar(7),InRoomTime , 120) ) a order by dat Asc "; + string strSql = "select * from (select CONVERT(nvarchar(7), InRoomTime,120) dat, SUM(ROUND((DATEDIFF(minute, InRoomTime, OutRoomTime)) / CONVERT(FLOAT, 60), 1)) AS DiffDate from OperationRecord where State=2 and InRoomTime>'"+ DateTime.Now.AddMonths(-1).ToString("yyyy-MM-01 00:00:00")+ "' group by CONVERT(nvarchar(7),InRoomTime , 120) ) a order by dat Asc "; return HelperDB.DbHelperSQL.GetDataTable(strSql.ToString()); } public static DataTable GetSelectPatientChart2(DateTime dateTime) diff --git a/DrawGraph/AreaManage/DrugsManage.cs b/DrawGraph/AreaManage/DrugsManage.cs index 20b426f..f1fb77d 100644 --- a/DrawGraph/AreaManage/DrugsManage.cs +++ b/DrawGraph/AreaManage/DrugsManage.cs @@ -97,11 +97,12 @@ namespace DrawGraph { DateTime BeginTime = reDrugsTime(sender as ZedGraphControl, e); double addDragRowHeight = (lines.RealEndY - lines.RealY) / RowsCount; + bool isDrug = false; foreach (FactDrug dsr in myOpeRecord.FactDrugList) { if (dsr.isEqual(y, BeginTime, addDragRowHeight) || dsr.IsSelected) { - //isDrug = true; + isDrug = true; viewStr = dsr.DrugName + ":" + dsr.Dosage + dsr.DosageUnit; if (dsr.DrugBeginTime != null) viewStr += "\n开始时间:" + dsr.DrugBeginTime.ToString("yyyy-MM-dd HH:mm"); @@ -129,6 +130,13 @@ namespace DrawGraph break; } } + if (!isDrug) + { + viewStr = BeginTime.ToString("HH:mm"); + aSyncTip.ViewStr = viewStr; + aSyncTip.Show(x, y + yP); + ZedControl.Refresh(); + } } //} } @@ -222,8 +230,10 @@ namespace DrawGraph } } if (records.Count > 0) - myOpeRecord.SpeedyDrugsMethod(records); + myOpeRecord.SpeedyDrugsMethod(records, BeginTime); } + else + myOpeRecord.SpeedyDrugsMethod(null, BeginTime); } } } @@ -646,7 +656,7 @@ namespace DrawGraph double[] y2; //double yTemp = ZedControl.Height * lines.RealEndY + 80; - PointF mousePt = new PointF(e.X, 1000); + PointF mousePt = new PointF(e.X, 1300); ZedGraphControl sender1 = sender as ZedGraphControl; GraphPane pane = sender1.MasterPane.FindChartRect(mousePt); diff --git a/DrawGraph/AreaManage/OperationRecord.cs b/DrawGraph/AreaManage/OperationRecord.cs index ed59b82..f2f55d0 100644 --- a/DrawGraph/AreaManage/OperationRecord.cs +++ b/DrawGraph/AreaManage/OperationRecord.cs @@ -1254,14 +1254,14 @@ namespace DrawGraph get { return SelectedAreaObj.GetInstance(); } } - public delegate void SpeedyDrugs(List factDrugs); + public delegate void SpeedyDrugs(List factDrugs, DateTime clickTime); public event SpeedyDrugs SpeedyDrugsParam; - public void SpeedyDrugsMethod(List factDrugs) + public void SpeedyDrugsMethod(List factDrugs,DateTime clickTime) { if (SpeedyDrugsParam != null) - SpeedyDrugsParam(factDrugs); + SpeedyDrugsParam(factDrugs,clickTime); } [NoCreatControlAttributs] public List FactEventsList diff --git a/DrawGraph/AreaManage/PhysioDataManage.cs b/DrawGraph/AreaManage/PhysioDataManage.cs index 35d6f6b..4bd1826 100644 --- a/DrawGraph/AreaManage/PhysioDataManage.cs +++ b/DrawGraph/AreaManage/PhysioDataManage.cs @@ -901,8 +901,7 @@ namespace DrawGraph double[] y; double[] y2; - PointF mousePt = new PointF(e.X, e.Y); - + PointF mousePt = new PointF(e.X, e.Y); GraphPane pane = ZedControl.MasterPane.FindChartRect(mousePt); if (pane == null) return null; pane.ReverseTransform(mousePt, out x, out x2, out y, out y2); diff --git a/DrawGraph/AreaManage/SapManage.cs b/DrawGraph/AreaManage/SapManage.cs index bccadd1..b4febac 100644 --- a/DrawGraph/AreaManage/SapManage.cs +++ b/DrawGraph/AreaManage/SapManage.cs @@ -107,11 +107,12 @@ namespace DrawGraph { DateTime BeginTime = reDrugsTime(sender as ZedGraphControl, e); double addDragRowHeight = (lines.RealEndY - lines.RealY) / RowsCount; + bool isDrug = false; foreach (FactDrug dsr in myOpeRecord.FactDrugList) { if (dsr.isEqual(y, BeginTime, addDragRowHeight) || dsr.IsSelected) { - //isDrug = true; + isDrug = true; viewStr = dsr.DrugName + ":" + dsr.Dosage + dsr.DosageUnit; if (dsr.DrugBeginTime != null) viewStr += "\n开始时间:" + dsr.DrugBeginTime.ToString("yyyy-MM-dd HH:mm"); @@ -139,6 +140,13 @@ namespace DrawGraph break; } } + if (!isDrug) + { + viewStr = BeginTime.ToString("HH:mm"); + aSyncTip.ViewStr = viewStr; + aSyncTip.Show(x, y + yP); + ZedControl.Refresh(); + } } //} } @@ -232,8 +240,10 @@ namespace DrawGraph } } if (records.Count > 0) - myOpeRecord.SpeedyDrugsMethod(records); + myOpeRecord.SpeedyDrugsMethod(records,BeginTime); } + else + myOpeRecord.SpeedyDrugsMethod(null, BeginTime); } } } @@ -522,7 +532,7 @@ namespace DrawGraph double[] y2; //double yTemp = ZedControl.Height * lines.RealEndY + 80; - PointF mousePt = new PointF(e.X, 1000); + PointF mousePt = new PointF(e.X, 1300); ZedGraphControl sender1 = sender as ZedGraphControl; GraphPane pane = sender1.MasterPane.FindChartRect(mousePt); @@ -537,8 +547,8 @@ namespace DrawGraph return DateTime.Now; } } - catch (Exception) - { + catch (Exception ex) + { return DateTime.Now; } }