人员检索第二次报错 保存后重置控件

删除出室时间以后的数据
事件机控呼吸控制
This commit is contained in:
leomon 2023-05-15 18:10:25 +08:00
parent 8fa93ff14b
commit 7ff33d156b
12 changed files with 658 additions and 463 deletions

View File

@ -86,7 +86,7 @@ namespace AIMS.OperationAanesthesia
btnChage.Visible = true;
}
//this.MaximizeBox = false;
this.MinimizeBox = false;
//this.MinimizeBox = false;
LoadAnesRescue();
}
@ -436,13 +436,13 @@ namespace AIMS.OperationAanesthesia
{
if (PatientId == 0) return;
DateTimeInput tb = sender as DateTimeInput;
if (_record != null && _record.OutRoomTime != null)
{
if ((tb.Name == "txtBG" || tb.Name == "txtCG") && tb.Text.Trim() == "")
{
return;
}
}
//if (_record != null && _record.OutRoomTime != null)
//{
// if ((tb.Name == "txtBG" || tb.Name == "txtCG") && tb.Text.Trim() == "")
// {
// return;
// }
//}
if (tb.Text.Trim() == "" && tb.CustomFormat == " ")
{
@ -616,7 +616,7 @@ namespace AIMS.OperationAanesthesia
{
DrawGraph.FactEvents Inevent = null;
DateTimeInput tb = obj as DateTimeInput;
if (_record.StateName == "手术中")
if (_record.StateName == "手术中" || tb.Name.Equals("txtCG") || tb.Name.Equals("txtBG"))
{
DeleteEventTime("txtAnaesthesiaBegin", "麻醉开始", tb, ref Inevent);
DeleteEventTime("txtOperationBegin", "手术开始", tb, ref Inevent);
@ -753,10 +753,18 @@ namespace AIMS.OperationAanesthesia
{
curTimeTemp = _record.lastPageBegin;
}
if (state != 1)
if (state == 0)
{
Inevent = BFactEvents.Insert(PatientId, EventName, curTimeTemp, curTimeTemp, RecoverId);
}
else if (state == 2)
{
string eventName = "";
if (EventName == "插管" || EventName == "喉罩") eventName = "'3','9'";
if (EventName == "拔管" || EventName == "拔喉罩") eventName = "'4','10'";
BFactEvents.Delete(" EventId in (" + eventName + ") and PatientId=" + PatientId, null);
Inevent = BFactEvents.Insert(PatientId, EventName, curTimeTemp, curTimeTemp, RecoverId);
}
else
{
updateEventTime(EventName, curTimeTemp, ref Inevent);
@ -1004,7 +1012,7 @@ namespace AIMS.OperationAanesthesia
zgcAnaesRecord.Visible = false;
timerLoadAnesRescue = new System.Windows.Forms.Timer(components);
timerLoadAnesRescue.Enabled = true;//调试时设置为FALSE
timerLoadAnesRescue.Interval = 300;
timerLoadAnesRescue.Interval = 200;
timerLoadAnesRescue.Tick -= TimerLoadAnesRescue_Tick;
timerLoadAnesRescue.Tick += TimerLoadAnesRescue_Tick;
timerLoadAnesRescue.Start();
@ -1059,6 +1067,7 @@ namespace AIMS.OperationAanesthesia
btnCancelOperation.Enabled = false;
btnCancelIn.Enabled = false;
LastMonitorDataTime = null;
LastAnesMonitorDataTime = null;
ClearTimeText();
if (templateManage != null)
{
@ -1351,6 +1360,7 @@ namespace AIMS.OperationAanesthesia
#region
public DateTime? LastMonitorDataTime = null;
public DateTime? LastAnesMonitorDataTime = null;
private void timerGetCollectorData_Tick()
{
if (State == AIMSExtension.EditState.BROWSE || _record.StateName != "手术中" || NowRoom == null || isReadOnly == true) return;
@ -1392,6 +1402,31 @@ namespace AIMS.OperationAanesthesia
}
}
if (LastAnesMonitorDataTime == null || dtTime > LastAnesMonitorDataTime.Value.AddMinutes(9))
{
foreach (PhysioDataConfig addPP in _record.PhysioAnesConfigList)
{
string key = addPP.Name;
string value = addPP.Enname;
if (addPP.IsValid == false) continue;
if (value == null || value == "") continue;
if (_record.AnesthesiaBeginTime != null && InsertTime < _record.AnesthesiaBeginTime) continue;
LastAnesMonitorDataTime = dtTime;
int minMinutes = -5;
DataTable dtPhysioData = BOperationRecord.getPhysioDataByTimeName(NowRoom.Ip, value, InsertTime.AddMinutes(minMinutes), InsertTime.AddSeconds(1));
if (dtPhysioData != null && dtPhysioData.Rows.Count > 0)
{
foreach (DataRow dr in dtPhysioData.Rows)
{
PhysioData pdTemp = PhysioDataConfig.newPhysioData(addPP, _record.Id.Value, dtTime, dr["ParamValue"].ToString());
physioDatas.Add(pdTemp);
continue;
}
}
}
}
//有有创清空无创
foreach (var pdTemp in physioDatas)
{
@ -1420,10 +1455,17 @@ namespace AIMS.OperationAanesthesia
foreach (var pdTemp in physioDatas)
{
if (pdTemp.Value < 0) continue;
PhysioDataConfig addPP = _record.PhysioConfigList.Where(a => pdTemp.PhysioDataConfigId == a.Id).ToList()[0];
addPP.AddPointItem(pdTemp);
List<PhysioDataConfig> addPP = _record.PhysioConfigList.Where(a => pdTemp.PhysioDataConfigId == a.Id).ToList();
if (addPP == null || addPP.Count == 0)
{
addPP = _record.PhysioAnesConfigList.Where(a => pdTemp.PhysioDataConfigId == a.Id).ToList();
}
if (addPP != null && addPP.Count > 0)
{
addPP[0].AddPointItem(pdTemp);
date++;
}
}
if (dtTime > _record.lastPageBegin && ((TimeSpan)(dtTime - _record.lastPageBegin)).TotalHours < 24 && date > 0)
{
@ -1596,6 +1638,7 @@ namespace AIMS.OperationAanesthesia
if (timerGetTextCollectorData != null)
{
LastMonitorDataTime = null;
LastAnesMonitorDataTime = null;
timerGetTextCollectorData.Enabled = false;
timerGetTextCollectorData.Stop();
}
@ -1766,53 +1809,52 @@ namespace AIMS.OperationAanesthesia
if (dr["ParameterName"] != null && dr["ParameterName"].ToString() != "" && dr["ParameterName"].ToString().Equals(addPP.Id.ToString()))
{
DateTime RecordTime = DateTime.Parse(dr["InsertTime"].ToString());
if (RecordTime < _record.InRoomTime) continue;
if (!isCgtime(addPP.Name, RecordTime)) continue;
PhysioData pdTemp = PhysioDataConfig.newPhysioData(addPP, _record.Id.Value, RecordTime, dr["ParamValue"].ToString());
addPP.AddPointItem(pdTemp);
}
}
}
//foreach (var addPP in _record.PhysioAnesConfigList)
//{
// if (addPP.IsValid == false) continue;
// foreach (DataRow dr in dtPhysioData.Rows)
// {
// if (dr["ParameterName"] != null && dr["ParameterName"].ToString() != "" && dr["ParameterName"].ToString().Equals(addPP.Id.ToString()))
// {
// DateTime RecordTime = DateTime.Parse(dr["InsertTime"].ToString());
// PhysioData pdTemp = PhysioDataConfig.newPhysioData(addPP, _record.Id.Value, RecordTime, dr["ParamValue"].ToString());
// addPP.AddPointItem(pdTemp);
// }
// }
//}
foreach (var addPP in _record.PhysioAnesConfigList)
{
if (addPP.IsValid == false) continue;
foreach (DataRow dr in dtPhysioData.Rows)
{
if (dr["ParameterName"] != null && dr["ParameterName"].ToString() != "" && dr["ParameterName"].ToString().Equals(addPP.Id.ToString()))
{
DateTime RecordTime = DateTime.Parse(dr["InsertTime"].ToString());
if (RecordTime < _record.InRoomTime) continue;
PhysioData pdTemp = PhysioDataConfig.newPhysioData(addPP, _record.Id.Value, RecordTime, dr["ParamValue"].ToString());
addPP.AddPointItem(pdTemp);
}
}
}
}
}
private void UpdatePhysioDataResp()
{
BOperationRecord.UpdatePhysioDataRespByTime(_record);
//获取机控呼吸时间范围 值
//机控时间范围点重置 开始到结束删除+画点
//string PhysioDataConfigIds = "3,12";
//DataTable dtPhysioData = BOperationRecord.getByOpeIDIsPhysioData(_record.Id.Value, PhysioDataConfigIds);
//List<string> Ids = PhysioDataConfigIds.Split(',').ToList();
//if (dtPhysioData != null && dtPhysioData.Rows.Count > 0)
//{
// foreach (PhysioDataConfig addPP in _record.PhysioConfigList)
// {
// if (!Ids.Contains(addPP.Id.ToString())) continue;
// addPP.clearAddObj(zgcAnaesRecord);
// if (addPP.IsDefalultShow == false) continue;
// for (int i = 0; i < dtPhysioData.Rows.Count; i++)
// {
// if (dtPhysioData.Rows[i]["Name"].ToString().Equals(addPP.Name.ToString()))
// {
// PhysioData pdTemp = PhysioDataConfig.newPhysioData(addPP, _record.Id.Value, DateTime.Parse(dtPhysioData.Rows[i]["RecordTime"].ToString()), dtPhysioData.Rows[i]["Value"].ToString());
// addPP.AddPointItem(pdTemp, false);
// }
// }
// }
//}
string PhysioDataConfigIds = "3,12";
DataTable dtPhysioData = BOperationRecord.getByOpeIDIsPhysioData(_record.Id.Value, PhysioDataConfigIds);
List<string> Ids = PhysioDataConfigIds.Split(',').ToList();
if (dtPhysioData != null && dtPhysioData.Rows.Count > 0)
{
foreach (PhysioDataConfig addPP in _record.PhysioConfigList)
{
if (!Ids.Contains(addPP.Id.ToString())) continue;
addPP.clearAddObj(zgcAnaesRecord);
if (addPP.IsDefalultShow == false) continue;
for (int i = 0; i < dtPhysioData.Rows.Count; i++)
{
if (dtPhysioData.Rows[i]["Name"].ToString().Equals(addPP.Name.ToString()))
{
PhysioData pdTemp = PhysioDataConfig.newPhysioData(addPP, _record.Id.Value, DateTime.Parse(dtPhysioData.Rows[i]["RecordTime"].ToString()), dtPhysioData.Rows[i]["Value"].ToString());
addPP.AddPointItem(pdTemp, false);
}
}
}
}
}
private void clearSelectCouve_Click(Object sender, EventArgs e)
@ -1899,6 +1941,7 @@ namespace AIMS.OperationAanesthesia
}
if (_record.SpileInTime != null)
{
this.cmbCGType.SelectedIndexChanged -= new System.EventHandler(this.cmbCGType_SelectedIndexChanged);
cmbCGType.Text = _record.InCGType;
txtCG.CustomFormat = "MM-dd HH:mm";
txtCG.Tag = _record.SpileInTime.Value;

View File

@ -1932,6 +1932,7 @@ namespace AIMS.OperationAanesthesia
if (dr["ParameterName"] != null && dr["ParameterName"].ToString() != "" && dr["ParameterName"].ToString().Equals(addPP.Id.ToString()))
{
DateTime RecordTime = DateTime.Parse(dr["InsertTime"].ToString());
if (RecordTime < _record.InRoomTime) continue;
if (!isCgtime(addPP.Name, RecordTime)) continue;
PhysioData pdTemp = PhysioDataConfig.newPhysioData(addPP, _record.Id.Value, RecordTime, dr["ParamValue"].ToString());
addPP.AddPointItem(pdTemp);
@ -1946,6 +1947,7 @@ namespace AIMS.OperationAanesthesia
if (dr["ParameterName"] != null && dr["ParameterName"].ToString() != "" && dr["ParameterName"].ToString().Equals(addPP.Id.ToString()))
{
DateTime RecordTime = DateTime.Parse(dr["InsertTime"].ToString());
if (RecordTime < _record.InRoomTime) continue;
PhysioData pdTemp = PhysioDataConfig.newPhysioData(addPP, _record.Id.Value, RecordTime, dr["ParamValue"].ToString());
addPP.AddPointItem(pdTemp);
}
@ -1956,26 +1958,26 @@ namespace AIMS.OperationAanesthesia
private void UpdatePhysioDataResp()
{
BOperationRecord.UpdatePhysioDataRespByTime(_record);
//string PhysioDataConfigIds = "3,12";
//DataTable dtPhysioData = BOperationRecord.getByOpeIDIsPhysioData(_record.Id.Value, PhysioDataConfigIds);
//List<string> Ids = PhysioDataConfigIds.Split(',').ToList();
//if (dtPhysioData != null && dtPhysioData.Rows.Count > 0)
//{
// foreach (PhysioDataConfig addPP in _record.PhysioConfigList)
// {
// if (!Ids.Contains(addPP.Id.ToString())) continue;
// addPP.clearAddObj(zgcAnaesRecord);
// if (addPP.IsDefalultShow == false) continue;
// for (int i = 0; i < dtPhysioData.Rows.Count; i++)
// {
// if (dtPhysioData.Rows[i]["Name"].ToString().Equals(addPP.Name.ToString()))
// {
// PhysioData pdTemp = PhysioDataConfig.newPhysioData(addPP, _record.Id.Value, DateTime.Parse(dtPhysioData.Rows[i]["RecordTime"].ToString()), dtPhysioData.Rows[i]["Value"].ToString());
// addPP.AddPointItem(pdTemp, false);
// }
// }
// }
//}
string PhysioDataConfigIds = "3,12";
DataTable dtPhysioData = BOperationRecord.getByOpeIDIsPhysioData(_record.Id.Value, PhysioDataConfigIds);
List<string> Ids = PhysioDataConfigIds.Split(',').ToList();
if (dtPhysioData != null && dtPhysioData.Rows.Count > 0)
{
foreach (PhysioDataConfig addPP in _record.PhysioConfigList)
{
if (!Ids.Contains(addPP.Id.ToString())) continue;
addPP.clearAddObj(zgcAnaesRecord);
if (addPP.IsDefalultShow == false) continue;
for (int i = 0; i < dtPhysioData.Rows.Count; i++)
{
if (dtPhysioData.Rows[i]["Name"].ToString().Equals(addPP.Name.ToString()))
{
PhysioData pdTemp = PhysioDataConfig.newPhysioData(addPP, _record.Id.Value, DateTime.Parse(dtPhysioData.Rows[i]["RecordTime"].ToString()), dtPhysioData.Rows[i]["Value"].ToString());
addPP.AddPointItem(pdTemp, false);
}
}
}
}
}
private void clearSelectCouve_Click(Object sender, EventArgs e)

View File

@ -41,13 +41,6 @@ namespace AIMS.PublicUI.UI
this.btnAdd = new DevComponents.DotNetBar.ButtonX();
this.btnSave = new DevComponents.DotNetBar.ButtonX();
this.dgvEvents = new DevComponents.DotNetBar.Controls.DataGridViewX();
this.TypeName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.EventName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.BeginTime = new DevComponents.DotNetBar.Controls.DataGridViewDateTimeInputColumn();
this.Continue = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.EndTime = new DevComponents.DotNetBar.Controls.DataGridViewDateTimeInputColumn();
this.Value = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Remark = new AIMS.PublicUI.UI.DataGridViewComboEditTipBoxColumn();
this.panel1 = new System.Windows.Forms.Panel();
this.TabSelEvents = new DevComponents.DotNetBar.SuperTabControl();
this.superTabControlPanel1 = new DevComponents.DotNetBar.SuperTabControlPanel();
@ -70,6 +63,13 @@ namespace AIMS.PublicUI.UI
this.dataGridViewComboEditTipBoxColumn1 = new AIMS.PublicUI.UI.DataGridViewComboEditTipBoxColumn();
this.dataGridViewComboEditBoxColumn1 = new AIMS.PublicUI.UI.DataGridViewComboEditBoxColumn();
this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.TypeName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.EventName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.BeginTime = new DevComponents.DotNetBar.Controls.DataGridViewDateTimeInputColumn();
this.Continue = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.EndTime = new DevComponents.DotNetBar.Controls.DataGridViewDateTimeInputColumn();
this.EventValue = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Remark = new AIMS.PublicUI.UI.DataGridViewComboEditTipBoxColumn();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvEvents)).BeginInit();
this.panel1.SuspendLayout();
@ -188,7 +188,7 @@ namespace AIMS.PublicUI.UI
this.BeginTime,
this.Continue,
this.EndTime,
this.Value,
this.EventValue,
this.Remark});
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;
@ -223,114 +223,6 @@ namespace AIMS.PublicUI.UI
this.dgvEvents.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.dgvEvents_EditingControlShowing);
this.dgvEvents.RowsAdded += new System.Windows.Forms.DataGridViewRowsAddedEventHandler(this.dgvEvents_RowsAdded);
//
// TypeName
//
this.TypeName.HeaderText = "类型";
this.TypeName.Name = "TypeName";
this.TypeName.Visible = false;
this.TypeName.Width = 60;
//
// EventName
//
this.EventName.HeaderText = "事件名称";
this.EventName.Name = "EventName";
this.EventName.Width = 290;
//
// BeginTime
//
this.BeginTime.AutoAdvance = true;
//
//
//
this.BeginTime.BackgroundStyle.BackColor = System.Drawing.SystemColors.Window;
this.BeginTime.BackgroundStyle.Class = "DataGridViewDateTimeBorder";
this.BeginTime.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.BeginTime.BackgroundStyle.TextColor = System.Drawing.SystemColors.WindowText;
this.BeginTime.ButtonDropDown.Visible = true;
this.BeginTime.Format = DevComponents.Editors.eDateTimePickerFormat.ShortTime;
this.BeginTime.HeaderText = "开始时间";
this.BeginTime.InputHorizontalAlignment = DevComponents.Editors.eHorizontalAlignment.Left;
//
//
//
//
//
//
this.BeginTime.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.BeginTime.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1);
//
//
//
this.BeginTime.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.BeginTime.MonthCalendar.DisplayMonth = new System.DateTime(2018, 1, 1, 0, 0, 0, 0);
this.BeginTime.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday;
//
//
//
this.BeginTime.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.BeginTime.MonthCalendar.Visible = false;
this.BeginTime.Name = "BeginTime";
this.BeginTime.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.BeginTime.Width = 90;
//
// Continue
//
this.Continue.HeaderText = "持续";
this.Continue.Name = "Continue";
this.Continue.Width = 60;
//
// EndTime
//
this.EndTime.AutoAdvance = true;
//
//
//
this.EndTime.BackgroundStyle.BackColor = System.Drawing.SystemColors.Window;
this.EndTime.BackgroundStyle.Class = "DataGridViewDateTimeBorder";
this.EndTime.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.EndTime.BackgroundStyle.TextColor = System.Drawing.SystemColors.WindowText;
this.EndTime.ButtonDropDown.Visible = true;
this.EndTime.Format = DevComponents.Editors.eDateTimePickerFormat.ShortTime;
this.EndTime.HeaderText = "结束时间";
this.EndTime.InputHorizontalAlignment = DevComponents.Editors.eHorizontalAlignment.Left;
//
//
//
//
//
//
this.EndTime.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.EndTime.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1);
//
//
//
this.EndTime.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.EndTime.MonthCalendar.DisplayMonth = new System.DateTime(2018, 1, 1, 0, 0, 0, 0);
this.EndTime.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday;
//
//
//
this.EndTime.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.EndTime.MonthCalendar.Visible = false;
this.EndTime.Name = "EndTime";
this.EndTime.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.EndTime.Width = 90;
//
// Value
//
this.Value.HeaderText = "值";
this.Value.Name = "Value";
this.Value.Width = 65;
//
// Remark
//
this.Remark.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox;
this.Remark.HeaderText = "备注";
this.Remark.Name = "Remark";
this.Remark.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.Remark.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.Remark.Width = 235;
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.PaleTurquoise;
@ -547,6 +439,114 @@ namespace AIMS.PublicUI.UI
this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
this.dataGridViewTextBoxColumn5.Width = 200;
//
// TypeName
//
this.TypeName.HeaderText = "类型";
this.TypeName.Name = "TypeName";
this.TypeName.Visible = false;
this.TypeName.Width = 60;
//
// EventName
//
this.EventName.HeaderText = "事件名称";
this.EventName.Name = "EventName";
this.EventName.Width = 290;
//
// BeginTime
//
this.BeginTime.AutoAdvance = true;
//
//
//
this.BeginTime.BackgroundStyle.BackColor = System.Drawing.SystemColors.Window;
this.BeginTime.BackgroundStyle.Class = "DataGridViewDateTimeBorder";
this.BeginTime.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.BeginTime.BackgroundStyle.TextColor = System.Drawing.SystemColors.WindowText;
this.BeginTime.ButtonDropDown.Visible = true;
this.BeginTime.Format = DevComponents.Editors.eDateTimePickerFormat.ShortTime;
this.BeginTime.HeaderText = "开始时间";
this.BeginTime.InputHorizontalAlignment = DevComponents.Editors.eHorizontalAlignment.Left;
//
//
//
//
//
//
this.BeginTime.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.BeginTime.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1);
//
//
//
this.BeginTime.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.BeginTime.MonthCalendar.DisplayMonth = new System.DateTime(2018, 1, 1, 0, 0, 0, 0);
this.BeginTime.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday;
//
//
//
this.BeginTime.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.BeginTime.MonthCalendar.Visible = false;
this.BeginTime.Name = "BeginTime";
this.BeginTime.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.BeginTime.Width = 90;
//
// Continue
//
this.Continue.HeaderText = "持续";
this.Continue.Name = "Continue";
this.Continue.Width = 60;
//
// EndTime
//
this.EndTime.AutoAdvance = true;
//
//
//
this.EndTime.BackgroundStyle.BackColor = System.Drawing.SystemColors.Window;
this.EndTime.BackgroundStyle.Class = "DataGridViewDateTimeBorder";
this.EndTime.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.EndTime.BackgroundStyle.TextColor = System.Drawing.SystemColors.WindowText;
this.EndTime.ButtonDropDown.Visible = true;
this.EndTime.Format = DevComponents.Editors.eDateTimePickerFormat.ShortTime;
this.EndTime.HeaderText = "结束时间";
this.EndTime.InputHorizontalAlignment = DevComponents.Editors.eHorizontalAlignment.Left;
//
//
//
//
//
//
this.EndTime.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.EndTime.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1);
//
//
//
this.EndTime.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.EndTime.MonthCalendar.DisplayMonth = new System.DateTime(2018, 1, 1, 0, 0, 0, 0);
this.EndTime.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday;
//
//
//
this.EndTime.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.EndTime.MonthCalendar.Visible = false;
this.EndTime.Name = "EndTime";
this.EndTime.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.EndTime.Width = 90;
//
// EventValue
//
this.EventValue.HeaderText = "值";
this.EventValue.Name = "EventValue";
this.EventValue.Width = 65;
//
// Remark
//
this.Remark.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox;
this.Remark.HeaderText = "备注";
this.Remark.Name = "Remark";
this.Remark.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.Remark.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.Remark.Width = 235;
//
// frmFactEventsNew
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -608,7 +608,7 @@ namespace AIMS.PublicUI.UI
private DevComponents.DotNetBar.Controls.DataGridViewDateTimeInputColumn BeginTime;
private System.Windows.Forms.DataGridViewTextBoxColumn Continue;
private DevComponents.DotNetBar.Controls.DataGridViewDateTimeInputColumn EndTime;
private System.Windows.Forms.DataGridViewTextBoxColumn Value;
private System.Windows.Forms.DataGridViewTextBoxColumn EventValue;
private DataGridViewComboEditTipBoxColumn Remark;
}
}

