diff --git a/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordBill.cs b/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordBill.cs index f3d56d0..be8f791 100644 --- a/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordBill.cs +++ b/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordBill.cs @@ -1731,7 +1731,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI { try { - DateTime dts = BOperationRecord.lastMaxOperationDate(myOpeRecord.Id.Value); + DateTime dts = BOperationRecord.lastMaxOperationDate(myOpeRecord.PatientId.Value, myOpeRecord.RecoverId.Value); DateTime nowDate = DateTime.Now; TimeSpan tsp = nowDate - dts; if (tsp.TotalHours <= 12 && tsp.TotalDays <= 1 && dts < nowDate)//&& IsReview == false diff --git a/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordBill2.Designer.cs b/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordBill2.Designer.cs index 91b0012..32df05c 100644 --- a/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordBill2.Designer.cs +++ b/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordBill2.Designer.cs @@ -656,11 +656,11 @@ this.lblDia.AutoSize = true; this.lblDia.Font = new System.Drawing.Font("微软雅黑", 23F); this.lblDia.ForeColor = System.Drawing.Color.Red; - this.lblDia.Location = new System.Drawing.Point(43, 217); + this.lblDia.Location = new System.Drawing.Point(30, 217); this.lblDia.Name = "lblDia"; - this.lblDia.Size = new System.Drawing.Size(82, 40); + this.lblDia.Size = new System.Drawing.Size(108, 40); this.lblDia.TabIndex = 5; - this.lblDia.Text = "--/--"; + this.lblDia.Text = "---/---"; // // lblPR // @@ -1968,6 +1968,7 @@ this.Text = "麻醉记录单"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.frmAnasRecordBill2_Load); + this.VisibleChanged += new System.EventHandler(this.frmAnasRecordBill2_VisibleChanged); this.panel3.ResumeLayout(false); this.panel14.ResumeLayout(false); this.panel4.ResumeLayout(false); diff --git a/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordBill2.cs b/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordBill2.cs index a392d5b..8e8530f 100644 --- a/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordBill2.cs +++ b/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordBill2.cs @@ -758,7 +758,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI { foreach (var addPP in _record.addPhysioList) { - addPP.clearAddObj(zgcAnaesRecord); + addPP.clearAddObj(zgcAnaesRecord); } BOperationRecord.DeletePhysioDataByOpeID(_record.Id.Value); //同步未画点数据 @@ -915,7 +915,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI { try { - DateTime dts = BOperationRecord.lastMaxOperationDate(myOpeRecord.Id.Value); + DateTime dts = BOperationRecord.lastMaxOperationDate(myOpeRecord.PatientId.Value, myOpeRecord.RecoverId.Value); DateTime nowDate = DateTime.Now; TimeSpan tsp = nowDate - dts; if (tsp.TotalHours <= 12 && tsp.TotalDays <= 1 && dts < nowDate)//&& IsReview == false @@ -1019,7 +1019,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI _record = new OperationRecord(); btnSelectPatient.Enabled = true; btnCancelOperation.Enabled = false; - btnCancelIn.Enabled = false; + btnCancelIn.Enabled = false; LastMonitorDataTime = null; ClearTimeText(); if (templateManage != null) @@ -1085,7 +1085,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI frmFactDrug._record = _record; frmFactDrug.zgcAnaesRecord = zgcAnaesRecord; frmFactDrug.DrugTypeId = RecoverId; // 事件类型 1 麻醉单事件 2 麻醉恢复单 - frmFactDrug.FormClosed += new FormClosedEventHandler(frmFactEventsNew_FormClosed); + frmFactDrug.DrugsParam += FrmFactDrug_DrugsParam; frmFactDrug.ShowDialog(); } else @@ -1093,6 +1093,11 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI MessageBox.Show("请选择患者"); } } + + private void FrmFactDrug_DrugsParam() + { + plRefresh_Click(null, null); + } private void btnAddEvents_Click(object sender, EventArgs e) { if (PatientId != 0) @@ -1117,7 +1122,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI frmFactOutputLiquids._record = _record; frmFactOutputLiquids.zgcAnaesRecord = zgcAnaesRecord; frmFactOutputLiquids.OutputLiquidTypeId = RecoverId; // 事件类型 1 麻醉单事件 2 麻醉恢复单 - frmFactOutputLiquids.FormClosed += new FormClosedEventHandler(frmFactEventsNew_FormClosed); + frmFactOutputLiquids.OutParam += FrmFactOutputLiquids_OutParam; frmFactOutputLiquids.ShowDialog(); } else @@ -1125,6 +1130,12 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI MessageBox.Show("请选择患者"); } } + + private void FrmFactOutputLiquids_OutParam() + { + plRefresh_Click(null, null); + } + private void button6_Click(object sender, EventArgs e) { frmAnaseDataQualityRecord frmAnaseDataQuality = new frmAnaseDataQualityRecord(); @@ -1284,7 +1295,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI public DateTime? LastMonitorDataTime = null; private void timerGetCollectorData_Tick(bool isOpen) { - if (State == AIMSExtension.EditState.BROWSE || _record.StateName != "手术中" || NowRoom == null || isReadOnly == true) return; + if (State == AIMSExtension.EditState.BROWSE || _record.StateName != "手术中" || NowRoom == null || isReadOnly == true) return; if (_record.OutRoomTime != null && DateTime.Now >= _record.OutRoomTime) return; DateTime dtTime = DateTime.Now; @@ -1294,13 +1305,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI if (LastMonitorDataTime != null && LastMonitorDataTime.Value.ToString("yyyy-MM-dd HH:mm") == dtTime.ToString("yyyy-MM-dd HH:mm")) return; if (LastMonitorDataTime != null && LastMonitorDataTime.Value > dtTime) return; try - { - //bool isNowRoom = isOpeRoom(); - //if (isNowRoom == false) - //{ - // return; - //} - + { LastMonitorDataTime = dtTime; DateTime InsertTime = Convert.ToDateTime(dtTime.ToString("yyyy-MM-dd HH:mm:00.000")); int date = 0; @@ -1310,8 +1315,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI { string key = addPP.Name; string value = addPP.Enname; - if (addPP.IsValid == false) continue; - //if (addPP.StopCollect == true) continue; + if (addPP.IsValid == false) continue; if (key == "机械通气") continue; if (value == null || value == "") continue; @@ -1390,8 +1394,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI } public string szy;//舒张压 - public string ssy;//收缩压 - public DateTime? LastRespMonitorDataTime; + public string ssy;//收缩压 private void timerGetTextCollectorData_Tick(object sender, EventArgs e) { try @@ -1499,15 +1502,15 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI } } string szyssy = ssy + "/" + szy; - lblDia.Text = szyssy == "/" ? "--/--" : szyssy; + lblDia.Text = szyssy == "/" ? "---/---" : szyssy; } else { - lblHR.Text = "- -"; - lblRESP.Text = "- -"; - lblSpo2.Text = "- -"; - lblPR.Text = "- -"; - lblDia.Text = "--/--"; + lblHR.Text = "--"; + lblRESP.Text = "--"; + lblSpo2.Text = "--"; + lblPR.Text = "--"; + lblDia.Text = "---/---"; lblHR.ForeColor = Color.Green; lblRESP.ForeColor = Color.Yellow; lblSpo2.ForeColor = Color.Cyan; @@ -1565,12 +1568,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI timerGetTextCollectorData.Stop(); } } - - public void StarttimerGetTextCollectorData() - { - if (timerGetTextCollectorData == null) return; - timerGetTextCollectorData.Start(); - } + #endregion @@ -2159,6 +2157,24 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI // templateManage2.SetPYL(); //} } + private void frmAnasRecordBill2_VisibleChanged(object sender, EventArgs e) + { + + if (this.Visible == false) + { + if (_record != null && _record.StateName == "手术中" && State != AIMSExtension.EditState.BROWSE) + { + DisposeTimer(); + } + } + else + { + if (_record != null && _record.StateName == "手术中" && State != AIMSExtension.EditState.BROWSE) + { + StartTimer(); + } + } + } #endregion } diff --git a/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordInstrument.Designer.cs b/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordInstrument.Designer.cs index f8a5d55..052ce80 100644 --- a/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordInstrument.Designer.cs +++ b/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordInstrument.Designer.cs @@ -549,11 +549,11 @@ this.lblDia.AutoSize = true; this.lblDia.Font = new System.Drawing.Font("微软雅黑", 23F); this.lblDia.ForeColor = System.Drawing.Color.Red; - this.lblDia.Location = new System.Drawing.Point(40, 232); + this.lblDia.Location = new System.Drawing.Point(27, 232); this.lblDia.Name = "lblDia"; - this.lblDia.Size = new System.Drawing.Size(82, 40); + this.lblDia.Size = new System.Drawing.Size(108, 40); this.lblDia.TabIndex = 35; - this.lblDia.Text = "--/--"; + this.lblDia.Text = "---/---"; // // lblPR // @@ -1759,6 +1759,7 @@ this.Text = "器械清点单"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.frmAnasRecordInstrument_Load); + this.VisibleChanged += new System.EventHandler(this.frmAnasRecordInstrument_VisibleChanged); this.panel3.ResumeLayout(false); this.panel14.ResumeLayout(false); this.panel4.ResumeLayout(false); diff --git a/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordInstrument.cs b/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordInstrument.cs index b8ca242..98b8617 100644 --- a/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordInstrument.cs +++ b/AIMS/OperationDoing/AnasRecordBill/frmAnasRecordInstrument.cs @@ -6,6 +6,7 @@ using AIMSBLL; using AIMSExtension; using AIMSModel; using AxNsoOfficeLib; +using DCSoftDotfuscate; using DevComponents.Editors.DateTimeAdv; using DrawGraph; using KHD_OREMRInterface; @@ -51,7 +52,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI } private void frmAnasRecordInstrument_Load(object sender, EventArgs e) - { + { labOperatorName.Text = "(" + AIMSExtension.PublicMethod.OperatorNo + ")" + " " + AIMSExtension.PublicMethod.OperatorName; if (NowRoom != null) lblRoom.Text = NowRoom.Name; circularProgress1.Location = new Point((panel8.Width - circularProgress1.Width) / 2, (panel8.Height - circularProgress1.Height) / 2); @@ -526,6 +527,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI txtOperationBegin.LostFocus += new EventHandler(txtDateTime_LostFocus); txtOperationEnd.LostFocus += new EventHandler(txtDateTime_LostFocus); } + GetPhysioDataConfig(); circularProgress1.IsRunning = false; circularProgress1.Visible = false; zgcAnaesRecord.Visible = true; @@ -731,11 +733,12 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI { try { - if (((TimeSpan)(DateTime.Now - _record.lastPageBegin)).TotalHours > 24 || NowRoom == null) return; + if (NowRoom == null) return; ShowMonitorDataToRight(); } - catch (Exception) - { + catch (Exception ex) + { + PublicMethod.WriteLog(ex); } } @@ -769,78 +772,71 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI { if (keyValuePair.Enname.ToUpper() == p.Name.ToUpper()) { - try + object paramValue = p.GetValue(nowPhysioData, null); + if (paramValue != null && paramValue.ToString() != string.Empty && paramValue.ToString() != "NaN" && paramValue.ToString() != "NULL") { - object paramValue = p.GetValue(nowPhysioData, null); - if (paramValue != null && paramValue.ToString() != string.Empty && paramValue.ToString() != "NaN" && paramValue.ToString() != "NULL") + double value = Double.Parse(paramValue.ToString()); + value = Convert.ToInt32(value); + if (value < keyValuePair.WarningLowLimit || value > keyValuePair.WarningHighLimit) { - double value = Double.Parse(paramValue.ToString()); - value = Convert.ToInt32(value); - if (value < keyValuePair.WarningLowLimit || value > keyValuePair.WarningHighLimit) - { - iswar = true; - } - - if (keyValuePair.Name == "心率") - { - lblHR.Text = value <= 0 ? "- -" : value.ToString(); - if (iswar == true) lblHR.ForeColor = Color.Red; else lblHR.ForeColor = Color.Green; - } - if (keyValuePair.Name == "自主呼吸") - { - lblRESP.Text = value <= 0 ? "- -" : value.ToString(); - if (iswar == true) lblRESP.ForeColor = Color.Red; else lblRESP.ForeColor = Color.Yellow; - } - if (keyValuePair.Name == "氧饱和度") - { - lblSpo2.Text = value <= 0 ? "- -" : value.ToString(); - if (iswar == true) lblSpo2.ForeColor = Color.Red; else lblSpo2.ForeColor = Color.Cyan; - } - if (keyValuePair.Name == "脉率") - { - lblPR.Text = value <= 0 ? "- -" : value.ToString(); - if (iswar == true) lblPR.ForeColor = Color.Red; else lblPR.ForeColor = Color.Green; - } - if (keyValuePair.Name == "无创舒张压") - { - szy = value <= 0 ? "" : value.ToString(); - //if (iswar == true) lblDia.ForeColor = Color.Red; else lblDia.ForeColor = Color.Green; - } - if (keyValuePair.Name == "无创收缩压") - { - ssy = value <= 0 ? "" : value.ToString(); - //if (iswar == true) lblDia.ForeColor = Color.Red; else lblDia.ForeColor = Color.Green; - } - if (keyValuePair.Name == "有创舒张压") - { - szy = value <= 0 ? "" : value.ToString(); - //if (iswar == true) lblDia.ForeColor = Color.Red; else lblDia.ForeColor = Color.Green; - } - if (keyValuePair.Name == "有创收缩压") - { - ssy = value <= 0 ? "" : value.ToString(); - //if (iswar == true) lblDia.ForeColor = Color.Red; else lblDia.ForeColor = Color.Green; - } - break; + iswar = true; } - } - catch (Exception) - { - //PublicMethod.WriteLog(ex); + + if (keyValuePair.Name == "心率") + { + lblHR.Text = value <= 0 ? "- -" : value.ToString(); + if (iswar == true) lblHR.ForeColor = Color.Red; else lblHR.ForeColor = Color.Green; + } + if (keyValuePair.Name == "自主呼吸") + { + lblRESP.Text = value <= 0 ? "- -" : value.ToString(); + if (iswar == true) lblRESP.ForeColor = Color.Red; else lblRESP.ForeColor = Color.Yellow; + } + if (keyValuePair.Name == "氧饱和度") + { + lblSpo2.Text = value <= 0 ? "- -" : value.ToString(); + if (iswar == true) lblSpo2.ForeColor = Color.Red; else lblSpo2.ForeColor = Color.Cyan; + } + if (keyValuePair.Name == "脉率") + { + lblPR.Text = value <= 0 ? "- -" : value.ToString(); + if (iswar == true) lblPR.ForeColor = Color.Red; else lblPR.ForeColor = Color.Green; + } + if (keyValuePair.Name == "无创舒张压") + { + szy = value <= 0 ? "" : value.ToString(); + //if (iswar == true) lblDia.ForeColor = Color.Red; else lblDia.ForeColor = Color.Green; + } + if (keyValuePair.Name == "无创收缩压") + { + ssy = value <= 0 ? "" : value.ToString(); + //if (iswar == true) lblDia.ForeColor = Color.Red; else lblDia.ForeColor = Color.Green; + } + if (keyValuePair.Name == "有创舒张压") + { + szy = value <= 0 ? "" : value.ToString(); + //if (iswar == true) lblDia.ForeColor = Color.Red; else lblDia.ForeColor = Color.Green; + } + if (keyValuePair.Name == "有创收缩压") + { + ssy = value <= 0 ? "" : value.ToString(); + //if (iswar == true) lblDia.ForeColor = Color.Red; else lblDia.ForeColor = Color.Green; + } + break; } } } } string szyssy = ssy + "/" + szy; - lblDia.Text = szyssy == "/" ? "--/--" : szyssy; + lblDia.Text = szyssy == "/" ? "---/---" : szyssy; } else { - lblHR.Text = "- -"; - lblRESP.Text = "- -"; - lblSpo2.Text = "- -"; - lblPR.Text = "- -"; - lblDia.Text = "--/--"; + lblHR.Text = "--"; + lblRESP.Text = "--"; + lblSpo2.Text = "--"; + lblPR.Text = "--"; + lblDia.Text = "---/---"; lblHR.ForeColor = Color.Green; lblRESP.ForeColor = Color.Yellow; lblSpo2.ForeColor = Color.Cyan; @@ -848,7 +844,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI lblDia.ForeColor = Color.Red; } } - + private void StartTimer() { if (timerGetTextCollectorData == null) @@ -981,6 +977,59 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI } } + private void GetPhysioDataConfig () + { + if (_record.addPhysioList.Count == 0) + { + //加载生命体征图标 + IList dt = PhysioDataConfig.GetAllList(); + for (int i = 0; i < dt.Count; i++) + { + PhysioDataConfig pp = dt[i]; + string[] str = pp.Color.Split('.'); + int A = int.Parse(str[0].ToString()); + int R = int.Parse(str[1].ToString()); + int G = int.Parse(str[2].ToString()); + int B = int.Parse(str[3].ToString()); + pp.ConveColor = System.Drawing.Color.FromArgb(A, R, G, B); + + if (pp.IsDefalultShow == false || (pp.ShowImg == false && pp.ShowText == false)) + { + pp.showStyle = "不显示"; + pp.IsValid = false; + } + else + { + if (pp.ShowImg == true) + { + pp.showStyle = "显示曲线"; + pp.IsValid = true; + } + if (pp.ShowText == true) + { + pp.showStyle = "显示数值"; + pp.IsValid = true; + } + + } + pp.showStyle = "显示曲线"; + DateTime DateTimeNow = DateTime.Now; + bool isHave = false; + foreach (PhysioDataConfig appTemp in _record.addPhysioList) + { + if (appTemp.Name.Equals(pp.Name)) + { + isHave = true; + } + } + if (!isHave) + { + _record.addPhysioList.Add(pp); + } + } + } + } + private void DrawEvent() { reDrawEvent(); @@ -1141,7 +1190,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI } fnc.ShowDialog(); } - + private void btnsbwh_Click(object sender, EventArgs e) { frmInstrumentRegistration frm = new frmInstrumentRegistration(); @@ -1149,11 +1198,11 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI } private void btnsjzx_Click(object sender, EventArgs e) - { + { frmLISResult lISResult = new frmLISResult(); lISResult.PatientNo = _record.InHospitalNo; lISResult.Show(); - } + } #endregion #region 器械清点 @@ -1591,7 +1640,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI } if (templateManage != null) { - _record.InstrumentList.ApplianceRecordList = GetApplianceRecord(); + _record.InstrumentList.ApplianceRecordList = GetApplianceRecord(); _record.InstrumentList.InstrumentNurse = txtInstrumentNurse.Text; _record.InstrumentList.TourNurse = txtTourNurse.Text; _record.InstrumentList.Remark = txtRemark.Text; @@ -1740,7 +1789,7 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI } private void button9_Click(object sender, EventArgs e) - { + { TextBoxAddEventSources(panelQX, @"\"); } @@ -1774,6 +1823,24 @@ namespace AIMS.OperationDoing.AnasRecordBill.UI } } + private void frmAnasRecordInstrument_VisibleChanged(object sender, EventArgs e) + { + if (this.Visible == false) + { + if (_record != null && _record.StateName == "手术中" && State != AIMSExtension.EditState.BROWSE) + { + DisposeTimer(); + } + } + else + { + if (_record != null && _record.StateName == "手术中" && State != AIMSExtension.EditState.BROWSE) + { + StartTimer(); + } + } + } + private void plPrint_Click(object sender, EventArgs e) { if (_record == null || _record.Id == 0) return; diff --git a/AIMS/OperationDoing/AnasRecordBill/frmFactDrugNew.cs b/AIMS/OperationDoing/AnasRecordBill/frmFactDrugNew.cs index cc1087b..0514325 100644 --- a/AIMS/OperationDoing/AnasRecordBill/frmFactDrugNew.cs +++ b/AIMS/OperationDoing/AnasRecordBill/frmFactDrugNew.cs @@ -274,7 +274,8 @@ namespace AIMS.PublicUI.UI dr.Cells[2].Value = drug.DrugKind; dr.Cells[3].Tag = drug.Id; dr.Cells[3].Value = drug.Name; - dr.Cells[5].Value = "ivgtt"; + dr.Cells[4].Value = drug.Remark; + dr.Cells[5].Value = drug.Channel; if (tabDrugs.SelectedTab.Name == "P3") dr.Cells[5].Value = "泵入"; if (dr.Cells[2].Value.ToString() == "血液制品") { diff --git a/AIMS/OperationDoing/AnasRecordBill/frmFactOutputLiquidsNew.cs b/AIMS/OperationDoing/AnasRecordBill/frmFactOutputLiquidsNew.cs index a605980..6eb585b 100644 --- a/AIMS/OperationDoing/AnasRecordBill/frmFactOutputLiquidsNew.cs +++ b/AIMS/OperationDoing/AnasRecordBill/frmFactOutputLiquidsNew.cs @@ -36,7 +36,9 @@ namespace AIMS.PublicUI.UI /// /// 计量单位集合 /// - public List _unitList; + public List _unitList; + public delegate void OutsParamHandler(); + public event OutsParamHandler OutParam; int LastColumnIndex = 0;// e.ColumnIndex public int OutputLiquidTypeId; diff --git a/AIMS/OperationDoing/AnasRecoverBill/frmAnasRecoverBill.cs b/AIMS/OperationDoing/AnasRecoverBill/frmAnasRecoverBill.cs index a939f83..1bca47a 100644 --- a/AIMS/OperationDoing/AnasRecoverBill/frmAnasRecoverBill.cs +++ b/AIMS/OperationDoing/AnasRecoverBill/frmAnasRecoverBill.cs @@ -1481,7 +1481,7 @@ namespace AIMS.OperationDoing.AnasRecoverBill.UI { try { - DateTime dts = BOperationRecord.lastMaxOperationDate(myOpeRecord.Id.Value); + DateTime dts = BOperationRecord.lastMaxOperationDate(myOpeRecord.PatientId.Value,myOpeRecord.RecoverId.Value); DateTime nowDate = DateTime.Now; TimeSpan tsp = nowDate - dts; if (tsp.TotalHours <= 12 && tsp.TotalDays <= 1 && dts < nowDate)//&& IsReview == false diff --git a/AIMS/OperationFront/frmOperationSchedulePlan.cs b/AIMS/OperationFront/frmOperationSchedulePlan.cs index 4cb0354..0ed13be 100644 --- a/AIMS/OperationFront/frmOperationSchedulePlan.cs +++ b/AIMS/OperationFront/frmOperationSchedulePlan.cs @@ -3701,7 +3701,7 @@ namespace AIMS.OperationFront.UI { ucPlanOperationRoomCard ucOpeRoom = new ucPlanOperationRoomCard(selOperationRooms.Rooms[i], operationRooms); ucOpeRoom.Width = width; - ucOpeRoom.Height = 110; + ucOpeRoom.Height = 135; ucOpeRoom.dgvDetail = dgvDetail; if (row != i / 5) diff --git a/AIMS/OremrUserControl/ucPlanOperationRoomCard.Designer.cs b/AIMS/OremrUserControl/ucPlanOperationRoomCard.Designer.cs index f2dbdf6..8908e33 100644 --- a/AIMS/OremrUserControl/ucPlanOperationRoomCard.Designer.cs +++ b/AIMS/OremrUserControl/ucPlanOperationRoomCard.Designer.cs @@ -61,7 +61,7 @@ this.panelExMain.Dock = System.Windows.Forms.DockStyle.Fill; this.panelExMain.Location = new System.Drawing.Point(0, 0); this.panelExMain.Name = "panelExMain"; - this.panelExMain.Size = new System.Drawing.Size(200, 110); + this.panelExMain.Size = new System.Drawing.Size(320, 135); this.panelExMain.Style.Alignment = System.Drawing.StringAlignment.Center; this.panelExMain.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.panelExMain.Style.Border = DevComponents.DotNetBar.eBorderType.DoubleLine; @@ -76,11 +76,11 @@ // this.lblNurse2.ContextMenuStrip = this.contextMenuStrip1; this.lblNurse2.Dock = System.Windows.Forms.DockStyle.Top; - this.lblNurse2.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.lblNurse2.Location = new System.Drawing.Point(0, 88); + this.lblNurse2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold); + this.lblNurse2.Location = new System.Drawing.Point(0, 106); this.lblNurse2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.lblNurse2.Name = "lblNurse2"; - this.lblNurse2.Size = new System.Drawing.Size(200, 17); + this.lblNurse2.Size = new System.Drawing.Size(320, 22); this.lblNurse2.TabIndex = 19; this.lblNurse2.Text = "巡回护士"; this.lblNurse2.Click += new System.EventHandler(this.UcPlanOperationRoomCard_Click); @@ -94,7 +94,7 @@ this.tsDelNs2, this.tsUpdateRoom}); this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(173, 114); + this.contextMenuStrip1.Size = new System.Drawing.Size(173, 114); // // tsDel // @@ -134,11 +134,11 @@ // this.lblNurse.ContextMenuStrip = this.contextMenuStrip1; this.lblNurse.Dock = System.Windows.Forms.DockStyle.Top; - this.lblNurse.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.lblNurse.Location = new System.Drawing.Point(0, 71); + this.lblNurse.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold); + this.lblNurse.Location = new System.Drawing.Point(0, 84); this.lblNurse.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.lblNurse.Name = "lblNurse"; - this.lblNurse.Size = new System.Drawing.Size(200, 17); + this.lblNurse.Size = new System.Drawing.Size(320, 22); this.lblNurse.TabIndex = 18; this.lblNurse.Text = "洗手护士"; this.lblNurse.Click += new System.EventHandler(this.UcPlanOperationRoomCard_Click); @@ -147,11 +147,11 @@ // this.lblAnesDoctors.ContextMenuStrip = this.contextMenuStrip1; this.lblAnesDoctors.Dock = System.Windows.Forms.DockStyle.Top; - this.lblAnesDoctors.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.lblAnesDoctors.Location = new System.Drawing.Point(0, 54); + this.lblAnesDoctors.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold); + this.lblAnesDoctors.Location = new System.Drawing.Point(0, 62); this.lblAnesDoctors.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.lblAnesDoctors.Name = "lblAnesDoctors"; - this.lblAnesDoctors.Size = new System.Drawing.Size(200, 17); + this.lblAnesDoctors.Size = new System.Drawing.Size(320, 22); this.lblAnesDoctors.TabIndex = 17; this.lblAnesDoctors.Text = "麻醉医生"; this.lblAnesDoctors.Click += new System.EventHandler(this.UcPlanOperationRoomCard_Click); @@ -161,11 +161,11 @@ this.lblOpeDoctors.BackColor = System.Drawing.Color.Transparent; this.lblOpeDoctors.ContextMenuStrip = this.contextMenuStrip1; this.lblOpeDoctors.Dock = System.Windows.Forms.DockStyle.Top; - this.lblOpeDoctors.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.lblOpeDoctors.Location = new System.Drawing.Point(0, 37); + this.lblOpeDoctors.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold); + this.lblOpeDoctors.Location = new System.Drawing.Point(0, 40); this.lblOpeDoctors.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.lblOpeDoctors.Name = "lblOpeDoctors"; - this.lblOpeDoctors.Size = new System.Drawing.Size(200, 17); + this.lblOpeDoctors.Size = new System.Drawing.Size(320, 22); this.lblOpeDoctors.TabIndex = 16; this.lblOpeDoctors.Text = "手术医生"; this.lblOpeDoctors.Click += new System.EventHandler(this.UcPlanOperationRoomCard_Click); @@ -179,14 +179,15 @@ this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(200, 37); + this.panel1.Size = new System.Drawing.Size(320, 40); this.panel1.TabIndex = 8; this.panel1.Click += new System.EventHandler(this.UcPlanOperationRoomCard_Click); // // labTabindex // - this.labTabindex.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.labTabindex.Location = new System.Drawing.Point(132, 8); + this.labTabindex.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.labTabindex.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold); + this.labTabindex.Location = new System.Drawing.Point(282, 10); this.labTabindex.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.labTabindex.Name = "labTabindex"; this.labTabindex.Size = new System.Drawing.Size(69, 20); @@ -196,11 +197,12 @@ // // labelName // - this.labelName.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.labelName.Location = new System.Drawing.Point(3, 8); + this.labelName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.labelName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold); + this.labelName.Location = new System.Drawing.Point(129, 10); this.labelName.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.labelName.Name = "labelName"; - this.labelName.Size = new System.Drawing.Size(69, 20); + this.labelName.Size = new System.Drawing.Size(49, 20); this.labelName.TabIndex = 6; this.labelName.Text = "第几间"; this.labelName.Click += new System.EventHandler(this.UcPlanOperationRoomCard_Click); @@ -211,7 +213,7 @@ this.BackColor = System.Drawing.SystemColors.GradientActiveCaption; this.Controls.Add(this.panelExMain); this.Name = "ucPlanOperationRoomCard"; - this.Size = new System.Drawing.Size(200, 110); + this.Size = new System.Drawing.Size(320, 135); this.Load += new System.EventHandler(this.ucPlanOperationRoomCard_Load); this.panelExMain.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false); diff --git a/AIMSEntity/AIMSEntity.csproj b/AIMSEntity/AIMSEntity.csproj index 54e92bd..21501ba 100644 --- a/AIMSEntity/AIMSEntity.csproj +++ b/AIMSEntity/AIMSEntity.csproj @@ -390,7 +390,6 @@ - diff --git a/AIMSEntity/BLL/Extension/BApplyAnaesthesiaMethod.cs b/AIMSEntity/BLL/Extension/BApplyAnaesthesiaMethod.cs index f0e3e19..7a1f142 100644 --- a/AIMSEntity/BLL/Extension/BApplyAnaesthesiaMethod.cs +++ b/AIMSEntity/BLL/Extension/BApplyAnaesthesiaMethod.cs @@ -24,5 +24,9 @@ namespace AIMSBLL { return DApplyAnaesthesiaMethod.GetApplyAnaesthesiaMethodList(OperationApplyId); } + public static string GetApplyAnaesthesiaMethod(int OperationApplyId) + { + return DApplyAnaesthesiaMethod.GetApplyAnaesthesiaMethod(OperationApplyId); + } } } diff --git a/AIMSEntity/BLL/Extension/BOperationRecord.cs b/AIMSEntity/BLL/Extension/BOperationRecord.cs index 9b7f072..04f453e 100644 --- a/AIMSEntity/BLL/Extension/BOperationRecord.cs +++ b/AIMSEntity/BLL/Extension/BOperationRecord.cs @@ -16,6 +16,10 @@ namespace AIMSBLL { public partial class BOperationRecord { + public static int AddTitleTime(int PatientId, int ApplyId, int RecoverId, int State, DateTime Time, int RoomId) + { + return DOperationRecord.AddTitleTime(PatientId, ApplyId, RecoverId, State, Time, RoomId); + } public static OperationRecord getRecord(OperationRecord _record, int PatientId, int RecoverId) { if (_record == null) _record = new OperationRecord(); @@ -106,8 +110,6 @@ namespace AIMSBLL _record.InstrumentNurse = OperationDoingdt.Rows[0]["InstrumentNurseId"].ToString().Trim(); _record.TourNurse = OperationDoingdt.Rows[0]["TourNurseId"].ToString().Trim(); _record.OrtherDoctorId = OperationDoingdt.Rows[0]["OrtherDoctorId"].ToString().Trim(); - //if (OperationDoingdt.Rows[0]["ASALevel"] != null && OperationDoingdt.Rows[0]["ASALevel"].ToString() != "") - // _record.ASALevel = int.Parse(OperationDoingdt.Rows[0]["ASALevel"].ToString().Trim()); //_record.SpecialCase = OperationDoingdt.Rows[0]["SpecialCase"].ToString().Trim(); //if (_record.SpecialCase == null || _record.SpecialCase == "") _record.SpecialCase = "无"; //if (OperationDoingdt.Rows[0]["Fasting"].ToString() != "") @@ -207,6 +209,8 @@ namespace AIMSBLL } _record.SpareThree = allOutDose.ToString(); + if (_record.ASALevel == null || _record.ASALevel == 0) + GetASALevel(PatientId, _record); return _record; } @@ -427,10 +431,6 @@ namespace AIMSBLL { DOperationRecord.SelectSingleEntity("PatientId=" + PatientId + " and RecoverId=" + RecoverId, ref operationRecord); } - public static int AddTitleTime(int PatientId, int ApplyId, int RecoverId, int State, DateTime Time, int RoomId) - { - return DOperationRecord.AddTitleTime(PatientId, ApplyId, RecoverId, State, Time, RoomId); - } public static void UpdateState(int PatientId, int TypeId, int State) { DOperationRecord.UpdateState(PatientId, TypeId, State); @@ -508,9 +508,9 @@ namespace AIMSBLL /// /// /// - public static DateTime lastMaxOperationDate(int PatientId) + public static DateTime lastMaxOperationDate(int PatientId, int TypeId) { - string sqlStr = "select top 1 * from (SELECT s.PatientId , s.EventEndTime etime FROM FactEvents s WHERE s.PatientId = " + PatientId + " union all SELECT s.PatientId , s.DrugEndTime FROM[dbo].[FactDrug] s WHERE s.PatientId = " + PatientId + " ) a order by a.etime desc"; + string sqlStr = "select top 1 * from (SELECT s.PatientId , s.EventEndTime etime FROM FactEvents s WHERE s.EventTypeId=" + TypeId + " and s.PatientId = " + PatientId + " union all SELECT s.PatientId , s.DrugEndTime FROM[dbo].[FactDrug] s WHERE s.DrugTypeId=" + TypeId + " and s.PatientId = " + PatientId + " ) a order by a.etime desc"; DataTable dt = DBHelper.GetDataTable(sqlStr); return DateTime.Parse(dt.Rows[0][1].ToString()); } @@ -553,7 +553,7 @@ namespace AIMSBLL } return dt; } - + public static int DeletePhysioDataByOpeID(int operationId) { string sqlStr = "DELETE FROM PhysioData where PatientId = " + operationId + " "; @@ -577,5 +577,18 @@ namespace AIMSBLL { return DOperationRecord.FillOutFluid(PatientId, DrugTypeId); } + public static void GetASALevel(int PatientId, OperationRecord _record) + { + string ASALevel = BOperationReview.GetDocumentXmlStatic("麻醉术前访视记录单", PatientId, "ASA分级"); + if (ASALevel != "") + { + BasicDictionary dict = BBasicDictionary.SelectSingle(" ParentId=30 and Name='" + ASALevel + "'", null); + if (dict != null) + { + _record.ASALevel = dict.Id.Value; + BOperationRecord.Update(" ASALevel=@ASALevel where Id=@Id", new ParameterList("@ASALevel", _record.ASALevel, "@Id", _record.Id.Value)); + } + } + } } } diff --git a/AIMSEntity/DAL/AutoGenerate/DDrugs.cs b/AIMSEntity/DAL/AutoGenerate/DDrugs.cs index ea6c9cb..a4f26b1 100644 --- a/AIMSEntity/DAL/AutoGenerate/DDrugs.cs +++ b/AIMSEntity/DAL/AutoGenerate/DDrugs.cs @@ -10,78 +10,78 @@ using AIMSBLL; namespace AIMSDAL { internal partial class DDrugs - { - #region 插入实体操作部份 - /// + { + #region 插入实体操作部份 + /// /// 插入 /// - /// Command对象 + /// Command对象 /// 实体类对象 /// 标识列值或影响的记录行数 - internal static int Insert(SqlCommand cmd, Drugs drugs) - { - cmd.Parameters.Clear(); - cmd.CommandText = "insert into Drugs (Name,HelpCode,DrugKind,Stand,DosageUnit,Unit,UseRate,IsValid,OperatorNo,OperatorName,OperateDate) values (@Name,@HelpCode,@DrugKind,@Stand,@DosageUnit,@Unit,@UseRate,@IsValid,@OperatorNo,@OperatorName,@OperateDate);select @@identity"; - //从实体中取出值放入Command的参数列表 - cmd.Parameters.Add(new SqlParameter("@Name",drugs.Name==null?(object)DBNull.Value:(object)drugs.Name)); - cmd.Parameters.Add(new SqlParameter("@HelpCode",drugs.HelpCode==null?(object)DBNull.Value:(object)drugs.HelpCode)); - cmd.Parameters.Add(new SqlParameter("@DrugKind",drugs.DrugKind==null?(object)DBNull.Value:(object)drugs.DrugKind)); - cmd.Parameters.Add(new SqlParameter("@Stand",drugs.Stand==null?(object)DBNull.Value:(object)drugs.Stand)); - cmd.Parameters.Add(new SqlParameter("@DosageUnit",drugs.DosageUnit==null?(object)DBNull.Value:(object)drugs.DosageUnit)); - cmd.Parameters.Add(new SqlParameter("@Unit",drugs.Unit==null?(object)DBNull.Value:(object)drugs.Unit)); - cmd.Parameters.Add(new SqlParameter("@UseRate",drugs.UseRate.HasValue?(object)drugs.UseRate.Value:(object)DBNull.Value)); - cmd.Parameters.Add(new SqlParameter("@IsValid",drugs.IsValid.HasValue?(object)drugs.IsValid.Value:(object)DBNull.Value)); - cmd.Parameters.Add(new SqlParameter("@OperatorNo",drugs.OperatorNo==null?(object)DBNull.Value:(object)drugs.OperatorNo)); - cmd.Parameters.Add(new SqlParameter("@OperatorName",drugs.OperatorName==null?(object)DBNull.Value:(object)drugs.OperatorName)); - cmd.Parameters.Add(new SqlParameter("@OperateDate",drugs.OperateDate.HasValue?(object)drugs.OperateDate.Value:(object)DBNull.Value)); - return Convert.ToInt32(cmd.ExecuteScalar()); - } - /// + internal static int Insert(SqlCommand cmd, Drugs drugs) + { + cmd.Parameters.Clear(); + cmd.CommandText = "insert into Drugs (Name,HelpCode,DrugKind,Stand,DosageUnit,Unit,UseRate,IsValid,OperatorNo,OperatorName,OperateDate) values (@Name,@HelpCode,@DrugKind,@Stand,@DosageUnit,@Unit,@UseRate,@IsValid,@OperatorNo,@OperatorName,@OperateDate);select @@identity"; + //从实体中取出值放入Command的参数列表 + cmd.Parameters.Add(new SqlParameter("@Name", drugs.Name == null ? (object)DBNull.Value : (object)drugs.Name)); + cmd.Parameters.Add(new SqlParameter("@HelpCode", drugs.HelpCode == null ? (object)DBNull.Value : (object)drugs.HelpCode)); + cmd.Parameters.Add(new SqlParameter("@DrugKind", drugs.DrugKind == null ? (object)DBNull.Value : (object)drugs.DrugKind)); + cmd.Parameters.Add(new SqlParameter("@Stand", drugs.Stand == null ? (object)DBNull.Value : (object)drugs.Stand)); + cmd.Parameters.Add(new SqlParameter("@DosageUnit", drugs.DosageUnit == null ? (object)DBNull.Value : (object)drugs.DosageUnit)); + cmd.Parameters.Add(new SqlParameter("@Unit", drugs.Unit == null ? (object)DBNull.Value : (object)drugs.Unit)); + cmd.Parameters.Add(new SqlParameter("@UseRate", drugs.UseRate.HasValue ? (object)drugs.UseRate.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@IsValid", drugs.IsValid.HasValue ? (object)drugs.IsValid.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@OperatorNo", drugs.OperatorNo == null ? (object)DBNull.Value : (object)drugs.OperatorNo)); + cmd.Parameters.Add(new SqlParameter("@OperatorName", drugs.OperatorName == null ? (object)DBNull.Value : (object)drugs.OperatorName)); + cmd.Parameters.Add(new SqlParameter("@OperateDate", drugs.OperateDate.HasValue ? (object)drugs.OperateDate.Value : (object)DBNull.Value)); + return Convert.ToInt32(cmd.ExecuteScalar()); + } + /// /// 不使用事务的插入方法 /// /// 实体类对象 /// 标识列值或影响的记录行数 - internal static int Insert(Drugs drugs) - { - using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) - { - conn.Open(); + internal static int Insert(Drugs drugs) + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); using (SqlCommand cmd = conn.CreateCommand()) { return Insert(cmd, drugs); } - } - } - - /// + } + } + + /// /// 使用事务的插入方法 /// /// 实现共享Connection的对象 /// 实体类对象 /// 标识列值或影响的记录行数 - internal static int Insert(Connection connection,Drugs drugs) + internal static int Insert(Connection connection, Drugs drugs) { return Insert(connection.Command, drugs); } - #endregion - - #region 删除实体操作 - - /// + #endregion + + #region 删除实体操作 + + /// /// 删除 /// - /// Command对象 + /// Command对象 /// 实体类对象 /// 影响的记录行数 - internal static int ExcuteDeleteCommand(SqlCommand cmd, Drugs drugs) + internal static int ExcuteDeleteCommand(SqlCommand cmd, Drugs drugs) { - cmd.Parameters.Clear(); + cmd.Parameters.Clear(); cmd.CommandText = "delete from Drugs where Id=@Id"; //从实体中取出值放入Command的参数列表 - cmd.Parameters.Add(new SqlParameter("@Id", drugs.Id)); + cmd.Parameters.Add(new SqlParameter("@Id", drugs.Id)); return cmd.ExecuteNonQuery(); } - /// + /// /// 不使用事务的删除方法 /// /// 实体类对象 @@ -97,18 +97,18 @@ namespace AIMSDAL } } } - /// + /// /// 使用事务的删除方法 /// /// 实现共享Connection的对象 /// 实体类对象 /// 影响的记录行数 - internal static int Delete(Connection connection,Drugs drugs) + internal static int Delete(Connection connection, Drugs drugs) { - return ExcuteDeleteCommand(connection.Command, drugs); - } - - /// + return ExcuteDeleteCommand(connection.Command, drugs); + } + + /// /// 执行删除命令 /// /// Command对象 @@ -135,8 +135,8 @@ namespace AIMSDAL } return cmd.ExecuteNonQuery(); } - - /// + + /// /// 不使用事务的删除方法 /// /// 对象查询语句 @@ -153,8 +153,8 @@ namespace AIMSDAL } } } - - /// + + /// /// 使用事务的删除方法 /// /// 实现共享Connection的对象 @@ -165,34 +165,34 @@ namespace AIMSDAL { return ExcuteDeleteCommand(connection.Command, oql, parameters); } - - #endregion - - #region 更新实体操作 - - /// + + #endregion + + #region 更新实体操作 + + /// /// 更新 /// - /// Command对象 + /// Command对象 /// 实体类对象 /// 影响的记录行数 - internal static int ExcuteUpdateCommand(SqlCommand cmd, Drugs drugs) - { - cmd.CommandText = "update Drugs set Name=@Name,HelpCode=@HelpCode,DrugKind=@DrugKind,Stand=@Stand,DosageUnit=@DosageUnit,Unit=@Unit,UseRate=@UseRate,IsValid=@IsValid,OperatorNo=@OperatorNo,OperatorName=@OperatorName,OperateDate=@OperateDate,Remark=@Remark,Channel=@Channel where Id=@Id"; - //从实体中取出值放入Command的参数列表 - cmd.Parameters.Add(new SqlParameter("@Name",drugs.Name==null?(object)DBNull.Value:(object)drugs.Name)); - cmd.Parameters.Add(new SqlParameter("@HelpCode",drugs.HelpCode==null?(object)DBNull.Value:(object)drugs.HelpCode)); - cmd.Parameters.Add(new SqlParameter("@DrugKind",drugs.DrugKind==null?(object)DBNull.Value:(object)drugs.DrugKind)); - cmd.Parameters.Add(new SqlParameter("@Stand",drugs.Stand==null?(object)DBNull.Value:(object)drugs.Stand)); - cmd.Parameters.Add(new SqlParameter("@DosageUnit",drugs.DosageUnit==null?(object)DBNull.Value:(object)drugs.DosageUnit)); - cmd.Parameters.Add(new SqlParameter("@Unit",drugs.Unit==null?(object)DBNull.Value:(object)drugs.Unit)); - cmd.Parameters.Add(new SqlParameter("@UseRate",drugs.UseRate.HasValue?(object)drugs.UseRate.Value:(object)DBNull.Value)); - cmd.Parameters.Add(new SqlParameter("@IsValid",drugs.IsValid.HasValue?(object)drugs.IsValid.Value:(object)DBNull.Value)); - cmd.Parameters.Add(new SqlParameter("@OperatorNo",drugs.OperatorNo==null?(object)DBNull.Value:(object)drugs.OperatorNo)); - cmd.Parameters.Add(new SqlParameter("@OperatorName",drugs.OperatorName==null?(object)DBNull.Value:(object)drugs.OperatorName)); - cmd.Parameters.Add(new SqlParameter("@OperateDate",drugs.OperateDate.HasValue?(object)drugs.OperateDate.Value:(object)DBNull.Value)); - cmd.Parameters.Add(new SqlParameter("@Remark", drugs.Remark == null ? (object)DBNull.Value : (object) drugs.Remark)); - cmd.Parameters.Add(new SqlParameter("@Channel", drugs.Channel == null ? (object)DBNull.Value : (object) drugs.Channel)); + internal static int ExcuteUpdateCommand(SqlCommand cmd, Drugs drugs) + { + cmd.CommandText = "update Drugs set Name=@Name,HelpCode=@HelpCode,DrugKind=@DrugKind,Stand=@Stand,DosageUnit=@DosageUnit,Unit=@Unit,UseRate=@UseRate,IsValid=@IsValid,OperatorNo=@OperatorNo,OperatorName=@OperatorName,OperateDate=@OperateDate,Remark=@Remark,Channel=@Channel where Id=@Id"; + //从实体中取出值放入Command的参数列表 + cmd.Parameters.Add(new SqlParameter("@Name", drugs.Name == null ? (object)DBNull.Value : (object)drugs.Name)); + cmd.Parameters.Add(new SqlParameter("@HelpCode", drugs.HelpCode == null ? (object)DBNull.Value : (object)drugs.HelpCode)); + cmd.Parameters.Add(new SqlParameter("@DrugKind", drugs.DrugKind == null ? (object)DBNull.Value : (object)drugs.DrugKind)); + cmd.Parameters.Add(new SqlParameter("@Stand", drugs.Stand == null ? (object)DBNull.Value : (object)drugs.Stand)); + cmd.Parameters.Add(new SqlParameter("@DosageUnit", drugs.DosageUnit == null ? (object)DBNull.Value : (object)drugs.DosageUnit)); + cmd.Parameters.Add(new SqlParameter("@Unit", drugs.Unit == null ? (object)DBNull.Value : (object)drugs.Unit)); + cmd.Parameters.Add(new SqlParameter("@UseRate", drugs.UseRate.HasValue ? (object)drugs.UseRate.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@IsValid", drugs.IsValid.HasValue ? (object)drugs.IsValid.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@OperatorNo", drugs.OperatorNo == null ? (object)DBNull.Value : (object)drugs.OperatorNo)); + cmd.Parameters.Add(new SqlParameter("@OperatorName", drugs.OperatorName == null ? (object)DBNull.Value : (object)drugs.OperatorName)); + cmd.Parameters.Add(new SqlParameter("@OperateDate", drugs.OperateDate.HasValue ? (object)drugs.OperateDate.Value : (object)DBNull.Value)); + cmd.Parameters.Add(new SqlParameter("@Remark", drugs.Remark == null ? (object)DBNull.Value : (object)drugs.Remark)); + cmd.Parameters.Add(new SqlParameter("@Channel", drugs.Channel == null ? (object)DBNull.Value : (object)drugs.Channel)); cmd.Parameters.Add(new SqlParameter("@Id", drugs.Id)); return cmd.ExecuteNonQuery(); } @@ -203,27 +203,27 @@ namespace AIMSDAL /// 实体类对象 /// 影响的记录行数 internal static int Update(Drugs drugs) - { - using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) - { - conn.Open(); + { + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) + { + conn.Open(); using (SqlCommand cmd = conn.CreateCommand()) { return ExcuteUpdateCommand(cmd, drugs); } - } - } - /// + } + } + /// /// 使用事务的更新方法 /// /// 实现共享Connection的对象 /// 实体类对象 /// 影响的记录行数 - internal static int Update(Connection connection,Drugs drugs) + internal static int Update(Connection connection, Drugs drugs) { return ExcuteUpdateCommand(connection.Command, drugs); - } - /// + } + /// /// 执行更新命令 /// /// Command对象 @@ -235,7 +235,7 @@ namespace AIMSDAL //解析过滤部份Sql语句 string updateString = SyntaxAnalyzer.ParseSql(oql, new DrugsMap()); cmd.CommandText = "update Drugs set " + updateString; - cmd.Parameters.Clear(); + cmd.Parameters.Clear(); //添加参数 if (parameters != null) { @@ -246,8 +246,8 @@ namespace AIMSDAL } return cmd.ExecuteNonQuery(); } - - /// + + /// /// 不使用事务的更新方法 /// /// 对象查询语句 @@ -264,8 +264,8 @@ namespace AIMSDAL } } } - - /// + + /// /// 使用事务的更新方法 /// /// 实现共享Connection的对象 @@ -276,17 +276,17 @@ namespace AIMSDAL { return ExcuteUpdateCommand(connection.Command, oql, parameters); } - #endregion - - #region 查询实体集合 - /// + #endregion + + #region 查询实体集合 + /// /// 执行Command获取对象列表 /// /// Command对象 - /// 递归类型 + /// 递归类型 /// 递归深度 /// 实体类对象列表 - internal static List ExcuteSelectCommand(SqlCommand cmd,RecursiveType recursiveType,int recursiveDepth) + internal static List ExcuteSelectCommand(SqlCommand cmd, RecursiveType recursiveType, int recursiveDepth) { List drugsList = new List(); using (SqlDataReader dr = cmd.ExecuteReader()) @@ -297,25 +297,25 @@ namespace AIMSDAL drugsList.Add(drugs); } } - return drugsList; + return drugsList; } - /// + /// /// 执行查询命令 /// /// Command对象 /// 对象查询语句 /// 参数列表 - /// 递归类型 + /// 递归类型 /// 递归深度 /// 实体类对象集合 - internal static List ExcuteSelectCommand(SqlCommand cmd, string oql, ParameterList parameters,RecursiveType recursiveType,int recursiveDepth) + internal static List ExcuteSelectCommand(SqlCommand cmd, string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) { //解析过滤部份Sql语句 string filterString = SyntaxAnalyzer.ParseSql(oql, new DrugsMap()); if (filterString != string.Empty) { - if(filterString.Trim().ToLower().IndexOf("order ")!=0) - filterString = " where " + filterString; + if (filterString.Trim().ToLower().IndexOf("order ") != 0) + filterString = " where " + filterString; } cmd.Parameters.Clear(); cmd.CommandText = "select * from Drugs " + filterString; @@ -329,14 +329,14 @@ namespace AIMSDAL } return ExcuteSelectCommand(cmd, recursiveType, recursiveDepth); } - - /// + + /// /// 根据对象查询语句查询实体集合 /// /// 实体类对象集合 internal static List Select() { - using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) { conn.Open(); using (SqlCommand cmd = conn.CreateCommand()) @@ -346,15 +346,15 @@ namespace AIMSDAL } } } - /// + /// /// 根据对象查询语句查询实体集合 /// - /// 递归类型 + /// 递归类型 /// 递归深度 /// 实体类对象集合 internal static List Select(RecursiveType recursiveType, int recursiveDepth) { - using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) { conn.Open(); using (SqlCommand cmd = conn.CreateCommand()) @@ -364,8 +364,8 @@ namespace AIMSDAL } } } - - /// + + /// /// 根据对象查询语句查询实体集合 /// /// 对象查询语句 @@ -373,7 +373,7 @@ namespace AIMSDAL /// 实体类对象集合 internal static List Select(string oql, ParameterList parameters) { - using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) { conn.Open(); using (SqlCommand cmd = conn.CreateCommand()) @@ -382,18 +382,18 @@ namespace AIMSDAL } } } - - /// + + /// /// 根据对象查询语句查询实体集合 /// /// 对象查询语句 /// 参数列表 - /// 递归类型 + /// 递归类型 /// 递归深度 /// 实体类对象集合 - internal static List Select(string oql, ParameterList parameters,RecursiveType recursiveType, int recursiveDepth) + internal static List Select(string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) { - using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) { conn.Open(); using (SqlCommand cmd = conn.CreateCommand()) @@ -402,62 +402,62 @@ namespace AIMSDAL } } } - - /// + + /// /// 根据对象查询语句查询实体集合(启用事务) /// /// 连接对象 /// 对象查询语句 /// 参数列表 - /// 递归类型 + /// 递归类型 /// 递归深度 /// 实体类对象集合 internal static List Select(Connection connection, string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) { - return ExcuteSelectCommand(connection.Command, oql, parameters,recursiveType, recursiveDepth); + return ExcuteSelectCommand(connection.Command, oql, parameters, recursiveType, recursiveDepth); } - #endregion - - #region 查询单个实体 - - /// + #endregion + + #region 查询单个实体 + + /// /// 递归查询单个实体 /// /// Command对象 - /// 递归类型 + /// 递归类型 /// 递归深度 /// 实体对象 - internal static Drugs ExcuteSelectSingleCommand(SqlCommand cmd,RecursiveType recursiveType,int recursiveDepth) - { - Drugs drugs=null; - using (SqlDataReader dr = cmd.ExecuteReader()) + internal static Drugs ExcuteSelectSingleCommand(SqlCommand cmd, RecursiveType recursiveType, int recursiveDepth) + { + Drugs drugs = null; + using (SqlDataReader dr = cmd.ExecuteReader()) { - if(dr.Read()) - drugs = DataReaderToEntity(dr); - } - if(drugs==null) - return drugs; + if (dr.Read()) + drugs = DataReaderToEntity(dr); + } + if (drugs == null) + return drugs; return drugs; - } - /// + } + /// /// 更据对象查询语句递归查询单个实体 /// /// Command对象 /// 对象查询语句 /// 参数列表 - /// 递归类型 + /// 递归类型 /// 递归深度 /// 实体对象 - internal static Drugs ExcuteSelectSingleCommand(SqlCommand cmd, string oql, ParameterList parameters,RecursiveType recursiveType,int recursiveDepth) + internal static Drugs ExcuteSelectSingleCommand(SqlCommand cmd, string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) { //解析过滤部份Sql语句 string filterString = SyntaxAnalyzer.ParseSql(oql, new DrugsMap()); - if(filterString!=string.Empty) - { - filterString=" where "+filterString; - } + if (filterString != string.Empty) + { + filterString = " where " + filterString; + } cmd.CommandText = "select * from Drugs " + filterString; - cmd.Parameters.Clear(); + cmd.Parameters.Clear(); //添加参数 if (parameters != null) { @@ -468,29 +468,29 @@ namespace AIMSDAL } return ExcuteSelectSingleCommand(cmd, recursiveType, recursiveDepth); } - - /// + + /// /// 更据对象查询语句递归查询单个实体 /// /// Command对象 /// 对象查询语句 /// 参数列表 - /// 递归类型 + /// 递归类型 /// 递归深度 /// 实体对象 internal static Drugs SelectSingle(string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth) { - using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) { conn.Open(); using (SqlCommand cmd = conn.CreateCommand()) { return ExcuteSelectSingleCommand(cmd, oql, parameters, recursiveType, recursiveDepth); - } - } + } + } } - - /// + + /// /// 更据对象查询语句查询单个实体 /// /// Command对象 @@ -499,10 +499,10 @@ namespace AIMSDAL /// 实体对象 internal static Drugs SelectSingle(string oql, ParameterList parameters) { - return SelectSingle(oql,parameters,RecursiveType.Parent,1); + return SelectSingle(oql, parameters, RecursiveType.Parent, 1); } - - /// + + /// /// 更据对象查询语句并启用事务查询单个实体 /// /// 连接对象 @@ -513,136 +513,144 @@ namespace AIMSDAL { return ExcuteSelectSingleCommand(connection.Command, oql, parameters, recursiveType, recursiveDepth); } - - /// + + /// /// 更据主键值递归查询单个实体 /// /// Command对象 /// 主键值 - /// 递归类型 + /// 递归类型 /// 递归深度 /// 实体对象 - internal static Drugs SelectSingle(SqlCommand cmd, int? id,RecursiveType recursiveType,int recursiveDepth) - { - cmd.Parameters.Clear(); - if(id.HasValue) - { - cmd.CommandText = "select * from Drugs where Id=@pk"; - cmd.Parameters.Add(new SqlParameter("@pk",id.Value)); - } - else - { - cmd.CommandText = "select * from Drugs where Id is null"; - } - return ExcuteSelectSingleCommand(cmd, recursiveType, recursiveDepth); - } - - /// + internal static Drugs SelectSingle(SqlCommand cmd, int? id, RecursiveType recursiveType, int recursiveDepth) + { + cmd.Parameters.Clear(); + if (id.HasValue) + { + cmd.CommandText = "select * from Drugs where Id=@pk"; + cmd.Parameters.Add(new SqlParameter("@pk", id.Value)); + } + else + { + cmd.CommandText = "select * from Drugs where Id is null"; + } + return ExcuteSelectSingleCommand(cmd, recursiveType, recursiveDepth); + } + + /// /// 按主键字段查询特定实体 /// /// 主键值 /// 实体类对象 internal static Drugs SelectSingle(int? id) { - using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) { conn.Open(); using (SqlCommand cmd = conn.CreateCommand()) { - return SelectSingle(cmd,id,RecursiveType.Parent,1); - } - } + return SelectSingle(cmd, id, RecursiveType.Parent, 1); + } + } } - /// + /// /// 按主键字段查询特定实体 /// /// 主键值 - /// 递归类型 + /// 递归类型 /// 递归深度 /// 实体类对象 internal static Drugs SelectSingle(int? id, RecursiveType recursiveType, int recursiveDepth) { - using(SqlConnection conn=new SqlConnection(Connection.ConnectionString)) + using (SqlConnection conn = new SqlConnection(Connection.ConnectionString)) { conn.Open(); using (SqlCommand cmd = conn.CreateCommand()) { - return SelectSingle(cmd,id, recursiveType, recursiveDepth); - } - } + return SelectSingle(cmd, id, recursiveType, recursiveDepth); + } + } } - - /// + + /// /// 使用事务并按主键字段查询特定实体 /// - /// 连接对象 + /// 连接对象 /// 主键值 /// 实体类对象 - internal static Drugs SelectSingle(Connection connection,int? id, RecursiveType recursiveType, int recursiveDepth) + internal static Drugs SelectSingle(Connection connection, int? id, RecursiveType recursiveType, int recursiveDepth) { - return SelectSingle(connection.Command, id, recursiveType, recursiveDepth); + return SelectSingle(connection.Command, id, recursiveType, recursiveDepth); } - #endregion - - - /// + #endregion + + + /// /// 从DataReader中取出值生成实体对象 /// /// 查询对象 /// 过滤条件字符串 - private static Drugs DataReaderToEntity(SqlDataReader dr) - { - Drugs entity = new Drugs (); - if(dr["Id"]!=System.DBNull.Value) - { - entity.Id=Convert.ToInt32(dr["Id"]); - } - if(dr["Name"]!=System.DBNull.Value) - { - entity.Name=dr["Name"].ToString(); - } - if(dr["HelpCode"]!=System.DBNull.Value) - { - entity.HelpCode=dr["HelpCode"].ToString(); - } - if(dr["DrugKind"]!=System.DBNull.Value) - { - entity.DrugKind=dr["DrugKind"].ToString(); - } - if(dr["Stand"]!=System.DBNull.Value) - { - entity.Stand=dr["Stand"].ToString(); - } - if(dr["DosageUnit"]!=System.DBNull.Value) - { - entity.DosageUnit=dr["DosageUnit"].ToString(); - } - if(dr["Unit"]!=System.DBNull.Value) - { - entity.Unit=dr["Unit"].ToString(); - } - if(dr["UseRate"]!=System.DBNull.Value) - { - entity.UseRate=Convert.ToInt32(dr["UseRate"]); - } - if(dr["IsValid"]!=System.DBNull.Value) - { - entity.IsValid=Convert.ToInt32(dr["IsValid"]); - } - if(dr["OperatorNo"]!=System.DBNull.Value) - { - entity.OperatorNo=dr["OperatorNo"].ToString(); - } - if(dr["OperatorName"]!=System.DBNull.Value) - { - entity.OperatorName=dr["OperatorName"].ToString(); - } - if(dr["OperateDate"]!=System.DBNull.Value) - { - entity.OperateDate=Convert.ToDateTime(dr["OperateDate"]); - } - return entity; - } - } + private static Drugs DataReaderToEntity(SqlDataReader dr) + { + Drugs entity = new Drugs(); + if (dr["Id"] != System.DBNull.Value) + { + entity.Id = Convert.ToInt32(dr["Id"]); + } + if (dr["Name"] != System.DBNull.Value) + { + entity.Name = dr["Name"].ToString(); + } + if (dr["HelpCode"] != System.DBNull.Value) + { + entity.HelpCode = dr["HelpCode"].ToString(); + } + if (dr["DrugKind"] != System.DBNull.Value) + { + entity.DrugKind = dr["DrugKind"].ToString(); + } + if (dr["Stand"] != System.DBNull.Value) + { + entity.Stand = dr["Stand"].ToString(); + } + if (dr["DosageUnit"] != System.DBNull.Value) + { + entity.DosageUnit = dr["DosageUnit"].ToString(); + } + if (dr["Unit"] != System.DBNull.Value) + { + entity.Unit = dr["Unit"].ToString(); + } + if (dr["UseRate"] != System.DBNull.Value) + { + entity.UseRate = Convert.ToInt32(dr["UseRate"]); + } + if (dr["IsValid"] != System.DBNull.Value) + { + entity.IsValid = Convert.ToInt32(dr["IsValid"]); + } + if (dr["OperatorNo"] != System.DBNull.Value) + { + entity.OperatorNo = dr["OperatorNo"].ToString(); + } + if (dr["OperatorName"] != System.DBNull.Value) + { + entity.OperatorName = dr["OperatorName"].ToString(); + } + if (dr["OperateDate"] != System.DBNull.Value) + { + entity.OperateDate = Convert.ToDateTime(dr["OperateDate"]); + } + if (dr["Remark"] != System.DBNull.Value) + { + entity.Remark = dr["Remark"].ToString(); + } + if (dr["Channel"] != System.DBNull.Value) + { + entity.Channel = dr["Channel"].ToString(); + } + return entity; + } + } } diff --git a/AIMSEntity/DAL/Extension/DApplyAnaesthesiaMethod.cs b/AIMSEntity/DAL/Extension/DApplyAnaesthesiaMethod.cs index 282f997..7b3c973 100644 --- a/AIMSEntity/DAL/Extension/DApplyAnaesthesiaMethod.cs +++ b/AIMSEntity/DAL/Extension/DApplyAnaesthesiaMethod.cs @@ -49,5 +49,22 @@ namespace AIMSDAL } return ApplyAnaesthesiaMethodIdList; } + public static string GetApplyAnaesthesiaMethod(int OperationApplyId) + { + string ApplyAnaesthesiaMethodIdList = ""; + StringBuilder sb = new StringBuilder(); + string strSql = "SELECT AnaesthesiaMethodId FROM ApplyAnaesthesiaMethod WHERE OperationApplyId='" + OperationApplyId + "'"; + + DataTable dt = HelperDB.DbHelperSQL.GetDataTable(strSql.ToString()); + for (int i = 0; i < dt.Rows.Count; i++) + { + sb.Append(dt.Rows[i]["AnaesthesiaMethodId"].ToString() + ","); + } + if (sb.ToString().Length > 1) + { + ApplyAnaesthesiaMethodIdList = sb.ToString().Substring(0, sb.ToString().Length - 1); + } + return ApplyAnaesthesiaMethodIdList; + } } } diff --git a/AIMSEntity/DAL/Extension/DOperationRecord.cs b/AIMSEntity/DAL/Extension/DOperationRecord.cs index 2c57aff..41b81cd 100644 --- a/AIMSEntity/DAL/Extension/DOperationRecord.cs +++ b/AIMSEntity/DAL/Extension/DOperationRecord.cs @@ -1,7 +1,9 @@ -using AIMSModel; +using AIMSBLL; +using AIMSModel; using AIMSObjectQuery; using DrawGraph; using System; +using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Text; @@ -12,13 +14,14 @@ namespace AIMSDAL { public static int AddTitleTime(int PatientId, int ApplyId, int RecoverId, int State, DateTime Time, int RoomId) { - string strSql = "INSERT INTO OperationRecord(PatientId,OperationApplyId,RecoverId,[State],InRoomTime,OperatorNo,OperatorName,OperateDate,RoomId)" + + string ApplyAnaesthesiaMethod = BApplyAnaesthesiaMethod.GetApplyAnaesthesiaMethod(ApplyId); + string strSql = "INSERT INTO OperationRecord(PatientId,OperationApplyId,RecoverId,[State],InRoomTime,OperatorNo,OperatorName,OperateDate,RoomId,AnaesthesiaMethodName)" + "VALUES (" + PatientId + "," + ApplyId + "," + RecoverId + ",'" + State + "','" + Time + "','" + AIMSExtension.PublicMethod.OperatorNo + "','" - + AIMSExtension.PublicMethod.OperatorName + "','" + AIMSExtension.PublicMethod.SystemDate() + "','" + RoomId + "');select @@identity "; + + AIMSExtension.PublicMethod.OperatorName + "','" + AIMSExtension.PublicMethod.SystemDate() + "','" + RoomId + "','" + ApplyAnaesthesiaMethod + "');select @@identity "; return Convert.ToInt32(HelperDB.DbHelperSQL.ExecNonQuery(strSql)); - ; + } - + public static DataTable GetOperationDoingMainInfo(int PatientId, int TypeId) { string strSql = "SELECT od.Id,od.PatientId, od.ApplyId, InRoomTime, OutRoomTime, OperationBeginTime, OperationEndTime, " + @@ -42,7 +45,7 @@ namespace AIMSDAL { string strSql = "UPDATE OperationRecord SET " + (State == 1 ? " OutRoomTime=null, " : "") + " [State] = " + State + ",Remark3 = '" + Text + - "',OperatorNo = '" + AIMSExtension.PublicMethod.OperatorNo + + "',OperatorNo = '" + AIMSExtension.PublicMethod.OperatorNo + "',OperatorName = '" + AIMSExtension.PublicMethod.OperatorName + "',OperateDate = '" + AIMSExtension.PublicMethod.SystemDate() + "' WHERE PatientId=" + PatientId + " and RecoverId='" + TypeId + "'"; @@ -68,15 +71,15 @@ namespace AIMSDAL HelperDB.DbHelperSQL.ExecNonQuery("DELETE FROM ApplianceRecord WHERE OperationRecordId =" + RecorId); HelperDB.DbHelperSQL.ExecNonQuery("DELETE FROM OperationRecord WHERE id=" + RecorId); } - public static void DeleteOperationRecorvreData(int RecorId,int PatientId, int TypeId) + public static void DeleteOperationRecorvreData(int RecorId, int PatientId, int TypeId) { HelperDB.DbHelperSQL.ExecNonQuery("DELETE FROM FactDrug WHERE DrugTypeId=" + TypeId + " and PatientId=" + PatientId + ""); HelperDB.DbHelperSQL.ExecNonQuery("DELETE FROM FactEvents WHERE EventTypeId=" + TypeId + " and PatientId=" + PatientId + ""); HelperDB.DbHelperSQL.ExecNonQuery("DELETE FROM FactOutputLiquids WHERE OutputLiquidsTypeId=" + TypeId + " and PatientId=" + PatientId + ""); HelperDB.DbHelperSQL.ExecNonQuery("DELETE FROM FactPersonDuty WHERE PatientId=" + PatientId + " and PersonDutyId=" + TypeId + ""); HelperDB.DbHelperSQL.ExecNonQuery("DELETE FROM OperationRecoverInInfo WHERE OperationRecordId =" + RecorId); - HelperDB.DbHelperSQL.ExecNonQuery("DELETE FROM OperationRecoverOutInfo WHERE OperationRecordId =" + RecorId); - HelperDB.DbHelperSQL.ExecNonQuery("DELETE FROM OperationRecord WHERE Id=" + RecorId + ""); + HelperDB.DbHelperSQL.ExecNonQuery("DELETE FROM OperationRecoverOutInfo WHERE OperationRecordId =" + RecorId); + HelperDB.DbHelperSQL.ExecNonQuery("DELETE FROM OperationRecord WHERE Id=" + RecorId + ""); } public static void DeleteEvent(int PatientId, int EventId) { @@ -267,7 +270,7 @@ namespace AIMSDAL } if (dr["SpileInTime"] != System.DBNull.Value) { - entity.SpileInTime = Convert.ToDateTime(dr["SpileInTime"]); + entity.SpileInTime = Convert.ToDateTime(dr["SpileInTime"]); } if (dr["SpileOutTime"] != System.DBNull.Value) { diff --git a/AIMSEntity/Extensions/BOperationReview.cs b/AIMSEntity/Extensions/BOperationReview.cs index fff2864..11c7658 100644 --- a/AIMSEntity/Extensions/BOperationReview.cs +++ b/AIMSEntity/Extensions/BOperationReview.cs @@ -3,6 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; +using System.Xml; +using AIMSModel; +using HelperDB; + namespace AIMSBLL { public class BOperationReview @@ -40,5 +44,76 @@ namespace AIMSBLL } + /// + /// 根据模板名称查询文档 + /// + /// 模板名称 + /// 患者Id + /// + public static PrintDocument GetDocumentbyName(string tempName, int patientId) + { + PrintDocument model = new PrintDocument(); + string result = string.Empty; + try + { + StringBuilder sb = new StringBuilder(); + sb.Append("select "); + sb.Append(" pd.Id,"); + sb.Append(" pd.PatientId,"); + sb.Append(" pd.TemplateId,"); + sb.Append(" pd.XmlFileName,"); + sb.Append(" pd.XmlFile,"); + sb.Append(" pd.XmlStatic,"); + sb.Append(" pd.IsValid,"); + sb.Append(" pd.OperatorNo,"); + sb.Append(" pd.OperatorDate"); + sb.Append(" from PrintDocument pd"); + sb.Append(" where "); + sb.Append(" pd.PatientId = " + patientId); + sb.Append(" and pd.XmlFileName = '" + tempName + "'"); + sb.Append(" and pd.IsValid = 1"); + DataTable dt = DbHelperSQL.GetDataTable(sb.ToString()); + if (dt.Rows.Count > 0) + { + model.Id = int.Parse(dt.Rows[0]["Id"].ToString()); + model.PatientId = int.Parse(dt.Rows[0]["PatientId"].ToString()); + model.TemplateId = int.Parse(dt.Rows[0]["TemplateId"].ToString()); + model.XmlFileName = dt.Rows[0]["XmlFileName"].ToString(); + model.XmlFile = dt.Rows[0]["XmlFile"].ToString(); + model.XmlStatic = dt.Rows[0]["XmlStatic"].ToString(); + model.OperatorNo = dt.Rows[0]["OperatorNo"].ToString(); + } + } + catch (Exception ex) + { + throw ex; + } + return model; + } + public static XmlDocument GetPrintDocumentXml(string tempName, int patientId) + { + PrintDocument model = GetDocumentbyName(tempName, patientId); + XmlDocument doc = new XmlDocument(); + if (model.XmlStatic != null && model.XmlStatic.Length > 0) + { + doc.LoadXml(model.XmlStatic); + } + return doc; + } + public static string GetDocumentXmlStatic(string tempName, int patientId, string dictName) + { + string Value = ""; + XmlDocument doc = GetPrintDocumentXml(tempName, patientId); + XmlElement root = doc.DocumentElement; + if (root != null) + { + foreach (XmlNode row in root.ChildNodes) + { + if (row.Attributes["Name"].InnerText == dictName) + Value = row.InnerText.Trim();//测试方法 + } + } + return Value; + } } } diff --git a/AIMSEntity/Extensions/SelectPatient.cs b/AIMSEntity/Extensions/SelectPatient.cs index 6da055a..5336dd1 100644 --- a/AIMSEntity/Extensions/SelectPatient.cs +++ b/AIMSEntity/Extensions/SelectPatient.cs @@ -112,19 +112,19 @@ namespace AIMSBLL FactOperationInfoObj.OperateDate = AIMSExtension.PublicMethod.SystemDate(); BFactOperationInfo.Add(FactOperationInfoObj); } - //实施麻醉 - List ApplyAnaesthesiaMethodList = BApplyAnaesthesiaMethod.GetApplyAnaesthesiaMethodList(ApplyId); - for (int i = 0; i < ApplyAnaesthesiaMethodList.Count; i++) - { - FactAnaesthesiaMethod FactAnaesthesiaMethodObj = new FactAnaesthesiaMethod(); - FactAnaesthesiaMethodObj.PatientId = PatientId; - FactAnaesthesiaMethodObj.ApplyId = ApplyId; - FactAnaesthesiaMethodObj.AnaesthesiaMethodId = ApplyAnaesthesiaMethodList[i]; - FactAnaesthesiaMethodObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo; - FactAnaesthesiaMethodObj.OperatorName = AIMSExtension.PublicMethod.OperatorName; - FactAnaesthesiaMethodObj.OperateDate = AIMSExtension.PublicMethod.SystemDate(); - BFactAnaesthesiaMethod.Add(FactAnaesthesiaMethodObj); - } + ////实施麻醉 + //List ApplyAnaesthesiaMethodList = BApplyAnaesthesiaMethod.GetApplyAnaesthesiaMethodList(ApplyId); + //for (int i = 0; i < ApplyAnaesthesiaMethodList.Count; i++) + //{ + // FactAnaesthesiaMethod FactAnaesthesiaMethodObj = new FactAnaesthesiaMethod(); + // FactAnaesthesiaMethodObj.PatientId = PatientId; + // FactAnaesthesiaMethodObj.ApplyId = ApplyId; + // FactAnaesthesiaMethodObj.AnaesthesiaMethodId = ApplyAnaesthesiaMethodList[i]; + // FactAnaesthesiaMethodObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo; + // FactAnaesthesiaMethodObj.OperatorName = AIMSExtension.PublicMethod.OperatorName; + // FactAnaesthesiaMethodObj.OperateDate = AIMSExtension.PublicMethod.SystemDate(); + // BFactAnaesthesiaMethod.Add(FactAnaesthesiaMethodObj); + //} //手术部位 List ApplyOperationPositionList = BApplyOperationPosition.GetApplyOperationPositionIdList(ApplyId); diff --git a/AIMSEntity/Extensions/TitleTime.cs b/AIMSEntity/Extensions/TitleTime.cs deleted file mode 100644 index 2d5c3b8..0000000 --- a/AIMSEntity/Extensions/TitleTime.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace AIMSModel -{ - public class TitleTime - { - public int OperationApplyId; - private DateTime? _inroomtime; - private DateTime? _outroomtime; - private DateTime? _operationbegintime; - private DateTime? _operationendtime; - private DateTime? _anesthesiabegintime; - private DateTime? _anesthesiaendtime; - private DateTime? _spiletime; - private DateTime? _extubationtime; - - public DateTime? InRoomTime - { - set { _inroomtime = value; } - get { return _inroomtime; } - } - /// - /// - /// - public DateTime? OutRoomTime - { - set { _outroomtime = value; } - get { return _outroomtime; } - } - /// - /// - /// - public DateTime? OperationBeginTime - { - set { _operationbegintime = value; } - get { return _operationbegintime; } - } - /// - /// - /// - public DateTime? OperationEndTime - { - set { _operationendtime = value; } - get { return _operationendtime; } - } - /// - /// - /// - public DateTime? AnesthesiaBeginTime - { - set { _anesthesiabegintime = value; } - get { return _anesthesiabegintime; } - } - /// - /// - /// - public DateTime? AnesthesiaEndTime - { - set { _anesthesiaendtime = value; } - get { return _anesthesiaendtime; } - } - /// - /// - /// - public DateTime? SpileTime - { - set { _spiletime = value; } - get { return _spiletime; } - } - /// - /// - /// - public DateTime? ExtubationTime - { - set { _extubationtime = value; } - get { return _extubationtime; } - } - - } -} diff --git a/DocumentManagement/DocumentEntity/DocumentDAL.cs b/DocumentManagement/DocumentEntity/DocumentDAL.cs index 4109084..8c42f9a 100644 --- a/DocumentManagement/DocumentEntity/DocumentDAL.cs +++ b/DocumentManagement/DocumentEntity/DocumentDAL.cs @@ -6,6 +6,7 @@ using System.Data; using HelperDB; using DCSoft.Writer.Data; using System.Threading.Tasks; +using System.Xml; namespace DocumentManagement { @@ -29,7 +30,7 @@ namespace DocumentManagement static DocumentDAL() { LoadKBLibaray(); - } + } //public static string OperatorNo = ""; @@ -600,6 +601,7 @@ namespace DocumentManagement return model; } + public static void InsertTemplate(PrintTemplate model) { try @@ -795,7 +797,7 @@ namespace DocumentManagement StringBuilder strSql = new StringBuilder(); strSql.Append(" select *"); strSql.Append(" from V_LisResult where"); - strSql.Append(" PATIENT_ID = '" + patientNo + "'"); + strSql.Append(" PATIENT_ID = '" + patientNo + "'"); return DbHelperSQL.GetDataTable(strSql.ToString()); } catch (Exception ex) @@ -809,7 +811,7 @@ namespace DocumentManagement { StringBuilder strSql = new StringBuilder(); strSql.Append(" select LIS_ITEM_CODE,LIS_ITEM_CODEName,UpdateTime from LisResult where"); - strSql.Append(" PATIENT_ID = '" + patientNo + "' group by LIS_ITEM_CODE,LIS_ITEM_CODEName,UpdateTime "); + strSql.Append(" PATIENT_ID = '" + patientNo + "' group by LIS_ITEM_CODE,LIS_ITEM_CODEName,UpdateTime "); return DbHelperSQL.GetDataTable(strSql.ToString()); } catch (Exception ex) @@ -817,13 +819,13 @@ namespace DocumentManagement throw ex; } } - public static DataTable GetLisResultItems(string patientNo,string LIS_ITEM_CODE) + public static DataTable GetLisResultItems(string patientNo, string LIS_ITEM_CODE) { try { StringBuilder strSql = new StringBuilder(); strSql.Append(" select * from LisResult where"); - strSql.Append(" PATIENT_ID = '" + patientNo + "' and LIS_ITEM_CODE= '" +LIS_ITEM_CODE + "' "); + strSql.Append(" PATIENT_ID = '" + patientNo + "' and LIS_ITEM_CODE= '" + LIS_ITEM_CODE + "' "); return DbHelperSQL.GetDataTable(strSql.ToString()); } catch (Exception ex) diff --git a/DrawGraph/AreaManage/DrugsManage.cs b/DrawGraph/AreaManage/DrugsManage.cs index 45a7cea..f7967ec 100644 --- a/DrawGraph/AreaManage/DrugsManage.cs +++ b/DrawGraph/AreaManage/DrugsManage.cs @@ -146,7 +146,7 @@ namespace DrawGraph } if (item.GiveDrugType == "术后镇痛药") { - myOpeRecord.AfterDrugsListstr.Add(string.Format("({0}){1} {2} {3}{4}{5}", x + 1, (item.DrugBeginTime == item.DrugEndTime) ? item.DrugBeginTime.ToShortTimeString() : item.DrugBeginTime.ToShortTimeString() + "->" + item.DrugEndTime.ToShortTimeString(), item.DrugName.Trim(), dose, "", item.DrugChannel == null ? "" : " " + item.DrugChannel.ToString())); + myOpeRecord.AfterDrugsListstr.Add(string.Format("({0}){1} {2} {3}{4}{5}", x + 1, "", item.DrugName.Trim(), dose, "", item.DrugChannel == null ? "" : " " + item.DrugChannel.ToString())); myOpeRecord.AnalgesiaDrug += string.Format("{0}{1} ", item.DrugName.Trim(), dose); x++; } diff --git a/DrawGraph/AreaManage/IconManage.cs b/DrawGraph/AreaManage/IconManage.cs index 519d484..771ec6e 100644 --- a/DrawGraph/AreaManage/IconManage.cs +++ b/DrawGraph/AreaManage/IconManage.cs @@ -126,7 +126,8 @@ namespace DrawGraph List eventListstr = new List(); eventListstr.Add("【事件】"); //myOpeRecord.FactEventsList.Sort(new FactEventsComparer()); - //List eventlist = xmlOpe.GetNode(EVENTPARAMPATH, "name"); + //List eventlist = + //.GetNode(EVENTPARAMPATH, "name"); //循环加药集体 for (int i = 0; i < myOpeRecord.FactEventsList.Count; i++) { diff --git a/DrawGraph/AreaManage/TemplateManage.cs b/DrawGraph/AreaManage/TemplateManage.cs index 2ca605d..862e1da 100644 --- a/DrawGraph/AreaManage/TemplateManage.cs +++ b/DrawGraph/AreaManage/TemplateManage.cs @@ -898,15 +898,15 @@ namespace DrawGraph int czpyl = 0; int hzpyl = 0; int dfzpyl = 0; - try - { - czpyl = int.Parse(xmlOpe.GetNode("czpyl")[0].ToString()); - hzpyl = int.Parse(xmlOpe.GetNode("hzpyl")[0].ToString()); - //dfzpyl = int.Parse(xmlOpe.GetNode("dfzpyl")[0].ToString()); - } - catch (Exception) - { - } + //try + //{ + // czpyl = int.Parse(xmlOpe.GetNode("czpyl")[0].ToString()); + // hzpyl = int.Parse(xmlOpe.GetNode("hzpyl")[0].ToString()); + // //dfzpyl = int.Parse(xmlOpe.GetNode("dfzpyl")[0].ToString()); + //} + //catch (Exception) + //{ + //} Zjpyl = Zjpyl + LocationY + czpyl; Hzjpyl = hzpyl; Dfzjpyl = dfzpyl;