/// <summary> /// 获取个性化体征配置 /// </summary> /// <param name="patientID">patientID</param> /// <param name="visitID">visitID</param> /// <param name="operID">operID</param> /// <param name="eventNo">eventNo</param> /// <returns></returns> public dynamic GetPatientMonitorConfig(string patientID, int visitID, int operID, string eventNo) { MED_PATIENT_MONITOR_CONFIG patMonitorConfigList = dapper.Set <MED_PATIENT_MONITOR_CONFIG>().Single( x => x.PATIENT_ID == patientID && x.VISIT_ID == visitID && x.OPER_ID == operID && x.EVENT_NO == eventNo); //获取默认体征 if (patMonitorConfigList == null) { patMonitorConfigList = dapper.Set <MED_PATIENT_MONITOR_CONFIG>().Single( x => x.PATIENT_ID == "999" && x.VISIT_ID == 0 && x.OPER_ID == 0 && x.EVENT_NO == eventNo); } if (patMonitorConfigList != null) { if (patMonitorConfigList.CONTENT != null) { using (System.IO.MemoryStream stream = new System.IO.MemoryStream(patMonitorConfigList.CONTENT)) { stream.Position = 0; using (DataSet ds = new DataSet()) { ds.ReadXml(stream); if (ds.Tables.Count > 0) { string tableName = "UserVitalShowSet" + ((Convert.ToInt32(eventNo) < 0) ? "0" : eventNo); DataTable dataTable = ds.Tables[tableName]; return(JsonConvert.DeserializeObject(JsonConvert.SerializeObject(dataTable))); } } } } } return(null); }
/// <summary> /// 获取用户曲线设置 /// </summary> /// <returns></returns> protected List <VitalSignCurveDetailModel> GetUserVitalShowSet(string eventNo) { List <VitalSignCurveDetailModel> detailList = new List <VitalSignCurveDetailModel>(); List <MedVitalSignCurveDetail> list = new List <MedVitalSignCurveDetail>(); MED_PATIENT_MONITOR_CONFIG config = GetPatientMonitorConfigDataTable(eventNo); if (config != null && !string.IsNullOrEmpty(config.CONTENT.ToString())) { System.IO.MemoryStream stream = new System.IO.MemoryStream(config.CONTENT); stream.Position = 0; DataSet ds = new DataSet(); ds.ReadXml(stream); if (ds.Tables.Count > 0) { string tableName = "UserVitalShowSet" + ((Convert.ToInt32(eventNo) < 0) ? "0" : eventNo); DataTable dataTable = ds.Tables[tableName]; ListFromTable(list, typeof(MedVitalSignCurveDetail), dataTable); } ds.Dispose(); stream.Close(); stream.Dispose(); } foreach (MedVitalSignCurveDetail detail in list) { detailList.Add(ConvertToDetailModel(detail)); } return(detailList); }
public int SaveMonitorConfig(MED_PATIENT_MONITOR_CONFIG item) { int result = dapper.Set <MED_PATIENT_MONITOR_CONFIG>().Save(item) == true ? 1 : 0; dapper.SaveChanges(); return(result); }
/// <summary> /// 获取当前患者监测配置数据 /// </summary> /// <param name="patientID"></param> /// <param name="visitID"></param> /// <param name="operID"></param> /// <returns></returns> private MED_PATIENT_MONITOR_CONFIG GetPatientMonitorConfigDataTable(string eventNo) { MED_PATIENT_MONITOR_CONFIG patMonitorConfig = AnesInfoService.ClientInstance.GetPatientMonitorConfig(ExtendAppContext.Current.PatientInformationExtend.PATIENT_ID, ExtendAppContext.Current.PatientInformationExtend.VISIT_ID, ExtendAppContext.Current.PatientInformationExtend.OPER_ID, eventNo); if (patMonitorConfig == null) { patMonitorConfig = AnesInfoService.ClientInstance.GetPatientMonitorConfig("999", 0, 0, eventNo); } return(patMonitorConfig); }
/// <summary> /// 获取当前患者监测配置数据 /// </summary> /// <param name="patientID"></param> /// <param name="visitID"></param> /// <param name="operID"></param> /// <returns></returns> private MED_PATIENT_MONITOR_CONFIG GetPatientMonitorConfigDataTable(string eventNo) { MED_PATIENT_MONITOR_CONFIG patMonitorConfig = OperationInfoService.GetMonitorConfig(ExtendAppContext.Current.PatientID, ExtendAppContext.Current.VisitID, ExtendAppContext.Current.OperID, eventNo); if (patMonitorConfig == null) { patMonitorConfig = OperationInfoService.GetMonitorConfig("999", 0, 0, eventNo); } return(patMonitorConfig); }
/// <summary> /// 获取当前患者监测配置数据 /// </summary> /// <param name="patientID"></param> /// <param name="visitID"></param> /// <param name="operID"></param> /// <returns></returns> private MED_PATIENT_MONITOR_CONFIG GetPatientMonitorConfigDataTable(string eventNo) { MED_PATIENT_MONITOR_CONFIG patMonitorConfig = operationInfoRepository.GetMonitorConfig(ExtendApplicationContext.Current.PatientContextExtend.PatientID, ExtendApplicationContext.Current.PatientContextExtend.VisitID, ExtendApplicationContext.Current.PatientContextExtend.OperID, eventNo).Data; if (patMonitorConfig == null) { patMonitorConfig = operationInfoRepository.GetMonitorConfig("999", 0, 0, eventNo).Data; } return(patMonitorConfig); }
/// <summary> /// 保存个性化体征通用配置 /// </summary> /// <param name="patientID">patientID</param> /// <param name="visitID">visitID</param> /// <param name="operID">operID</param> /// <param name="eventNo">eventNo</param> /// <returns></returns> public int UpdatePatientMonitorConfig(string patientID, int visitID, int operID, string eventNo, string content) { int type = 0; byte[] bytes; DataTable dataTable = JsonToDataTable(JsonConvert.SerializeObject(JsonConvert.DeserializeObject(content))); string tableName = "UserVitalShowSet" + ((Convert.ToInt32(eventNo) < 0) ? "0" : eventNo); dataTable.TableName = tableName; using (System.IO.MemoryStream stream = new System.IO.MemoryStream()) { dataTable.WriteXml(stream); stream.Position = 0; bytes = new byte[stream.Length]; stream.Read(bytes, 0, (int)stream.Length); } MED_PATIENT_MONITOR_CONFIG patMonitorConfigList = dapper.Set <MED_PATIENT_MONITOR_CONFIG>().Single( x => x.PATIENT_ID == patientID && x.VISIT_ID == visitID && x.OPER_ID == operID && x.EVENT_NO == eventNo); if (patMonitorConfigList != null) { patMonitorConfigList.CONTENT = bytes; patMonitorConfigList.ModelStatus = ModelStatus.Modeified; type = dapper.Set <MED_PATIENT_MONITOR_CONFIG>().Update(patMonitorConfigList) > 0 ? 1 : 0; } else { patMonitorConfigList = new MED_PATIENT_MONITOR_CONFIG(); patMonitorConfigList.PATIENT_ID = "999"; patMonitorConfigList.VISIT_ID = 0; patMonitorConfigList.OPER_ID = 0; patMonitorConfigList.EVENT_NO = "0"; patMonitorConfigList.CONTENT = bytes; patMonitorConfigList.ModelStatus = ModelStatus.Add; type = dapper.Set <MED_PATIENT_MONITOR_CONFIG>().Insert(patMonitorConfigList) ? 1 : 0; } dapper.SaveChanges(); return(type); }
protected List <MedVitalSignCurveDetail> GetUserVitalShowSet(string eventNo) { List <MedVitalSignCurveDetail> list = new List <MedVitalSignCurveDetail>(); MED_PATIENT_MONITOR_CONFIG config = GetPatientMonitorConfigDataTable(eventNo); if (config != null && !string.IsNullOrEmpty(config.CONTENT.ToString())) { System.IO.MemoryStream stream = new System.IO.MemoryStream(config.CONTENT); stream.Position = 0; DataSet ds = new DataSet(); ds.ReadXml(stream); if (ds.Tables.Count > 0) { string tableName = "UserVitalShowSet" + ((Convert.ToInt32(eventNo) < 0) ? "0" : eventNo); DataTable dataTable = ds.Tables[tableName]; ListFromTable(list, typeof(MedVitalSignCurveDetail), dataTable); } ds.Dispose(); stream.Close(); stream.Dispose(); } // 获取用药图表控件,去掉重复的药 MedVitalSignGraph vitalSignGraph = null; foreach (IUIElementHandler handler in MedicalPaperUIElementHandlers) { if (handler.GetControlType == typeof(MedVitalSignGraph) && handler.GetCurrentControl != null) { vitalSignGraph = handler.GetCurrentControl as MedVitalSignGraph; break; } } if (null != vitalSignGraph) { foreach (MedVitalSignCurveDetail detail in vitalSignGraph.CurveDetails) { if (!string.IsNullOrEmpty(detail.CurveCode) && !list.Contains(detail)) { list.Add(detail); } } } return(list); }
/// <summary> /// 获取用户曲线设置 /// </summary> /// <returns></returns> protected List <MedVitalSignCurveDetail> GetUserVitalShowSet(string eventNo) { List <MedVitalSignCurveDetail> list = new List <MedVitalSignCurveDetail>(); MED_PATIENT_MONITOR_CONFIG configTable = GetPatientMonitorConfigDataTable(eventNo); if (configTable != null && !string.IsNullOrEmpty(configTable.CONTENT.ToString())) { using (System.IO.MemoryStream stream = new System.IO.MemoryStream(configTable.CONTENT)) { stream.Position = 0; using (DataSet ds = new DataSet()) { ds.ReadXml(stream); if (ds.Tables.Count > 0) { string tableName = "UserVitalShowSet" + ((Convert.ToInt32(eventNo) < 0) ? "0" : eventNo); DataTable dataTable = ds.Tables[tableName]; ListFromTable(list, typeof(MedVitalSignCurveDetail), dataTable); } } } } return(list); }
public RequestResult <int> SaveMonitorConfig(MED_PATIENT_MONITOR_CONFIG item) { return(Success(_pacuOperationInfoService.SaveMonitorConfig(item))); }
public RequestResult <int> SaveMonitorConfig(MED_PATIENT_MONITOR_CONFIG item) { string address = "PacuOperationInfo/SaveMonitorConfig"; return(BaseRepository.PostCallApi <MED_PATIENT_MONITOR_CONFIG>(address, item)); }
/// <summary> /// 保存数据 /// </summary> /// <returns></returns> protected override SaveResult SaveData() { List <VitalSignCurveDetailModel> list = Args[0] as List <VitalSignCurveDetailModel>; foreach (LegendItemEx item in DetailModel) { if (item.Code != null) { foreach (VitalSignCurveDetailModel detail in list) { if (item.Code == detail.CurveCode) { detail.Visible = item.Visible.Equals("是") ? true : false; detail.Color = item.LineColor; string ShowTypeName = SelectShowType.Where(x => x.ITEM_NAME == item.ShowType).FirstOrDefault().ITEM_CODE; detail.ShowType = (CurveShowType)Enum.Parse(typeof(CurveShowType), ShowTypeName); string TimeIntervalName = SelectShowTimeInterval.Where(x => x.ITEM_NAME == item.TimeInterval).FirstOrDefault().ITEM_CODE; detail.ShowTimeInterval = (ShowTimeInterval)Enum.Parse(typeof(ShowTimeInterval), TimeIntervalName); detail.SymbolEntry = item.SymbolName; string SymbolName = SelectSymbol.Where(x => x.ITEM_NAME == item.SymbolName).FirstOrDefault().ITEM_CODE; detail.LegendList[0].Symbol.SymbolType = (SymbolType)Enum.Parse(typeof(SymbolType), SymbolName); detail.HideTime[0].StartDateTime = item.HideStart == null ? null : item.HideStart; detail.HideTime[0].EndDateTime = item.HideEnd == null ? null : item.HideEnd; } } } } string tableName = "UserVitalShowSet" + ((Convert.ToInt32(ExtendAppContext.Current.EventNo) < 0) ? "0" : ExtendAppContext.Current.EventNo); DataTable dataTable = new DataTable(tableName); System.Reflection.PropertyInfo[] propertyInfos = typeof(MedVitalSignCurveDetail).GetProperties(); foreach (System.Reflection.PropertyInfo propertyInfo in propertyInfos) { dataTable.Columns.Add(propertyInfo.Name); } foreach (VitalSignCurveDetailModel obj in list) { MedVitalSignCurveDetail detail = ConvertToCurveDetail(obj); DataRow row = dataTable.NewRow(); foreach (System.Reflection.PropertyInfo propertyInfo in propertyInfos) { if (propertyInfo.Name.Equals("LegendList")) { string symbolStr = ""; for (int i = 0; i < obj.LegendList.Count; i++) { symbolStr += obj.LegendList[i].Symbol.SymbolType.ToString(); symbolStr += "|"; } row[propertyInfo.Name] = symbolStr; } else if (propertyInfo.Name.Equals("HideTime")) { string time = ""; for (int i = 0; i < obj.HideTime.Count; i++) { if (obj.HideTime[0].StartDateTime != null && obj.HideTime[0].StartDateTime != DateTime.MinValue || obj.HideTime[0].StartDateTime != DateTime.MaxValue) { time += obj.HideTime[0].StartDateTime.ToString() + "&" + obj.HideTime[0].EndDateTime.ToString(); time += "|"; } } row[propertyInfo.Name] = time; } else { row[propertyInfo.Name] = AssemblyHelper.GetPropertyValue(propertyInfo, detail); } } dataTable.Rows.Add(row); } System.IO.MemoryStream stream = new System.IO.MemoryStream(); dataTable.WriteXml(stream); stream.Position = 0; byte[] bytes = FileHelper.StreamToBytes(stream); MED_PATIENT_MONITOR_CONFIG configRow = AnesInfoService.ClientInstance.GetPatientMonitorConfig(ExtendAppContext.Current.PatientInformationExtend.PATIENT_ID, ExtendAppContext.Current.PatientInformationExtend.VISIT_ID, ExtendAppContext.Current.PatientInformationExtend.OPER_ID, ExtendAppContext.Current.EventNo); if (configRow == null) { configRow = new MED_PATIENT_MONITOR_CONFIG(); configRow.PATIENT_ID = ExtendAppContext.Current.PatientInformationExtend.PATIENT_ID; configRow.VISIT_ID = ExtendAppContext.Current.PatientInformationExtend.VISIT_ID; configRow.OPER_ID = ExtendAppContext.Current.PatientInformationExtend.OPER_ID; configRow.EVENT_NO = ExtendAppContext.Current.EventNo; } configRow.CONTENT = bytes; if (AnesInfoService.ClientInstance.updatePatMonitorConfig(configRow)) { return(SaveResult.Success); } else { return(SaveResult.Fail); } }
public RequestResult <bool> updatePatMonitorConfig(MED_PATIENT_MONITOR_CONFIG data) { return(Success(_anesInfoService.updatePatMonitorConfig(data))); }
public RequestResult <MED_PATIENT_MONITOR_CONFIG> GetPatientMonitorConfig(string patientID, int visitID, int operID, string eventNo) { MED_PATIENT_MONITOR_CONFIG patMontirConfig = _anesInfoService.GetPatientMonitorConfig(patientID, visitID, operID, eventNo); return(Success(patMontirConfig)); }