View File

@ -264,10 +264,11 @@ namespace AIMS.PublicUI.UI
{
if (item.EventEndTime != item.EventBeginTime)
{
this.dgvEvents.Rows[index].Cells["Continue"].Value = "-->";
this.dgvEvents.Rows[index].Cells["EndTime"].Value = item.EventEndTime;
}
}
//this.dgvEvents.Rows[index].Cells["Value"].Value = item.Value;
this.dgvEvents.Rows[index].Cells["EventValue"].Value = item.EventValue;
}
for (int i = 0; i < dgvEvents.Columns.Count; i++)
{
@ -496,10 +497,10 @@ namespace AIMS.PublicUI.UI
{
_event.Remark = "";
}
//if (dr.Cells["Value"].EditedFormattedValue.ToString() != "")
//{
// _event.Value = dr.Cells["Value"].Value.ToString();
//}
if (dr.Cells["EventValue"].EditedFormattedValue.ToString() != "")
{
_event.EventValue = dr.Cells["EventValue"].Value.ToString();
}
_event.IsContinue = dr.Cells["Continue"].EditedFormattedValue.ToString() != "" ? 1 : 0;
if (dr.Tag == null)
@ -554,6 +555,36 @@ namespace AIMS.PublicUI.UI
private void SetEventTime(FactEvents _event, ref bool IsChage)
{
if (_event != null && _event.EventName == "机控呼吸")
{
if (_event.EventValue != null)
{
DateTime EventEndTime = _event.EventEndTime.Value;
if (_event.IsContinue == 1 && _event.EventEndTime.Value == _event.EventBeginTime.Value)
{
EventEndTime = OperationRecord.getOpeMaxTime(_record);
}
if (EventEndTime > DateTime.Now) EventEndTime = DateTime.Now;
DateTime insTime = GetRecordTime(_event.EventBeginTime.Value);
TimeSpan tsp = EventEndTime - insTime;
List<PhysioData> PhysioDatas = new List<PhysioData>();
foreach (var addPP in _record.PhysioConfigList)
{
if (addPP.Id != 12) continue;
for (int i = 0; i < (tsp.TotalMinutes / 5); i++)
{
PhysioData pdTemp = PhysioDataConfig.newPhysioData(addPP, _record.Id.Value, insTime.AddMinutes(i * 5), Convert.ToInt32(_event.EventValue));
PhysioDatas.Add(pdTemp);
}
}
if (PhysioDatas.Count > 0)
{
PhysioDataService.AddPhysioDatas(PhysioDatas);
UpdatePhysioDataResp();
}
}
}
if (_event != null && _event.EventName == "入室" && _record.InRoomTime != _event.EventBeginTime)
{
_record.InRoomTime = _event.EventBeginTime; IsChage = true;
@ -609,8 +640,27 @@ namespace AIMS.PublicUI.UI
BOperationRecord.Update("OutRoomTime=@OutRoom where Id=@id ", new AIMSModel.ParameterList("@OutRoom", _record.OutRoomTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), "@id", _record.Id));
}
}
public DateTime GetRecordTime(DateTime pdTemp, int collectInterval = 5)
{
DateTime result = Convert.ToDateTime(pdTemp.ToString("yyyy-MM-dd HH:mm:00.000"));
//小于入室时间默认不画
for (int i = 0; i < (480 / 5); i++)
{//InRoomTime.Value
DateTime tempTime = _record.PageBegin.AddMinutes(i * 5);
if (tempTime >= result && result < tempTime.AddMinutes(5))
{
result = tempTime;
break;
}
}
return result;
}
private void DelEventTime(FactEvents _event)
{
if (_event != null && _event.EventName == "机控呼吸")
{
UpdatePhysioDataResp();
}
//if (_event != null && _event.EventName == "入室" ) { _record.InRoomTime = null; }
if (_event != null && _event.EventName == "手术开始")
{
@ -891,27 +941,27 @@ namespace AIMS.PublicUI.UI
public void UpdatePhysioDataResp()
{
BOperationRecord.UpdatePhysioDataRespByTime(_record);
//string PhysioDataConfigIds = "3,12";
//DataTable dtPhysioData = BOperationRecord.getByOpeIDIsPhysioData(_record.Id.Value, PhysioDataConfigIds);
//List<string> Ids = PhysioDataConfigIds.Split(',').ToList();
//if (dtPhysioData != null && dtPhysioData.Rows.Count > 0)
//{
// foreach (PhysioDataConfig addPP in _record.PhysioConfigList)
// {
// if (!Ids.Contains(addPP.Id.ToString())) continue;
// if (zgcAnaesRecord != null)
// addPP.clearAddObj(zgcAnaesRecord);
// if (addPP.IsDefalultShow == false) continue;
// for (int i = 0; i < dtPhysioData.Rows.Count; i++)
// {
// if (dtPhysioData.Rows[i]["Name"].ToString().Equals(addPP.Name.ToString()))
// {
// PhysioData pdTemp = PhysioDataConfig.newPhysioData(addPP, _record.Id.Value, DateTime.Parse(dtPhysioData.Rows[i]["RecordTime"].ToString()), dtPhysioData.Rows[i]["Value"].ToString());
// addPP.AddPointItem(pdTemp, false);
// }
// }
// }
//}
string PhysioDataConfigIds = "3,12";
DataTable dtPhysioData = BOperationRecord.getByOpeIDIsPhysioData(_record.Id.Value, PhysioDataConfigIds);
List<string> Ids = PhysioDataConfigIds.Split(',').ToList();
if (dtPhysioData != null && dtPhysioData.Rows.Count > 0)
{
foreach (PhysioDataConfig addPP in _record.PhysioConfigList)
{
if (!Ids.Contains(addPP.Id.ToString())) continue;
if (zgcAnaesRecord != null)
addPP.clearAddObj(zgcAnaesRecord);
if (addPP.IsDefalultShow == false) continue;
for (int i = 0; i < dtPhysioData.Rows.Count; i++)
{
if (dtPhysioData.Rows[i]["Name"].ToString().Equals(addPP.Name.ToString()))
{
PhysioData pdTemp = PhysioDataConfig.newPhysioData(addPP, _record.Id.Value, DateTime.Parse(dtPhysioData.Rows[i]["RecordTime"].ToString()), dtPhysioData.Rows[i]["Value"].ToString());
addPP.AddPointItem(pdTemp, false);
}
}
}
}
}
private void dgvEvents_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)

View File

@ -133,7 +133,7 @@ namespace AIMS
}
else
{
//MessageBox.Show(e.Exception.Message + "\r\n" + e.Exception.StackTrace, "系统信息");
MessageBox.Show(e.Exception.Message + "\r\n" + e.Exception.StackTrace, "系统信息");
AIMSExtension.PublicMethod.WriteLog(e.Exception);
}
}

View File

@ -21,7 +21,7 @@ namespace AIMSDAL
internal static int Insert(SqlCommand cmd, FactEvents factEvents)
{
cmd.Parameters.Clear();
cmd.CommandText = "insert into FactEvents (EventTypeId,PatientId,EventId,EventBeginTime,EventEndTime,IsContinue,Remark,OperatorNo,OperatorName,OperateDate) values (@EventTypeId,@PatientId,@EventId,@EventBeginTime,@EventEndTime,@IsContinue,@Remark,@OperatorNo,@OperatorName,@OperateDate);select @@identity";
cmd.CommandText = "insert into FactEvents (EventTypeId,PatientId,EventId,EventBeginTime,EventEndTime,IsContinue,Remark,OperatorNo,OperatorName,OperateDate,EventValue,Extend1,Extend2,Extend3) values (@EventTypeId,@PatientId,@EventId,@EventBeginTime,@EventEndTime,@IsContinue,@Remark,@OperatorNo,@OperatorName,@OperateDate,@EventValue,@Extend1,@Extend2,@Extend3);select @@identity";
//从实体中取出值放入Command的参数列表
cmd.Parameters.Add(new SqlParameter("@EventTypeId",factEvents.EventTypeId.HasValue?(object)factEvents.EventTypeId.Value:(object)DBNull.Value));
cmd.Parameters.Add(new SqlParameter("@PatientId",factEvents.PatientId.HasValue?(object)factEvents.PatientId.Value:(object)DBNull.Value));
@ -33,6 +33,10 @@ namespace AIMSDAL
cmd.Parameters.Add(new SqlParameter("@OperatorNo",factEvents.OperatorNo==null?(object)DBNull.Value:(object)factEvents.OperatorNo));
cmd.Parameters.Add(new SqlParameter("@OperatorName",factEvents.OperatorName==null?(object)DBNull.Value:(object)factEvents.OperatorName));
cmd.Parameters.Add(new SqlParameter("@OperateDate",factEvents.OperateDate.HasValue?(object)factEvents.OperateDate.Value:(object)DBNull.Value));
cmd.Parameters.Add(new SqlParameter("@EventValue",factEvents.EventValue==null?(object)DBNull.Value:(object)factEvents.EventValue));
cmd.Parameters.Add(new SqlParameter("@Extend1",factEvents.Extend1==null?(object)DBNull.Value:(object)factEvents.Extend1));
cmd.Parameters.Add(new SqlParameter("@Extend2",factEvents.Extend2==null?(object)DBNull.Value:(object)factEvents.Extend2));
cmd.Parameters.Add(new SqlParameter("@Extend3",factEvents.Extend3==null?(object)DBNull.Value:(object)factEvents.Extend3));
return Convert.ToInt32(cmd.ExecuteScalar());
}
/// <summary>
@ -177,7 +181,7 @@ namespace AIMSDAL
/// <returns>影响的记录行数</returns>
internal static int ExcuteUpdateCommand(SqlCommand cmd, FactEvents factEvents)
{
cmd.CommandText = "update FactEvents set EventTypeId=@EventTypeId,PatientId=@PatientId,EventId=@EventId,EventBeginTime=@EventBeginTime,EventEndTime=@EventEndTime,IsContinue=@IsContinue,Remark=@Remark,OperatorNo=@OperatorNo,OperatorName=@OperatorName,OperateDate=@OperateDate where Id=@Id";
cmd.CommandText = "update FactEvents set EventTypeId=@EventTypeId,PatientId=@PatientId,EventId=@EventId,EventBeginTime=@EventBeginTime,EventEndTime=@EventEndTime,IsContinue=@IsContinue,Remark=@Remark,OperatorNo=@OperatorNo,OperatorName=@OperatorName,OperateDate=@OperateDate,EventValue=@EventValue,Extend1=@Extend1,Extend2=@Extend2,Extend3=@Extend3 where Id=@Id";
//从实体中取出值放入Command的参数列表
cmd.Parameters.Add(new SqlParameter("@EventTypeId",factEvents.EventTypeId.HasValue?(object)factEvents.EventTypeId.Value:(object)DBNull.Value));
cmd.Parameters.Add(new SqlParameter("@PatientId",factEvents.PatientId.HasValue?(object)factEvents.PatientId.Value:(object)DBNull.Value));
@ -189,6 +193,10 @@ namespace AIMSDAL
cmd.Parameters.Add(new SqlParameter("@OperatorNo",factEvents.OperatorNo==null?(object)DBNull.Value:(object)factEvents.OperatorNo));
cmd.Parameters.Add(new SqlParameter("@OperatorName",factEvents.OperatorName==null?(object)DBNull.Value:(object)factEvents.OperatorName));
cmd.Parameters.Add(new SqlParameter("@OperateDate",factEvents.OperateDate.HasValue?(object)factEvents.OperateDate.Value:(object)DBNull.Value));
cmd.Parameters.Add(new SqlParameter("@EventValue",factEvents.EventValue==null?(object)DBNull.Value:(object)factEvents.EventValue));
cmd.Parameters.Add(new SqlParameter("@Extend1",factEvents.Extend1==null?(object)DBNull.Value:(object)factEvents.Extend1));
cmd.Parameters.Add(new SqlParameter("@Extend2",factEvents.Extend2==null?(object)DBNull.Value:(object)factEvents.Extend2));
cmd.Parameters.Add(new SqlParameter("@Extend3",factEvents.Extend3==null?(object)DBNull.Value:(object)factEvents.Extend3));
cmd.Parameters.Add(new SqlParameter("@Id", factEvents.Id));
return cmd.ExecuteNonQuery();
}
@ -633,6 +641,22 @@ namespace AIMSDAL
{
entity.OperateDate=Convert.ToDateTime(dr["OperateDate"]);
}
if(dr["EventValue"]!=System.DBNull.Value)
{
entity.EventValue=dr["EventValue"].ToString();
}
if(dr["Extend1"]!=System.DBNull.Value)
{
entity.Extend1=dr["Extend1"].ToString();
}
if(dr["Extend2"]!=System.DBNull.Value)
{
entity.Extend2=dr["Extend2"].ToString();
}
if(dr["Extend3"]!=System.DBNull.Value)
{
entity.Extend3=dr["Extend3"].ToString();
}
return entity;
}
}

View File

@ -84,6 +84,11 @@ namespace AIMSDAL
strSql1.Append("OperateDate,");
strSql2.Append("'" + model.OperateDate + "',");
}
if (model.EventValue != null)
{
strSql1.Append("EventValue,");
strSql2.Append("'" + model.EventValue + "',");
}
strSql.Append("insert into FactEvents(");
strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
strSql.Append(")");
@ -174,7 +179,7 @@ namespace AIMSDAL
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select top 1 ");
strSql.Append(" Id,EventTypeId,PatientId,EventId,EventBeginTime,EventEndTime,IsContinue,Remark,OperatorNo,OperatorName,OperateDate ");
strSql.Append(" Id,EventTypeId,PatientId,EventId,EventBeginTime,EventEndTime,IsContinue,Remark,OperatorNo,OperatorName,OperateDate,EventValue ");
strSql.Append(" from FactEvents ");
strSql.Append(" where Id=" + Id + " ");
FactEvents model = new FactEvents();
@ -216,6 +221,7 @@ namespace AIMSDAL
{
model.OperateDate = DateTime.Parse(ds.Tables[0].Rows[0]["OperateDate"].ToString());
}
model.EventValue = ds.Tables[0].Rows[0]["EventValue"].ToString();
return model;
}
return model;
@ -224,7 +230,7 @@ namespace AIMSDAL
public static DataTable GetDataTable(int PatientId, int EventTypeId)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("SELECT s.Id, e.Id AS EventId, e.Name AS EventName,e.Remark AS EventRemark, s.EventBeginTime, s.EventEndTime, s.Remark, s.[OperatorNo],s.[OperatorName],s.[OperateDate]");
strSql.Append("SELECT s.Id, e.Id AS EventId, e.Name AS EventName,e.Remark AS EventRemark, EventValue,s.EventBeginTime, s.EventEndTime, s.Remark, s.[OperatorNo],s.[OperatorName],s.[OperateDate]");
strSql.Append(" FROM FactEvents s LEFT JOIN Events e ON e.Id =s.EventId WHERE s.EventTypeId=" + EventTypeId + " AND s.PatientId=" + PatientId + " ORDER BY s.EventBeginTime");
return HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
}

View File

@ -384,6 +384,7 @@ namespace AIMSBLL
FactEventsObj.EventId = int.Parse(dt.Rows[i]["EventId"].ToString());
FactEventsObj.Remark = dt.Rows[i]["Remark"].ToString();
FactEventsObj.EventRemark = dt.Rows[i]["EventRemark"].ToString();
FactEventsObj.EventValue = dt.Rows[i]["EventValue"].ToString();
FactEventsObj.EventBeginTime = DateTime.Parse(DateTime.Parse(dt.Rows[i]["EventBeginTime"].ToString()).ToString("yyyy-MM-dd HH:mm:ss"));
FactEventsObj.EventEndTime = DateTime.Parse(DateTime.Parse(dt.Rows[i]["EventEndTime"].ToString()).ToString("yyyy-MM-dd HH:mm:ss"));
FactEventsObj.OperatorNo = dt.Rows[i]["OperatorNo"].ToString();

View File

@ -20,6 +20,10 @@ namespace AIMSObjectQuery
dictionary.Add("operatorno", "OperatorNo");
dictionary.Add("operatorname", "OperatorName");
dictionary.Add("operatedate", "OperateDate");
dictionary.Add("eventvalue", "EventValue");
dictionary.Add("extend1", "Extend1");
dictionary.Add("extend2", "Extend2");
dictionary.Add("extend3", "Extend3");
}
#region IMap

View File

@ -19,6 +19,10 @@ namespace DrawGraph
private string _operatorno;
private string _operatorname;
private DateTime? _operatedate;
private string eventValue;
private string extend1;
private string extend2;
private string extend3;
public string EventRemark;
@ -115,6 +119,38 @@ namespace DrawGraph
set { _operatedate = value; }
get { return _operatedate; }
}
/// <summary>
///
/// </summary>
public string EventValue
{
set { eventValue = value; }
get { return eventValue; }
}
/// <summary>
///
/// </summary>
public string Extend1
{
get { return extend1; }
set { extend1 = value; }
}
/// <summary>
///
/// </summary>
public string Extend2
{
get { return extend2; }
set { extend2 = value; }
}
/// <summary>
///
/// </summary>
public string Extend3
{
get { return extend3; }
set { extend3 = value; }
}
#endregion Model
/// <summary>

View File

@ -413,6 +413,33 @@ namespace DrawGraph
}
}
public void UpdatePointItem(PhysioData pd, bool isInsertDB = true)
{
//如果是负数则不执行操作
if (pd.Value <= 0) return;
bool isHave = false;
foreach (PointPair pptemp in APhysioParams)
{
PhysioData temp1 = PointPairToPhysioData(pptemp);
if (pd.isEquert(temp1) && temp1.Value != Double.MaxValue)
{
isHave = true;
break;
}
}
if (!isHave)
this.APhysioParams.Add(pd);
Sort();
if (curve != null)
curve.Points = APhysioParams;
if (isInsertDB == true)
PhysioDataService.AddPhysioData(pd);
if (ShowText == true)
{
DrawTextPhysioData(pd);
}
}
/// <summary>
/// 增加一点生理数据,往数据库中写入数据
/// </summary>

View File

@ -53,6 +53,7 @@ namespace DrawGraph
//}
//DevComponents.DotNetBar.Controls.EditToken edit1 = new DevComponents.DotNetBar.Controls.EditToken("", "无");
//tokenEditor.Tokens.Add(edit1);
tokenEditor.IsPopupOpen = false; //弹出下拉框
foreach (DataRow item in dt.Rows)
{
DevComponents.DotNetBar.Controls.EditToken edit = new DevComponents.DotNetBar.Controls.EditToken(item["Id"].ToString(), item["Name"].ToString());
@ -148,6 +149,7 @@ namespace DrawGraph
foreach (var item in tokenEditor.SelectedTokens)
{
if (item.Text == "") break;
namevalue.Add(item.Text);
idvalue.Add(item.Value);
}