/// <summary> /// 获取基本数据表 /// </summary> private void GetPatInfoData() { string patientID = ExtendAppContext.Current.PatientInformationExtend.PATIENT_ID; int visitID = ExtendAppContext.Current.PatientInformationExtend.VISIT_ID; int operID = ExtendAppContext.Current.PatientInformationExtend.OPER_ID; if (null == this.operMaster) { this.operMaster = AnesInfoService.ClientInstance.GetOperationMaster(patientID, visitID, operID); this.dataSourceList.Add(this.operMaster); } if (null == this.patMasterIndex) { this.patMasterIndex = AnesInfoService.ClientInstance.GetPatMasterIndex(patientID).FirstOrDefault(); this.dataSourceList.Add(this.patMasterIndex); } if (null == this.patVisit) { this.patVisit = CareDocService.ClientInstance.GetPatVisit(patientID, visitID); this.dataSourceList.Add(this.patVisit); } if (null == this.patsInHospital) { this.patsInHospital = AnesInfoService.ClientInstance.GetPatsInHospitalList(patientID, visitID).FirstOrDefault(); this.dataSourceList.Add(this.patsInHospital); } }
protected override void OnSaveData(Dictionary <string, DataTable> dataSource) { List <MED_OPERATION_MASTER> operMasterList = ModelHelper <MED_OPERATION_MASTER> .ConvertDataTableToList(dataSource["MED_OPERATION_MASTER"]); MED_OPERATION_MASTER operMaster = null; if (operMasterList != null && operMasterList.Count > 0) { operMaster = operMasterList[0]; } List <MED_PAT_MASTER_INDEX> patIndexList = ModelHelper <MED_PAT_MASTER_INDEX> .ConvertDataTableToList(dataSource["MED_PAT_MASTER_INDEX"]); MED_PAT_MASTER_INDEX patMasterIndex = null; if (patIndexList != null && patIndexList.Count > 0) { patMasterIndex = patIndexList[0]; } List <MED_PAT_VISIT> patVisitList = ModelHelper <MED_PAT_VISIT> .ConvertDataTableToList(dataSource["MED_PAT_VISIT"]); MED_PAT_VISIT patVisit = null; if (patVisitList != null && patVisitList.Count > 0) { patVisit = patVisitList[0]; } List <MED_ANESTHESIA_RECOVER> anesReconver = ModelHelper <MED_ANESTHESIA_RECOVER> .ConvertDataTableToList(dataSource["MED_ANESTHESIA_RECOVER"]); if (anesReconver != null && anesReconver.Count > 0) { operationInfoRepository.SaveAnesRecoverData(anesReconver[0]); } List <MED_ANESTHESIA_INQUIRY> anesInquiry = ModelHelper <MED_ANESTHESIA_INQUIRY> .ConvertDataTableToList(dataSource["MED_ANESTHESIA_INQUIRY"]); if (anesInquiry != null && anesInquiry.Count > 0) { operationInfoRepository.SaveAnesInquiryData(anesInquiry[0]); } List <MED_POSTOPERATIVE_EXTENDED> postExtended = ModelHelper <MED_POSTOPERATIVE_EXTENDED> .ConvertDataTableToList(dataSource["MED_POSTOPERATIVE_EXTENDED"]); MED_PATS_IN_HOSPITAL patsInHospital = null; MED_ANESTHESIA_PLAN anesPlan = null; MED_ANESTHESIA_PLAN_EXAM anesPlanExam = null; MED_ANESTHESIA_PLAN_PMH anesPlanPmh = null; List <MED_OPERATION_EXTENDED> operExtended = null; List <MED_PREOPERATIVE_EXPANSION> preExpansion = null; operationInfoRepository.SaveMedicalBasicDoc(new { operMaster, patMasterIndex, patVisit, patsInHospital, anesPlan, anesPlanExam, anesPlanPmh, operExtended, postExtended, preExpansion }); }
public int SavePatsInHospital(MED_PATS_IN_HOSPITAL item) { int result = dapper.Set <MED_PATS_IN_HOSPITAL>().Save(item) == true ? 1 : 0; dapper.SaveChanges(); return(result); }
public MED_PATS_IN_HOSPITAL GetPatsInHospital(string patientID, int visitID) { MED_PATS_IN_HOSPITAL patsInHosptial = operationInfoRepository.GetPatsInHospitalByID(patientID, visitID).Data; if (patsInHosptial == null) { patsInHosptial = new MED_PATS_IN_HOSPITAL(); patsInHosptial.PATIENT_ID = patientID; patsInHosptial.VISIT_ID = visitID; } return(patsInHosptial); }
private void SyncPatientByInpNo(string inpNo) { if (ExtendApplicationContext.Current.IsSync) { string ret = ""; ret = syncInfoRepository.SyncPatientInfoAndInHospitalByInpNo(inpNo).Data; if (!string.IsNullOrEmpty(ret)) { MessageBoxFormPC.Show(ret); } } btnSave.Enabled = true; if (inpNo != "") { List <MED_PAT_VISIT> patVisitList = operationInfoRepository.GetPatVisitListByInpNo(inpNo).Data; dtScheduledTime.EditValue = DateTime.Now.Date.AddHours(DateTime.Now.Hour).AddMinutes(DateTime.Now.Minute); if (patVisitList != null && patVisitList.Count > 0) { MED_PAT_VISIT patRow = patVisitList[0]; txtPatientID.Text = patRow.PATIENT_ID; MED_PAT_MASTER_INDEX patMaster = operationInfoRepository.GetPatMasterIndex(patRow.PATIENT_ID).Data; txtPatName.Text = patMaster.NAME; txtPatSex.Text = patMaster.SEX; if (patMaster.DATE_OF_BIRTH.HasValue) { dtBirthDay.EditValue = patMaster.DATE_OF_BIRTH.Value; } else { dtBirthDay.EditValue = null; } } MED_PATS_IN_HOSPITAL patsHospital = operationInfoRepository.GetPatsInHospital(inpNo).Data; if (patsHospital != null) { txtBedNo.Text = patsHospital.BED_NO; txtDeptCode.SetData(patsHospital.DEPT_CODE); if (txtDeptCode.Data != null) { List <MED_DEPT_DICT> dataTable = ExtendApplicationContext.Current.CommDict.DeptDict.Where(x => x.DEPT_CODE == patsHospital.DEPT_CODE).ToList(); if (dataTable != null && dataTable.Count > 0) { txtDeptCode.Text = dataTable[0].DEPT_NAME; } } txtConcultation.Text = patsHospital.DIAGNOSIS; } } }
/// <summary> /// 载入数据 /// </summary> public override void LoadData() { _masterRow = AnesInfoService.ClientInstance.GetOperationMaster(ExtendAppContext.Current.PatientInformationExtend.PATIENT_ID, ExtendAppContext.Current.PatientInformationExtend.VISIT_ID, ExtendAppContext.Current.PatientInformationExtend.OPER_ID); if (_masterRow != null && !string.IsNullOrEmpty(_masterRow.PATIENT_ID)) { _anesInputData = CareDocService.ClientInstance.GetAnesthestaInputData(_masterRow.PATIENT_ID, _masterRow.VISIT_ID, _masterRow.OPER_ID); _patsInHospitalRow = AnesInfoService.ClientInstance.GetPatsInHospitalListByID(_masterRow.PATIENT_ID).OrderByDescending(c => c.VISIT_ID).ToList().First(); _patMasterIndexRow = AnesInfoService.ClientInstance.GetPatMasterIndex(_masterRow.PATIENT_ID).First(); OPER_ROOM_NO = _masterRow.OPER_ROOM_NO; SEQUENCE = _masterRow.SEQUENCE; PATIENT_ID = _masterRow.PATIENT_ID; INP_NO = _patsInHospitalRow.INP_NO; NAME = _patMasterIndexRow.NAME; SEX = _patMasterIndexRow.SEX; DATE_OF_BIRTH = _patMasterIndexRow.DATE_OF_BIRTH; BED_NO = _masterRow.BED_NO; DEPT_NAME = _masterRow.DEPT_NAME; AGE = DateDiff.CalAge((DateTime)_patMasterIndexRow.DATE_OF_BIRTH, _masterRow.SCHEDULED_DATE_TIME.Value); CANCELED_TYPE = _anesInputData.CANCELED_TYPE == "1" ? true : false; SPINAL_ANES_COMP = _anesInputData.SPINAL_ANES_COMP == 1 ? true : false; CONS_DISTURBANCE = _anesInputData.CONS_DISTURBANCE == 1 ? true : false; RES_TRACT_OBSTRUCE = _anesInputData.RES_TRACT_OBSTRUCE == 1 ? true : false; TRACHEA_6H = _anesInputData.TRACHEA_6H == 1 ? true : false; CENTRAL_VENOUS = _anesInputData.CENTRAL_VENOUS == 1 ? true : false; OXYGEN_SATURATION = _anesInputData.OXYGEN_SATURATION == 1 ? true : false; AFTER_ANES_COMA = _anesInputData.AFTER_ANES_COMA == 1 ? true : false; ANES_ANAPHYLAXIS = _anesInputData.ANES_ANAPHYLAXIS == 1 ? true : false; TRACHEA_HOARSE = _anesInputData.TRACHEA_HOARSE == 1 ? true : false; ANES_DEATH = _anesInputData.ANES_DEATH == 1 ? true : false; PACU_3H = _anesInputData.PACU_3H == "1" ? true : false; PACU_TEMPERATURE = _anesInputData.PACU_TEMPERATURE == 1 ? true : false; NO_PLAN_IN_ICU = _anesInputData.NO_PLAN_IN_ICU == 1 ? true : false; BLOOD_EVENT = _anesInputData.BLOOD_EVENT == 1 ? true : false; OPER_EVENT = _anesInputData.OPER_EVENT == 1 ? true : false; ANES_EVENT = _anesInputData.ANES_EVENT == 1 ? true : false; PAT_INDETIFICATION = _anesInputData.PAT_INDETIFICATION == 1 ? true : false; OTHER_EVENT = _anesInputData.OTHER_EVENT == 1 ? true : false; this.TRACHEA_REMOVE = _anesInputData.TRACHEA_REMOVE == 1 ? true : false; this.ANES_START_24H_DEATH = _anesInputData.ANES_START_24H_DEATH == 1 ? true : false; this.ANES_START_24H_STOP = _anesInputData.ANES_START_24H_STOP == 1 ? true : false; UNEXPECT_EVENT_REASON = _anesInputData.UNEXPECT_EVENT_REASON; PREVENT_STEP = _anesInputData.PREVENT_STEP; EVENT_COURSE = _anesInputData.EVENT_COURSE; } }
/// <summary> /// 载入数据 /// </summary> public override void LoadData() { try { if (string.IsNullOrEmpty(ExtendAppContext.Current.PatientInformationExtend.PATIENT_ID)) { return; } _masterRow = AnesInfoService.ClientInstance.GetOperationMaster(ExtendAppContext.Current.PatientInformationExtend.PATIENT_ID, ExtendAppContext.Current.PatientInformationExtend.VISIT_ID, ExtendAppContext.Current.PatientInformationExtend.OPER_ID); if (_masterRow != null && !string.IsNullOrEmpty(_masterRow.PATIENT_ID)) { _patsInHospitalRow = AnesInfoService.ClientInstance.GetPatsInHospitalListByID(_masterRow.PATIENT_ID).OrderByDescending(c => c.VISIT_ID).ToList().First(); _patMasterIndexRow = AnesInfoService.ClientInstance.GetPatMasterIndex(_masterRow.PATIENT_ID).First(); _anesthesiaPlanRow = AnesInfoService.ClientInstance.GetAnesthesiaPlan(_masterRow.PATIENT_ID, _masterRow.VISIT_ID, _masterRow.OPER_ID).First(); OPER_ROOM_NO = _masterRow.OPER_ROOM_NO; SEQUENCE = _masterRow.SEQUENCE; PATIENT_ID = _masterRow.PATIENT_ID; INP_NO = _patsInHospitalRow.INP_NO; NAME = _patMasterIndexRow.NAME; SEX = _patMasterIndexRow.SEX; DATE_OF_BIRTH = _patMasterIndexRow.DATE_OF_BIRTH; BED_NO = _masterRow.BED_NO; operStatusCode = _masterRow.OPER_STATUS_CODE; AGE = DateDiff.CalAge((DateTime)_patMasterIndexRow.DATE_OF_BIRTH, _masterRow.SCHEDULED_DATE_TIME.Value); TitleText = string.Format("编辑{0}时间", ViewFlag); SetOperStatusEnable(); SetOperStatusDate(); } } catch (Exception ex) { Logger.Error("获取患者信息发生异常", ex); ShowMessageBox(ex.Message, MessageBoxButton.OK, MessageBoxImage.Error); } }
public RequestResult <MED_PATS_IN_HOSPITAL> GetOpeartionMaster(string inpNo) { //获取系统配置是否根据住院号同步 bool IsSyncByInpNo = Convert.ToBoolean(sysConfig.GetFromConfigTable("IsSyncByInpNo")); string result = ""; if (IsSyncByInpNo) { result = sysConfig.SyncPatientInfoAndInHospitalByInpNo(inpNo); } else { result = sysConfig.SyncPatientInfoAndInHospital(inpNo); } MED_PATS_IN_HOSPITAL patModel = new MED_PATS_IN_HOSPITAL(); //同步成功获取 if (result == "") { if (IsSyncByInpNo) { patModel = AnesInfo.GetPatsInHospitalListByInpNo(inpNo)[0]; } else { patModel = AnesInfo.GetPatsInHospitalListByID(inpNo)[0]; } } else { return(Success(patModel)); } return(Success(patModel)); }
protected override void OnSaveData(Dictionary <string, DataTable> dataSource) { List <MED_OPERATION_MASTER> operMasterList = ModelHelper <MED_OPERATION_MASTER> .ConvertDataTableToList(dataSource["MED_OPERATION_MASTER"]); MED_OPERATION_MASTER operMaster = null; if (operMasterList != null && operMasterList.Count > 0) { operMaster = operMasterList[0]; } List <MED_PAT_MASTER_INDEX> patIndexList = ModelHelper <MED_PAT_MASTER_INDEX> .ConvertDataTableToList(dataSource["MED_PAT_MASTER_INDEX"]); MED_PAT_MASTER_INDEX patMasterIndex = null; if (patIndexList != null && patIndexList.Count > 0) { patMasterIndex = patIndexList[0]; } List <MED_PAT_VISIT> patVisitList = ModelHelper <MED_PAT_VISIT> .ConvertDataTableToList(dataSource["MED_PAT_VISIT"]); MED_PAT_VISIT patVisit = null; if (patVisitList != null && patVisitList.Count > 0) { patVisit = patVisitList[0]; } List <MED_ANESTHESIA_PLAN> anesPlanList = ModelHelper <MED_ANESTHESIA_PLAN> .ConvertDataTableToList(dataSource["MED_ANESTHESIA_PLAN"]); MED_ANESTHESIA_PLAN anesPlan = null; if (anesPlanList != null && anesPlanList.Count > 0) { anesPlan = anesPlanList[0]; } List <MED_ANESTHESIA_PLAN_PMH> anesPlanPMHList = ModelHelper <MED_ANESTHESIA_PLAN_PMH> .ConvertDataTableToList(dataSource["MED_ANESTHESIA_PLAN_PMH"]); MED_ANESTHESIA_PLAN_PMH anesPlanPMH = null; if (anesPlanPMHList != null && anesPlanPMHList.Count > 0) { anesPlanPMH = anesPlanPMHList[0]; } List <MED_PREOPERATIVE_EXPANSION> preExpansion = ModelHelper <MED_PREOPERATIVE_EXPANSION> .ConvertDataTableToList(dataSource["MED_PREOPERATIVE_EXPANSION"]); List <MED_SAFETY_CHECKS> safetyCheck = ModelHelper <MED_SAFETY_CHECKS> .ConvertDataTableToList(dataSource["MED_SAFETY_CHECKS"]); if (safetyCheck != null && safetyCheck.Count > 0) { operationInfoRepository.SaveSafetyCheck(safetyCheck[0]); } List <MED_OPER_RISK_ESTIMATE> riskEstimate = ModelHelper <MED_OPER_RISK_ESTIMATE> .ConvertDataTableToList(dataSource["MED_OPER_RISK_ESTIMATE"]); if (riskEstimate != null && riskEstimate.Count > 0) { operationInfoRepository.SaveRickEstimate(riskEstimate[0]); } //OperationInfoService.SaveMedicalBasicDoc(operMaster, patIndex, patVisit, null, anesPlan, null, anesPlanPMH, null, null, preExpansion); MED_PATS_IN_HOSPITAL patsInHospital = null; MED_ANESTHESIA_PLAN_EXAM anesPlanExam = null; MED_ANESTHESIA_PLAN_PMH anesPlanPmh = null; List <MED_OPERATION_EXTENDED> operExtended = null; List <MED_POSTOPERATIVE_EXTENDED> postExtended = null; operationInfoRepository.SaveMedicalBasicDoc(new { operMaster, patMasterIndex, patVisit, patsInHospital, anesPlan, anesPlanExam, anesPlanPmh, operExtended, postExtended, preExpansion }); }
protected override void OnSaveData(Dictionary <string, DataTable> dataSource) { #region 手术清点单添加多表格功能 List <MED_QIXIE_QINGDIAN> dataTable = ModelHelper <MED_QIXIE_QINGDIAN> .ConvertDataTableToList(dataSource["MED_QIXIE_QINGDIAN"]); MED_QIXIE_QINGDIAN row = null; string patientID = ExtendApplicationContext.Current.PatientContextExtend.PatientID; int visitID = ExtendApplicationContext.Current.PatientContextExtend.VisitID; int operID = ExtendApplicationContext.Current.PatientContextExtend.OperID; if (dataTable == null) { dataTable = operationInfoRepository.GetOperCheckList(patientID, visitID, operID).Data; } List <MedGridView> grids = base.GetControls <MedGridView>(); foreach (MedGridView grid in grids) { for (int i = 0; i < grid.RowCount; i++) { for (int j = 0; j < grid.ColumnCount; j++) { DataGridViewCell cell = grid[j, i]; List <MED_QIXIE_QINGDIAN> rows = null; rows = dataTable.Where(x => x.PATIENT_ID == patientID && x.VISIT_ID == visitID && x.OPER_ID == operID && x.X_POSITION == j && x.Y_POSITION == i && x.TABLETAG == grid.Name).ToList(); if (rows != null && rows.Count > 0) { row = rows[0]; } else { row = null; } string celltext = string.Empty; if (cell.Value != null && !string.IsNullOrEmpty(cell.Value.ToString().Trim())) { celltext = cell.Value.ToString().Trim(); } if (string.IsNullOrEmpty(celltext)) { if (row != null) { row.POSITION_VALUE = ""; } } else { if (row == null) { row = new MED_QIXIE_QINGDIAN(); row.PATIENT_ID = patientID; row.VISIT_ID = visitID; row.OPER_ID = operID; row.X_POSITION = j; row.Y_POSITION = i; row.TABLETAG = grid.Name; dataTable.Add(row); } row.POSITION_VALUE = celltext; } } } } #endregion List <MED_OPERATION_MASTER> operMasterList = ModelHelper <MED_OPERATION_MASTER> .ConvertDataTableToList(dataSource["MED_OPERATION_MASTER"]); MED_OPERATION_MASTER operMaster = null; if (operMasterList != null && operMasterList.Count > 0) { operMaster = operMasterList[0]; } List <MED_PAT_MASTER_INDEX> patIndexList = ModelHelper <MED_PAT_MASTER_INDEX> .ConvertDataTableToList(dataSource["MED_PAT_MASTER_INDEX"]); MED_PAT_MASTER_INDEX patMasterIndex = null; if (patIndexList != null && patIndexList.Count > 0) { patMasterIndex = patIndexList[0]; } List <MED_PAT_VISIT> patVisitList = ModelHelper <MED_PAT_VISIT> .ConvertDataTableToList(dataSource["MED_PAT_VISIT"]); MED_PAT_VISIT patVisit = null; if (patVisitList != null && patVisitList.Count > 0) { patVisit = patVisitList[0]; } List <MED_OPERATION_EXTENDED> operExtended = ModelHelper <MED_OPERATION_EXTENDED> .ConvertDataTableToList(dataSource["MED_OPERATION_EXTENDED"]); List <MED_POSTOPERATIVE_EXTENDED> postExtended = ModelHelper <MED_POSTOPERATIVE_EXTENDED> .ConvertDataTableToList(dataSource["MED_POSTOPERATIVE_EXTENDED"]); List <MED_PREOPERATIVE_EXPANSION> preExpansion = ModelHelper <MED_PREOPERATIVE_EXPANSION> .ConvertDataTableToList(dataSource["MED_POSTOPERATIVE_EXTENDED"]); List <MED_QIXIE_QINGDIAN> operCheck = dataTable; if (operCheck != null) { operationInfoRepository.SaveOperCheckList(operCheck); } //OperationInfoService.SaveMedicalBasicDoc(operMaster, patIndex, patVisit, null, null, null, null, operExtended, postExtended, preExpansion); MED_PATS_IN_HOSPITAL patsInHospital = null; MED_ANESTHESIA_PLAN anesPlan = null; MED_ANESTHESIA_PLAN_EXAM anesPlanExam = null; MED_ANESTHESIA_PLAN_PMH anesPlanPmh = null; operationInfoRepository.SaveMedicalBasicDoc(new { operMaster, patMasterIndex, patVisit, patsInHospital, anesPlan, anesPlanExam, anesPlanPmh, operExtended, postExtended, preExpansion }); }
/// <summary> /// 载入数据 /// </summary> public override void LoadData() { string pid = ""; int visitID = 1; int operID = 1; pid = ExtendAppContext.Current.PatientInformationExtend.PATIENT_ID; visitID = ExtendAppContext.Current.PatientInformationExtend.VISIT_ID; operID = ExtendAppContext.Current.PatientInformationExtend.OPER_ID; _masterRow = AnesInfoService.ClientInstance.GetOperationMaster(pid, visitID, operID); if (_masterRow != null) { try { _patsInHospitalRow = AnesInfoService.ClientInstance.GetPatsInHospitalListByID(_masterRow.PATIENT_ID).OrderByDescending(c => c.VISIT_ID).ToList().First(); _patMasterIndexRow = AnesInfoService.ClientInstance.GetPatMasterIndex(_masterRow.PATIENT_ID).First(); _anesthesiaPlanRow = AnesInfoService.ClientInstance.GetAnesthesiaPlan(_masterRow.PATIENT_ID, _masterRow.VISIT_ID, _masterRow.OPER_ID).First(); } catch (Exception ex) { Logger.Error("获取患者基本信息异常", ex); ShowMessageBox(ex.Message, MessageBoxButton.OK, MessageBoxImage.Error); } OPER_ROOM_NO = _masterRow.OPER_ROOM_NO; if (!CanChangeOperRoomNo()) { IsOperRoomEnable = false; } SEQUENCE = _masterRow.SEQUENCE; PATIENT_ID = _masterRow.PATIENT_ID; INP_NO = _patsInHospitalRow.INP_NO; NAME = _patMasterIndexRow.NAME; SEX = _patMasterIndexRow.SEX; DATE_OF_BIRTH = _patMasterIndexRow.DATE_OF_BIRTH; BED_NO = _masterRow.BED_NO; DEPT_CODE = _masterRow.DEPT_CODE; DIAG_BEFORE_OPERATION = _masterRow.DIAG_BEFORE_OPERATION; // 手术名称 (新分隔符) if (!string.IsNullOrEmpty(_masterRow.OPERATION_NAME)) { string[] operNameArray = _masterRow.OPERATION_NAME.Split(new string[] { CommonSplit }, StringSplitOptions.RemoveEmptyEntries); OPERATION_NAME = new ObservableCollection <string>(operNameArray); } else if (OPERATION_NAME != null) { OPERATION_NAME.Clear(); } else { OPERATION_NAME = new ObservableCollection <string>(); } OPER_SCALE = _masterRow.OPER_SCALE; OPER_POSITION = _masterRow.OPER_POSITION; EMERGENCY_IND = _masterRow.EMERGENCY_IND; ISOLATION_IND = _masterRow.ISOLATION_IND; RADIATE_IND = _masterRow.RADIATE_IND; PATIENT_CONDITION = _masterRow.PATIENT_CONDITION; if (this.isAfterOperInfo) { IN_DATE_TIME = _masterRow.IN_DATE_TIME; // == null ? DateTime.Now : _masterRow.IN_DATE_TIME; START_DATE_TIME = _masterRow.START_DATE_TIME; // == null ? DateTime.Now : _masterRow.START_DATE_TIME; END_DATE_TIME = _masterRow.END_DATE_TIME; // == null ? DateTime.Now : _masterRow.END_DATE_TIME; OUT_DATE_TIME = _masterRow.OUT_DATE_TIME; //== null ? DateTime.Now : _masterRow.OUT_DATE_TIME; } #region 人员特殊处理 SURGEON = _masterRow.SURGEON; if (!ExistsUser(_masterRow.SURGEON)) { SURGEON_NAME = _masterRow.SURGEON; } FIRST_OPER_ASSISTANT = _masterRow.FIRST_OPER_ASSISTANT; if (!ExistsUser(_masterRow.FIRST_OPER_ASSISTANT)) { FIRST_OPER_ASSISTANT_NAME = _masterRow.FIRST_OPER_ASSISTANT; } SECOND_OPER_ASSISTANT = _masterRow.SECOND_OPER_ASSISTANT; if (!ExistsUser(_masterRow.SECOND_OPER_ASSISTANT)) { SECOND_OPER_ASSISTANT_NAME = _masterRow.SECOND_OPER_ASSISTANT; } CPB_DOCTOR = _masterRow.CPB_DOCTOR; if (!ExistsUser(_masterRow.CPB_DOCTOR)) { CPB_DOCTOR_NAME = _masterRow.CPB_DOCTOR; } FIRST_CPB_ASSISTANT = _masterRow.FIRST_CPB_ASSISTANT; if (!ExistsUser(_masterRow.FIRST_CPB_ASSISTANT)) { FIRST_CPB_ASSISTANT_NAME = _masterRow.FIRST_CPB_ASSISTANT; } FIRST_OPER_NURSE = _masterRow.FIRST_OPER_NURSE; if (!ExistsNurse(_masterRow.FIRST_OPER_NURSE)) { FIRST_OPER_NURSE_NAME = _masterRow.FIRST_OPER_NURSE; } SECOND_OPER_NURSE = _masterRow.SECOND_OPER_NURSE; if (!ExistsNurse(_masterRow.SECOND_OPER_NURSE)) { SECOND_OPER_NURSE_NAME = _masterRow.SECOND_OPER_NURSE; } FIRST_SUPPLY_NURSE = _masterRow.FIRST_SUPPLY_NURSE; if (!ExistsNurse(_masterRow.FIRST_SUPPLY_NURSE)) { FIRST_SUPPLY_NURSE_NAME = _masterRow.FIRST_SUPPLY_NURSE; } SECOND_SUPPLY_NURSE = _masterRow.SECOND_SUPPLY_NURSE; if (!ExistsNurse(_masterRow.SECOND_SUPPLY_NURSE)) { SECOND_SUPPLY_NURSE_NAME = _masterRow.SECOND_SUPPLY_NURSE; } ANES_DOCTOR = _masterRow.ANES_DOCTOR; if (!ExistsDoctor(_masterRow.ANES_DOCTOR)) { ANES_DOCTOR_NAME = _masterRow.ANES_DOCTOR; } FIRST_ANES_ASSISTANT = _masterRow.FIRST_ANES_ASSISTANT; if (!ExistsDoctor(_masterRow.FIRST_ANES_ASSISTANT)) { FIRST_ANES_ASSISTANT_NAME = _masterRow.FIRST_ANES_ASSISTANT; } SECOND_ANES_ASSISTANT = _masterRow.SECOND_ANES_ASSISTANT; if (!ExistsDoctor(_masterRow.SECOND_ANES_ASSISTANT)) { SECOND_ANES_ASSISTANT_NAME = _masterRow.SECOND_ANES_ASSISTANT; } THIRD_ANES_ASSISTANT = _masterRow.THIRD_ANES_ASSISTANT; if (!ExistsDoctor(_masterRow.THIRD_ANES_ASSISTANT)) { THIRD_ANES_ASSISTANT_NAME = _masterRow.THIRD_ANES_ASSISTANT; } #endregion // 麻醉方法(多选) //if (!string.IsNullOrEmpty(_masterRow.ANES_METHOD)) //{ // string[] anesMethod = _masterRow.ANES_METHOD.Split(new string[] { CommonSplit }, // StringSplitOptions.RemoveEmptyEntries); // ANES_METHOD = new ObservableCollection<string>(anesMethod); //} //else if (ANES_METHOD != null) //{ // ANES_METHOD.Clear(); //} //else //{ // ANES_METHOD = new ObservableCollection<string>(); //} ANES_METHOD_NAME = _masterRow.ANES_METHOD; ANAESTHESIA_TYPE = _masterRow.ANAESTHESIA_TYPE; ASA_GRADE = _masterRow.ASA_GRADE; WOUND_TYPE = _masterRow.WOUND_TYPE; RETURN_TO_SURGERY = _anesthesiaPlanRow.RETURN_TO_SURGERY; PLAN_WHEREABORTS = _anesthesiaPlanRow.PLAN_WHEREABORTS; DEPT_NAME = _masterRow.DEPT_NAME; AGE = DateDiff.CalAge((DateTime)_patMasterIndexRow.DATE_OF_BIRTH, _masterRow.SCHEDULED_DATE_TIME.Value); this.MINIMAL_INVASIVE = _masterRow.MINIMAL_INVASIVE; this.LOCAL_ANESTHESIA = _masterRow.LOCAL_ANESTHESIA; } }
protected override void OnSaveData(Dictionary <string, DataTable> dataSource) { List <MED_OPERATION_MASTER> operMasterList = ModelHelper <MED_OPERATION_MASTER> .ConvertDataTableToList(dataSource["MED_OPERATION_MASTER"]); MED_OPERATION_MASTER operMaster = null; if (operMasterList != null && operMasterList.Count > 0) { operMaster = operMasterList[0]; } List <MED_PAT_MASTER_INDEX> patIndexList = ModelHelper <MED_PAT_MASTER_INDEX> .ConvertDataTableToList(dataSource["MED_PAT_MASTER_INDEX"]); MED_PAT_MASTER_INDEX patMasterIndex = null; if (patIndexList != null && patIndexList.Count > 0) { patMasterIndex = patIndexList[0]; } List <MED_PAT_VISIT> patVisitList = ModelHelper <MED_PAT_VISIT> .ConvertDataTableToList(dataSource["MED_PAT_VISIT"]); MED_PAT_VISIT patVisit = null; if (patVisitList != null && patVisitList.Count > 0) { patVisit = patVisitList[0]; } List <MED_OPERATION_EXTENDED> operExtended = ModelHelper <MED_OPERATION_EXTENDED> .ConvertDataTableToList(dataSource["MED_OPERATION_EXTENDED"]); List <MED_POSTOPERATIVE_EXTENDED> postExtended = ModelHelper <MED_POSTOPERATIVE_EXTENDED> .ConvertDataTableToList(dataSource["MED_POSTOPERATIVE_EXTENDED"]); List <MED_OPERATION_ANALGESIC_MASTER> analgesicMaster = ModelHelper <MED_OPERATION_ANALGESIC_MASTER> .ConvertDataTableToList(dataSource["MED_OPERATION_ANALGESIC_MASTER"]); if (analgesicMaster != null && analgesicMaster.Count > 0) { operationInfoRepository.SaveAnalgesicMaster(analgesicMaster[0]); } List <MED_OPER_ANALGESIC_MEDICINE> analgesicMedicine = ModelHelper <MED_OPER_ANALGESIC_MEDICINE> .ConvertDataTableToList(dataSource["MED_OPER_ANALGESIC_MEDICINE"]); if (analgesicMedicine != null) { operationInfoRepository.SaveAnalgesicMedicineList(analgesicMedicine); } List <MED_OPER_ANALGESIC_TOTAL> analgesicTotal = ModelHelper <MED_OPER_ANALGESIC_TOTAL> .ConvertDataTableToList(dataSource["MED_OPER_ANALGESIC_TOTAL"]); if (analgesicTotal != null) { operationInfoRepository.SaveAnalgesicTotalList(analgesicTotal); } //OperationInfoService.SaveMedicalBasicDoc(operMaster, patIndex, patVisit, null, null, null, null, operExtended, postExtended, null); MED_PATS_IN_HOSPITAL patsInHospital = null; MED_ANESTHESIA_PLAN anesPlan = null; MED_ANESTHESIA_PLAN_EXAM anesPlanExam = null; MED_ANESTHESIA_PLAN_PMH anesPlanPmh = null; List <MED_PREOPERATIVE_EXPANSION> preExpansion = null; operationInfoRepository.SaveMedicalBasicDoc(new { operMaster, patMasterIndex, patVisit, patsInHospital, anesPlan, anesPlanExam, anesPlanPmh, operExtended, postExtended, preExpansion }); }
private void SyncPatientByPatientId(string patientID) { if (!string.IsNullOrEmpty(patientID)) { if (ExtendApplicationContext.Current.IsSync) { string ret = ""; ret = syncInfoRepository.SyncPatientInfoAndInHospital(patientID).Data; ret += syncInfoRepository.SyncScheduleInfo(patientID, serverTime).Data; if (!string.IsNullOrEmpty(ret)) { MessageBoxFormPC.Show(ret); } } } emptyInpNoOrPatID = false; bool flag = true; if (patientID != "") { patMasterIndex = operationInfoRepository.GetPatMasterIndex(patientID).Data; List <MED_PAT_VISIT> patVisitList = operationInfoRepository.GetPatVisitList(patientID).Data; if (patVisitList != null && patVisitList.Count > 0) { flag = flag & false; patVisit = patVisitList[0]; visitID = Convert.ToInt32(patVisitList[0].GetValue("VISIT_ID")); } else { flag = flag & true; patVisit = new MED_PAT_VISIT(); visitID = 1; patVisit.SetValue("PATIENT_ID", patientID); } if (patMasterIndex == null) { flag = flag & true; patMasterIndex = new MED_PAT_MASTER_INDEX(); patMasterIndex.SetValue("PATIENT_ID", patientID); emptyInpNoOrPatID = flag; BindData(); MessageBoxFormPC.Show("当前输入患者ID,需要手动输入患者信息进行急诊登记", "系统提示"); // return; } operScheduleList = operationInfoRepository.GetOperScheduleList(patientID, visitID).Data.Where(x => x.SCHEDULED_DATE_TIME.Value >= serverTime & x.OPER_STATUS_CODE == 0).ToList(); patInHospital = operationInfoRepository.GetPatsInHospitalByID(patientID, visitID).Data; GetScheduleOperInfo(); if (scheduleOperInfoDT != null && scheduleOperInfoDT.Rows.Count > 0) { BindGridViewData(dgvScheduleOperInfo, scheduleOperInfoDT); } List <MED_OPERATION_MASTER> operMasterList = operationInfoRepository.GetOperMasterList(patientID, visitID).Data; if (operMasterList != null && operMasterList.Count > 0) { operID = Convert.ToInt32(operMasterList[0].GetValue("OPER_ID")) + 1; } operationMaster = new MED_OPERATION_MASTER(); operationMaster.PATIENT_ID = patientID; operationMaster.VISIT_ID = visitID; operationMaster.OPER_ID = operID; BindData(); } }
private List <KeyValue> GetFieldNames(string tableName) { List <KeyValue> list = new List <KeyValue>(); DataTable dataTable = new DataTable(); if (tableName.ToUpper().Trim().Equals("MED_OPERATION_MASTER")) { MED_OPERATION_MASTER master = new MED_OPERATION_MASTER(); foreach (string column in master.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPERATION_MASTER_EXT")) { MED_OPERATION_MASTER_EXT ext = new MED_OPERATION_MASTER_EXT(); foreach (string column in ext.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_PAT_MASTER_INDEX")) { MED_PAT_MASTER_INDEX tmp = new MED_PAT_MASTER_INDEX(); foreach (string column in tmp.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_PATS_IN_HOSPITAL")) { MED_PATS_IN_HOSPITAL pats = new MED_PATS_IN_HOSPITAL(); foreach (string column in pats.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_RECOVER")) { MED_ANESTHESIA_RECOVER tmp = new MED_ANESTHESIA_RECOVER(); foreach (string column in tmp.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_INQUIRY")) { MED_ANESTHESIA_INQUIRY tmp = new MED_ANESTHESIA_INQUIRY(); foreach (string column in tmp.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_SAFETY_CHECKS")) { MED_SAFETY_CHECKS safety = new MED_SAFETY_CHECKS(); foreach (string column in safety.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_PAT_VISIT")) { MED_PAT_VISIT visit = new MED_PAT_VISIT(); foreach (string column in visit.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_PLAN")) { MED_ANESTHESIA_PLAN plan = new MED_ANESTHESIA_PLAN(); foreach (string column in plan.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_PLAN_EXAM")) { MED_ANESTHESIA_PLAN_EXAM plan = new MED_ANESTHESIA_PLAN_EXAM(); foreach (string column in plan.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_PLAN_PMH")) { MED_ANESTHESIA_PLAN_PMH plan = new MED_ANESTHESIA_PLAN_PMH(); foreach (string column in plan.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_HIS_USERS")) { MED_HIS_USERS users = new MED_HIS_USERS(); foreach (string column in users.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_DEPT_DICT")) { MED_DEPT_DICT dept = new MED_DEPT_DICT(); foreach (string column in dept.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_DIAGNOSIS_DICT")) { MED_DIAGNOSIS_DICT dept = new MED_DIAGNOSIS_DICT(); foreach (string column in dept.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPERATION_DICT")) { MED_OPERATION_DICT dept = new MED_OPERATION_DICT(); foreach (string column in dept.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_DICT")) { MED_ANESTHESIA_DICT dept = new MED_ANESTHESIA_DICT(); foreach (string column in dept.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPERATING_ROOM")) { MED_OPERATING_ROOM dept = new MED_OPERATING_ROOM(); foreach (string column in dept.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_PREOPERATIVE_EXPANSION")) { MED_PREOPERATIVE_EXPANSION row = new MED_PREOPERATIVE_EXPANSION(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPERATION_EXTENDED")) { MED_OPERATION_EXTENDED row = new MED_OPERATION_EXTENDED(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_POSTOPERATIVE_EXTENDED")) { MED_POSTOPERATIVE_EXTENDED row = new MED_POSTOPERATIVE_EXTENDED(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_PACU_SORCE")) { MED_PACU_SORCE row = new MED_PACU_SORCE(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPERATION_ANALGESIC_MASTER")) { MED_OPERATION_ANALGESIC_MASTER row = new MED_OPERATION_ANALGESIC_MASTER(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPER_ANALGESIC_MEDICINE")) { MED_OPER_ANALGESIC_MEDICINE row = new MED_OPER_ANALGESIC_MEDICINE(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPER_ANALGESIC_TOTAL")) { MED_OPER_ANALGESIC_TOTAL row = new MED_OPER_ANALGESIC_TOTAL(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPER_RISK_ESTIMATE")) { MED_OPER_RISK_ESTIMATE row = new MED_OPER_RISK_ESTIMATE(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_INPUT_DICT")) { MED_ANESTHESIA_INPUT_DICT row = new MED_ANESTHESIA_INPUT_DICT(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_INPUT_DATA")) { MED_ANESTHESIA_INPUT_DATA row = new MED_ANESTHESIA_INPUT_DATA(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } if (!string.IsNullOrEmpty(_tableName)) { foreach (DataRow row in dataTable.Rows) { list.Add(new KeyValue(row[_codeField].ToString(), row[_nameField].ToString())); } } else { foreach (DataColumn column in dataTable.Columns) { list.Add(new KeyValue(GetFieldAlias(column.ColumnName), column.ColumnName)); } } return(list); }
protected override void OnSaveData(Dictionary <string, DataTable> dataSource) { if (isRoomnoORSequenceChanged) { Dialog.MessageBox("温馨提示:修改手术间号和台次将会影响当前已安排手术,请结合实际情况修改。"); } base.OnSaveData(dataSource); List <MED_OPERATION_MASTER> operMasterList = ModelHelper <MED_OPERATION_MASTER> .ConvertDataTableToList(dataSource["MED_OPERATION_MASTER"]); MED_OPERATION_MASTER operationMaster = null; if (operMasterList != null && operMasterList.Count > 0) { operationMaster = operMasterList[0]; } List <MED_PAT_MASTER_INDEX> patIndexList = ModelHelper <MED_PAT_MASTER_INDEX> .ConvertDataTableToList(dataSource["MED_PAT_MASTER_INDEX"]); MED_PAT_MASTER_INDEX patMasterIndex = null; if (patIndexList != null && patIndexList.Count > 0) { patMasterIndex = patIndexList[0]; } //OperationInfoService.SaveMedicalBasicDoc(operationMaster, patIndex, null, null, null, null, null, null, null, null); MED_PATS_IN_HOSPITAL patsInHospital = null; MED_ANESTHESIA_PLAN anesPlan = null; MED_ANESTHESIA_PLAN_EXAM anesPlanExam = null; MED_ANESTHESIA_PLAN_PMH anesPlanPmh = null; List <MED_OPERATION_EXTENDED> operExtended = null; List <MED_POSTOPERATIVE_EXTENDED> postExtended = null; List <MED_PREOPERATIVE_EXPANSION> preExpansion = null; MED_PAT_VISIT patVisit = null; operationInfoRepository.SaveMedicalBasicDoc(new { operationMaster, patMasterIndex, patVisit, patsInHospital, anesPlan, anesPlanExam, anesPlanPmh, operExtended, postExtended, preExpansion }); if (ExtendApplicationContext.Current.PatientInformationExtend.OPER_ROOM_NO != operationMaster.OPER_ROOM_NO) { ExtendApplicationContext.Current.PatientInformationExtend.OPER_ROOM_NO = operationMaster.OPER_ROOM_NO; } if (operationMaster.SEQUENCE.HasValue && ExtendApplicationContext.Current.PatientInformationExtend.SEQUENCE != operationMaster.SEQUENCE) { ExtendApplicationContext.Current.PatientInformationExtend.SEQUENCE = operationMaster.SEQUENCE; } //台次 if (operationMaster.EMERGENCY_IND.HasValue && ExtendApplicationContext.Current.PatientInformationExtend.EMERGENCY_IND != operationMaster.EMERGENCY_IND) { ExtendApplicationContext.Current.PatientInformationExtend.EMERGENCY_IND = operationMaster.EMERGENCY_IND; } if (operationMaster.ISOLATION_IND.HasValue && ExtendApplicationContext.Current.PatientInformationExtend.ISOLATION_IND != operationMaster.EMERGENCY_IND) { ExtendApplicationContext.Current.PatientInformationExtend.ISOLATION_IND = operationMaster.ISOLATION_IND; } }
private void SyncPatientByInpNo(string inpNo) { //调用接口 if (!string.IsNullOrEmpty(inpNo)) { if (ExtendAppContext.CurntSelect.IsSync) { string ret = ""; ret = new SyncInfoService().SyncPatientInfoAndInHospitalByInpNo(inpNo); if (!string.IsNullOrEmpty(ret)) { MessageBoxFormPC.Show(ret); } } emptyInpNoOrPatID = false; bool flag = true; string patientID = string.Empty; List <MED_PAT_VISIT> patVisitList = OperationInfoService.GetPatVisitListByInpNo(inpNo); if (patVisitList != null && patVisitList.Count > 0) { flag = flag & false; patVisit = patVisitList[0]; visitID = Convert.ToInt32(patVisitList[0].GetValue("VISIT_ID")); patientID = patVisitList[0].PATIENT_ID; BindControls("MED_PAT_MASTER_INDEX", "PATIENT_ID", patientID); } else { flag = flag & true; patVisit = new MED_PAT_VISIT(); visitID = 1; patVisit.SetValue("INP_NO", inpNo); } if (ExtendAppContext.CurntSelect.IsSync) { string ret = new SyncInfoService().SyncPatientInfoAndInHospitalByInpNo(inpNo); if (!string.IsNullOrEmpty(ret)) { MessageBoxFormPC.Show(ret); } } patMasterIndex = OperationInfoService.GetPatMasterIndex(patientID); if (patMasterIndex == null) { flag = flag & true; patMasterIndex = new MED_PAT_MASTER_INDEX(); BindData(); emptyInpNoOrPatID = flag; MessageBoxFormPC.Show("当前输入患者ID,需要手动输入患者信息进行急诊登记", "系统提示"); // return; } operScheduleList = OperationInfoService.GetOperScheduleList(patientID, visitID).Where(x => x.SCHEDULED_DATE_TIME.Value >= serverTime & x.OPER_STATUS_CODE == 0).ToList(); patInHospital = OperationInfoService.GetPatsInHospitalByID(patientID, visitID); GetScheduleOperInfo(); if (scheduleOperInfoDT != null && scheduleOperInfoDT.Rows.Count > 0) { BindGridViewData(dgvScheduleOperInfo, scheduleOperInfoDT); } List <MED_OPERATION_MASTER> operMasterList = OperationInfoService.GetOperMasterList(patientID, visitID); if (operMasterList != null && operMasterList.Count > 0) { operID = Convert.ToInt32(operMasterList[0].GetValue("OPER_ID")) + 1; } operationMaster = new MED_OPERATION_MASTER(); operationMaster.PATIENT_ID = patientID; operationMaster.VISIT_ID = visitID; operationMaster.OPER_ID = operID; BindData(); } }
private void SyncPatientByPatientId(string patientID) { if (!string.IsNullOrEmpty(patientID)) { if (ExtendApplicationContext.Current.IsSync) { string ret = ""; ret = syncInfoRepository.SyncPatientInfoAndInHospital(patientID).Data; ret += syncInfoRepository.SyncScheduleInfo(patientID, accountRepository.GetServerTime().Data).Data; if (!string.IsNullOrEmpty(ret)) { MessageBoxFormPC.Show(ret); } } } bool flag = true; if (patientID != "") { patMasterIndex = operationInfoRepository.GetPatMasterIndex(patientID).Data; MED_PATS_IN_HOSPITAL patsInHospital = null; if (patMasterIndex == null) { patsInHospital = operationInfoRepository.GetPatsInHospital(patientID).Data; if (patsInHospital != null) { patientID = patsInHospital.PATIENT_ID; patMasterIndex = operationInfoRepository.GetPatMasterIndex(patientID).Data; } } List <MED_PAT_VISIT> patVisitList = operationInfoRepository.GetPatVisitList(patientID).Data; if (patVisitList != null && patVisitList.Count > 0) { flag = flag & false; patVisit = patVisitList[0]; _visitID = Convert.ToInt32(patVisitList[0].GetValue("VISIT_ID")); } else { flag = flag & true; patVisit = new MED_PAT_VISIT(); _visitID = 1; patVisit.SetValue("PATIENT_ID", patientID); } if (patMasterIndex == null) { flag = flag & true; patMasterIndex = new MED_PAT_MASTER_INDEX(); patMasterIndex.SetValue("PATIENT_ID", patientID); MessageBoxFormPC.Show("当前输入患者ID,需要手动输入患者信息进行急诊登记", "系统提示"); // return; } List <MED_OPERATION_MASTER> operMasterList = operationInfoRepository.GetOperMasterList(patientID, _visitID).Data; if (operMasterList != null && operMasterList.Count > 0) { _operID = Convert.ToInt32(operMasterList[0].GetValue("OPER_ID")) + 1; } operationMaster = new MED_OPERATION_MASTER(); operationMaster.PATIENT_ID = patientID; operationMaster.VISIT_ID = _visitID; operationMaster.OPER_ID = _operID; operationMaster.OPER_ROOM = ExtendApplicationContext.Current.OperRoom; operationMaster.OPER_ROOM_NO = ExtendApplicationContext.Current.OperRoomNo; operationMaster.HOSP_BRANCH = ExtendApplicationContext.Current.HospBranchCode; operationMaster.SCHEDULED_DATE_TIME = accountRepository.GetServerTime().Data; if (patsInHospital != null) { patVisit.INP_NO = patsInHospital.INP_NO; operationMaster.WARD_CODE = patsInHospital.WARD_CODE; operationMaster.DEPT_CODE = patsInHospital.WARD_CODE; operationMaster.BED_NO = patsInHospital.BED_NO; } else { patsInHospital = operationInfoRepository.GetPatsInHospitalByID(patientID, _visitID).Data; patVisit.INP_NO = patsInHospital.INP_NO; operationMaster.WARD_CODE = patsInHospital.WARD_CODE; operationMaster.DEPT_CODE = patsInHospital.WARD_CODE; operationMaster.BED_NO = patsInHospital.BED_NO; } ExtendApplicationContext.Current.MED_PAT_MASTER_INDEX = patMasterIndex; ExtendApplicationContext.Current.MED_OPERATION_MASTER = operationMaster; ExtendApplicationContext.Current.MED_PAT_VISIT = patVisit; anesPlan = new DocDataRepository().GetAnesthesiaPlan(_patientID, _visitID, _operID); _patientCard = new MED_PATIENT_CARD(); foreach (string column in _patientCard.GetPropsName()) { foreach (string col in patMasterIndex.GetPropsName()) { if (column == col) { _patientCard.SetValue(column, patMasterIndex.GetValue(col)); } } foreach (string col in operationMaster.GetPropsName()) { if (column == col) { _patientCard.SetValue(column, operationMaster.GetValue(col)); } } foreach (string col in patVisit.GetPropsName()) { if (column == col) { _patientCard.SetValue(column, patVisit.GetValue(col)); } } } } }
/// <summary> /// 载入患者信息 /// </summary> public override void LoadData() { string patientID = ""; int visitID = 1; int operID = 1; if (ExtendAppContext.Current.PatientInformationExtend != null) { patientID = ExtendAppContext.Current.PatientInformationExtend.PATIENT_ID; visitID = ExtendAppContext.Current.PatientInformationExtend.VISIT_ID; operID = ExtendAppContext.Current.PatientInformationExtend.OPER_ID; } _masterRow = AnesInfoService.ClientInstance.GetOperationMaster(patientID, visitID, operID); if (_masterRow != null) { _patsInHospitalRow = AnesInfoService.ClientInstance.GetPatsInHospitalListByID(patientID).OrderByDescending(c => c.VISIT_ID).ToList().First(); _patMasterIndexRow = AnesInfoService.ClientInstance.GetPatMasterIndex(patientID).First(); _anesthesiaPlanRow = AnesInfoService.ClientInstance.GetAnesthesiaPlan(patientID, visitID, operID).First(); _listOperName = CareDocService.ClientInstance.GetOperNameList(patientID, visitID, operID); OPER_ROOM_NO = _masterRow.OPER_ROOM_NO; SEQUENCE = _masterRow.SEQUENCE; PATIENT_ID = _masterRow.PATIENT_ID; INP_NO = _patsInHospitalRow.INP_NO; NAME = _patMasterIndexRow.NAME; SEX = _patMasterIndexRow.SEX; DATE_OF_BIRTH = _patMasterIndexRow.DATE_OF_BIRTH; BED_NO = _masterRow.BED_NO; DEPT_CODE = _masterRow.DEPT_CODE; DEPT_NAME = ""; IN_DATE_TIME = _masterRow.IN_DATE_TIME; DIAG_BEFORE_OPERATION = _masterRow.DIAG_BEFORE_OPERATION; OPERATION_NAME = _masterRow.OPERATION_NAME; OPER_SCALE = _masterRow.OPER_SCALE; OPER_POSITION = _masterRow.OPER_POSITION; EMERGENCY_IND = _masterRow.EMERGENCY_IND; EmergVisible = EMERGENCY_IND == 1 ? Visibility.Visible : Visibility.Collapsed; ISOLATION_IND = _masterRow.ISOLATION_IND; IsolaVisible = ISOLATION_IND == 2 ? Visibility.Visible : Visibility.Collapsed; RADIATE_IND = _masterRow.RADIATE_IND; RadiaVisible = RADIATE_IND == 2 ? Visibility.Visible : Visibility.Collapsed; PATIENT_CONDITION = _masterRow.PATIENT_CONDITION; SURGEON = _masterRow.SURGEON; FIRST_OPER_ASSISTANT = _masterRow.FIRST_OPER_ASSISTANT; SECOND_OPER_ASSISTANT = _masterRow.SECOND_OPER_ASSISTANT; CPB_DOCTOR = _masterRow.CPB_DOCTOR; FIRST_CPB_ASSISTANT = _masterRow.FIRST_CPB_ASSISTANT; FIRST_OPER_NURSE = _masterRow.FIRST_OPER_NURSE; SECOND_OPER_NURSE = _masterRow.SECOND_OPER_NURSE; FIRST_SUPPLY_NURSE = _masterRow.FIRST_SUPPLY_NURSE; SECOND_SUPPLY_NURSE = _masterRow.SECOND_SUPPLY_NURSE; ANES_METHOD = _masterRow.ANES_METHOD; ANAESTHESIA_TYPE = _masterRow.ANAESTHESIA_TYPE; ANES_DOCTOR = _masterRow.ANES_DOCTOR; FIRST_ANES_ASSISTANT = _masterRow.FIRST_ANES_ASSISTANT; SECOND_ANES_ASSISTANT = _masterRow.SECOND_ANES_ASSISTANT; THIRD_ANES_ASSISTANT = _masterRow.THIRD_ANES_ASSISTANT; ASA_GRADE = _masterRow.ASA_GRADE; WOUND_TYPE = _masterRow.WOUND_TYPE; RETURN_TO_SURGERY = _anesthesiaPlanRow.RETURN_TO_SURGERY; PLAN_WHEREABORTS = _anesthesiaPlanRow.PLAN_WHEREABORTS; AGE = DateDiff.CalAge((DateTime)_patMasterIndexRow.DATE_OF_BIRTH, _masterRow.SCHEDULED_DATE_TIME.Value); // 当前仅考虑Ⅰ,Ⅱ,Ⅲ,Ⅳ,Ⅴ string strPath = "MedicalSystem.AnesWorkStation.View;component/Images/ASA_None.png"; switch (this.ASA_GRADE) { case "Ⅰ": case "Ⅰ级": case "一级": case "1级": strPath = "/MedicalSystem.AnesWorkStation.View;component/WorkList/Assets/icon/ASA1.png"; break; case "Ⅱ": case "Ⅱ级": case "二级": case "2级": strPath = "/MedicalSystem.AnesWorkStation.View;component/WorkList/Assets/icon/ASA2.png"; break; case "Ⅲ": case "Ⅲ级": case "三级": case "3级": strPath = "/MedicalSystem.AnesWorkStation.View;component/WorkList/Assets/icon/ASA3.png"; break; case "Ⅳ": case "Ⅳ级": case "四级": case "4级": strPath = "/MedicalSystem.AnesWorkStation.View;component/WorkList/Assets/icon/ASA4.png"; break; case "Ⅴ": case "Ⅴ级": case "五级": case "5级": strPath = "/MedicalSystem.AnesWorkStation.View;component/WorkList/Assets/icon/ASA5.png"; break; case "Ⅵ": case "Ⅵ级": case "六级": case "6级": strPath = "/MedicalSystem.AnesWorkStation.View;component/WorkList/Assets/icon/ASA6.png"; break; default: strPath = "MedicalSystem.AnesWorkStation.View;component/Images/ASA_None.png"; break; } this.AsaPath = new BitmapImage(new Uri(strPath, UriKind.RelativeOrAbsolute)); } }
/// <summary> /// 保存文书基础表Basic table of medical instruments /// </summary> /// <param name="dyParams"></param> /// <returns></returns> /// <summary> public RequestResult <bool> SaveMedicalBasicDoc(dynamic dyParams) { RequestResult <bool> Result = new RequestResult <bool>(); try { MED_OPERATION_MASTER operMaster = null; MED_PAT_MASTER_INDEX patMasterIndex = null; MED_PAT_VISIT patVisit = null; MED_PATS_IN_HOSPITAL patsInHospital = null; MED_ANESTHESIA_PLAN anesPlan = null; MED_ANESTHESIA_PLAN_EXAM anesPlanExam = null; MED_ANESTHESIA_PLAN_PMH anesPlanPmh = null; List <MED_OPERATION_EXTENDED> operExtended = null; List <MED_POSTOPERATIVE_EXTENDED> postExtended = null; List <MED_PREOPERATIVE_EXPANSION> preExpansion = null; if (dyParams.operMaster != null) { string value = dyParams.operMaster.ToString(); operMaster = JsonConvert.DeserializeObject <MED_OPERATION_MASTER>(value); } if (dyParams.patMasterIndex != null) { string value = dyParams.patMasterIndex.ToString(); patMasterIndex = JsonConvert.DeserializeObject <MED_PAT_MASTER_INDEX>(value); } if (dyParams.patVisit != null) { string value = dyParams.patVisit.ToString(); patVisit = JsonConvert.DeserializeObject <MED_PAT_VISIT>(value); } if (dyParams.patsInHospital != null) { string value = dyParams.patsInHospital.ToString(); patsInHospital = JsonConvert.DeserializeObject <MED_PATS_IN_HOSPITAL>(value); } if (dyParams.anesPlan != null) { string value = dyParams.anesPlan.ToString(); anesPlan = JsonConvert.DeserializeObject <MED_ANESTHESIA_PLAN>(value); } if (dyParams.anesPlanExam != null) { string value = dyParams.anesPlanExam.ToString(); anesPlanExam = JsonConvert.DeserializeObject <MED_ANESTHESIA_PLAN_EXAM>(value); } if (dyParams.anesPlanPmh != null) { string value = dyParams.anesPlanPmh.ToString(); anesPlanPmh = JsonConvert.DeserializeObject <MED_ANESTHESIA_PLAN_PMH>(value); } if (dyParams.operExtended != null) { string value = dyParams.operExtended.ToString(); operExtended = JsonConvert.DeserializeObject <List <MED_OPERATION_EXTENDED> >(value); } if (dyParams.postExtended != null) { string value = dyParams.postExtended.ToString(); postExtended = JsonConvert.DeserializeObject <List <MED_POSTOPERATIVE_EXTENDED> >(value); } if (dyParams.preExpansion != null) { string value = dyParams.preExpansion.ToString(); preExpansion = JsonConvert.DeserializeObject <List <MED_PREOPERATIVE_EXPANSION> >(value); } Result = Success(_pacuOperationInfoService.SaveMedicalBasicDoc(operMaster, patMasterIndex, patVisit, patsInHospital, anesPlan, anesPlanExam, anesPlanPmh, operExtended, postExtended, preExpansion)); } catch (Exception ex) { Logger.Error("SaveMedicalBasicDoc:" + ex.Message); } return(Result); }
/// <summary> /// 数据保存 /// </summary> /// <param name="dataSource"></param> protected override void OnSaveData(Dictionary <string, DataTable> dataSource) { base.OnSaveData(dataSource); List <MED_OPERATION_MASTER> operMasterList = ModelHelper <MED_OPERATION_MASTER> .ConvertDataTableToList(dataSource["MED_OPERATION_MASTER"]); MED_OPERATION_MASTER operMaster = null; if (operMasterList != null && operMasterList.Count > 0) { operMaster = operMasterList[0]; if (!operMaster.OUT_PACU_DATE_TIME.HasValue && operMaster.OPER_STATUS_CODE == (int)OperationStatus.InPACU) { MED_OPERATION_MASTER master = operationInfoRepository.GetOperMaster(ExtendApplicationContext.Current.PatientContextExtend.PatientID, ExtendApplicationContext.Current.PatientContextExtend.VisitID, ExtendApplicationContext.Current.PatientContextExtend.OperID).Data; if (master.OUT_PACU_DATE_TIME.HasValue) { operMaster.OUT_PACU_DATE_TIME = master.OUT_PACU_DATE_TIME; operMaster.OPER_STATUS_CODE = master.OPER_STATUS_CODE; } } if (operMaster.IN_PACU_DATE_TIME.HasValue && !operMaster.OUT_PACU_DATE_TIME.HasValue) { operMaster.OPER_STATUS_CODE = 45; } } List <MED_PAT_MASTER_INDEX> patIndexList = ModelHelper <MED_PAT_MASTER_INDEX> .ConvertDataTableToList(dataSource["MED_PAT_MASTER_INDEX"]); MED_PAT_MASTER_INDEX patMasterIndex = null; if (patIndexList != null && patIndexList.Count > 0) { patMasterIndex = patIndexList[0]; } List <MED_PAT_VISIT> patVisitList = ModelHelper <MED_PAT_VISIT> .ConvertDataTableToList(dataSource["MED_PAT_VISIT"]); MED_PAT_VISIT patVisit = null; if (patVisitList != null && patVisitList.Count > 0) { patVisit = patVisitList[0]; } List <MED_ANESTHESIA_PLAN> anesPlanList = ModelHelper <MED_ANESTHESIA_PLAN> .ConvertDataTableToList(dataSource["MED_ANESTHESIA_PLAN"]); MED_ANESTHESIA_PLAN anesPlan = null; if (anesPlanList != null && anesPlanList.Count > 0) { anesPlan = anesPlanList[0]; } List <MED_ANESTHESIA_PLAN_PMH> anesPlanPMHList = ModelHelper <MED_ANESTHESIA_PLAN_PMH> .ConvertDataTableToList(dataSource["MED_ANESTHESIA_PLAN_PMH"]); MED_ANESTHESIA_PLAN_PMH anesPlanPmh = null; if (anesPlanPMHList != null && anesPlanPMHList.Count > 0) { anesPlanPmh = anesPlanPMHList[0]; } List <MED_OPERATION_EXTENDED> operExtended = ModelHelper <MED_OPERATION_EXTENDED> .ConvertDataTableToList(dataSource["MED_OPERATION_EXTENDED"]); List <MED_POSTOPERATIVE_EXTENDED> postExtended = ModelHelper <MED_POSTOPERATIVE_EXTENDED> .ConvertDataTableToList(dataSource["MED_POSTOPERATIVE_EXTENDED"]); //OperationInfoService.SaveMedicalBasicDoc(operMaster, patIndex, patVisit, null, anesPlan, null, anesPlanPMH, operExtended, posExtended, null); MED_PATS_IN_HOSPITAL patsInHospital = null; MED_ANESTHESIA_PLAN_EXAM anesPlanExam = null; List <MED_PREOPERATIVE_EXPANSION> preExpansion = null; operationInfoRepository.SaveMedicalBasicDoc(new { operMaster, patMasterIndex, patVisit, patsInHospital, anesPlan, anesPlanExam, anesPlanPmh, operExtended, postExtended, preExpansion }); foreach (IUIElementHandler handler in _UIElementHandlers) { if (handler.GetControlType == typeof(MedVitalSignGraph) && handler.GetCurrentControl != null) { MedVitalSignGraph vitalSign = handler.GetCurrentControl as MedVitalSignGraph; if (vitalSign.NewMonitorData != null) { vitalSign.NewMonitorData.Save(); } } } }
public RequestResult <int> SavePatsInHospital(MED_PATS_IN_HOSPITAL item) { return(Success(_pacuOperationInfoService.SavePatsInHospital(item))); }
public RequestResult <bool> updatePatsInHospital(MED_PATS_IN_HOSPITAL data) { return(Success(_anesInfoService.updatePatsInHospital(data))); }
/// <summary> /// 根据表名从数据库中获取数据 /// </summary> /// <param name="tableName"></param> /// <returns></returns> private DataTable BuildData(string tableName) { string patientId = ExtendApplicationContext.Current.PatientContextExtend.PatientID; int visitId = ExtendApplicationContext.Current.PatientContextExtend.VisitID; int operId = ExtendApplicationContext.Current.PatientContextExtend.OperID; DataTable data = null; switch (tableName) { case "MED_PAT_MONITOR_DATA_EXT": data = ModelHelper <MED_PAT_MONITOR_DATA_EXT> .ConvertListToDataTable(operationInfoRepository.GetPatMonitorExtList(patientId, visitId, operId).Data); break; case "MED_OPERATION_MASTER": data = ModelHelper <MED_OPERATION_MASTER> .ConvertSingleToDataTable(ExtendApplicationContext.Current.MED_OPERATION_MASTER == null ?new MED_OPERATION_MASTER() { PATIENT_ID = patientId, VISIT_ID = visitId, OPER_ID = operId } : operationInfoRepository.GetOperMaster(patientId, visitId, operId).Data); break; case "MED_PAT_MASTER_INDEX": data = ModelHelper <MED_PAT_MASTER_INDEX> .ConvertSingleToDataTable(ExtendApplicationContext.Current.MED_PAT_MASTER_INDEX == null ?new MED_PAT_MASTER_INDEX() { PATIENT_ID = patientId } : operationInfoRepository.GetPatMasterIndex(patientId).Data); break; case "MED_OPERATION_MASTER_EXT": data = ModelHelper <MED_OPERATION_MASTER_EXT> .ConvertSingleToDataTable(operationInfoRepository.GetOperMasterExt(patientId, visitId, operId).Data); if (data.Rows.Count == 0) { MED_OPERATION_MASTER_EXT model = new MED_OPERATION_MASTER_EXT() { PATIENT_ID = patientId, VISIT_ID = visitId, OPER_ID = operId }; data = ModelHelper <MED_OPERATION_MASTER_EXT> .ConvertSingleToDataTable(model); } break; case "MED_PAT_VISIT": data = ModelHelper <MED_PAT_VISIT> .ConvertSingleToDataTable(operationInfoRepository.GetPatVisit(patientId, visitId).Data); if (data.Rows.Count == 0) { MED_PAT_VISIT model = new MED_PAT_VISIT() { PATIENT_ID = patientId, VISIT_ID = visitId }; data = ModelHelper <MED_PAT_VISIT> .ConvertSingleToDataTable(model); } break; case "MED_PATS_IN_HOSPITAL": data = ModelHelper <MED_PATS_IN_HOSPITAL> .ConvertSingleToDataTable(docDataRepository.GetPatsInHospital(patientId, visitId)); if (data.Rows.Count == 0) { MED_PATS_IN_HOSPITAL model = new MED_PATS_IN_HOSPITAL() { PATIENT_ID = patientId, VISIT_ID = visitId }; data = ModelHelper <MED_PATS_IN_HOSPITAL> .ConvertSingleToDataTable(model); } break; case "MED_SAFETY_CHECKS": data = ModelHelper <MED_SAFETY_CHECKS> .ConvertSingleToDataTable(docDataRepository.GetSafetyCheckData(patientId, visitId, operId)); if (data.Rows.Count == 0) { MED_SAFETY_CHECKS model = new MED_SAFETY_CHECKS() { PATIENT_ID = patientId, VISIT_ID = visitId, OPER_ID = operId }; data = ModelHelper <MED_SAFETY_CHECKS> .ConvertSingleToDataTable(model); } break; case "MED_ANESTHESIA_PLAN": data = ModelHelper <MED_ANESTHESIA_PLAN> .ConvertSingleToDataTable(docDataRepository.GetAnesthesiaPlan(patientId, visitId, operId)); if (data.Rows.Count == 0) { MED_ANESTHESIA_PLAN model = new MED_ANESTHESIA_PLAN() { PATIENT_ID = patientId, VISIT_ID = visitId, OPER_ID = operId }; data = ModelHelper <MED_ANESTHESIA_PLAN> .ConvertSingleToDataTable(model); } break; case "MED_ANESTHESIA_PLAN_PMH": data = ModelHelper <MED_ANESTHESIA_PLAN_PMH> .ConvertSingleToDataTable(docDataRepository.GetAnesthesiaPlanPMH(patientId, visitId, operId)); if (data.Rows.Count == 0) { MED_ANESTHESIA_PLAN_PMH model = new MED_ANESTHESIA_PLAN_PMH() { PATIENT_ID = patientId, VISIT_ID = visitId, OPER_ID = operId }; data = ModelHelper <MED_ANESTHESIA_PLAN_PMH> .ConvertSingleToDataTable(model); } break; case "MED_ANESTHESIA_PLAN_EXAM": data = ModelHelper <MED_ANESTHESIA_PLAN_EXAM> .ConvertSingleToDataTable(docDataRepository.GetAnesthesiaPlanEXAM(patientId, visitId, operId)); if (data.Rows.Count == 0) { MED_ANESTHESIA_PLAN_EXAM model = new MED_ANESTHESIA_PLAN_EXAM() { PATIENT_ID = patientId, VISIT_ID = visitId, OPER_ID = operId }; data = ModelHelper <MED_ANESTHESIA_PLAN_EXAM> .ConvertSingleToDataTable(model); } break; case "MED_ANESTHESIA_RECOVER": data = ModelHelper <MED_ANESTHESIA_RECOVER> .ConvertSingleToDataTable(docDataRepository.GetAnesRecoverData(patientId, visitId, operId)); if (data.Rows.Count == 0) { MED_ANESTHESIA_RECOVER model = new MED_ANESTHESIA_RECOVER() { PATIENT_ID = patientId, VISIT_ID = visitId, OPER_ID = operId }; data = ModelHelper <MED_ANESTHESIA_RECOVER> .ConvertSingleToDataTable(model); } break; case "MED_ANESTHESIA_INQUIRY": data = ModelHelper <MED_ANESTHESIA_INQUIRY> .ConvertSingleToDataTable(docDataRepository.GetAnesInquiry(patientId, visitId, operId, false)); if (data.Rows.Count == 0) { MED_ANESTHESIA_INQUIRY model = new MED_ANESTHESIA_INQUIRY() { PATIENT_ID = patientId, VISIT_ID = visitId, OPER_ID = operId }; data = ModelHelper <MED_ANESTHESIA_INQUIRY> .ConvertSingleToDataTable(model); } break; case "MED_OPERATION_EXTENDED": data = ModelHelper <MED_OPERATION_EXTENDED> .ConvertListToDataTable(commonRepository.GetOperExtended(patientId, visitId, operId).Data); if (data.Rows.Count == 0) { data.Columns.Add(new DataColumn("PATIENT_ID", typeof(string))); data.Columns.Add(new DataColumn("VISIT_ID", typeof(int))); data.Columns.Add(new DataColumn("OPER_ID", typeof(int))); data.Columns.Add(new DataColumn("ITEM_NAME", typeof(string))); data.Columns.Add(new DataColumn("ITEM_VALUE", typeof(string))); } break; case "MED_POSTOPERATIVE_EXTENDED": data = ModelHelper <MED_POSTOPERATIVE_EXTENDED> .ConvertListToDataTable(commonRepository.GetPostoperativeExtended(patientId, visitId, operId).Data); if (data.Rows.Count == 0) { data.Columns.Add(new DataColumn("PATIENT_ID", typeof(string))); data.Columns.Add(new DataColumn("VISIT_ID", typeof(int))); data.Columns.Add(new DataColumn("OPER_ID", typeof(int))); data.Columns.Add(new DataColumn("ITEM_NAME", typeof(string))); data.Columns.Add(new DataColumn("ITEM_VALUE", typeof(string))); } break; case "MED_PREOPERATIVE_EXPANSION": data = ModelHelper <MED_PREOPERATIVE_EXPANSION> .ConvertListToDataTable(commonRepository.GetPreoperativeExpansion(patientId, visitId, operId).Data); if (data.Rows.Count == 0) { data.Columns.Add(new DataColumn("PATIENT_ID", typeof(string))); data.Columns.Add(new DataColumn("VISIT_ID", typeof(int))); data.Columns.Add(new DataColumn("OPER_ID", typeof(int))); data.Columns.Add(new DataColumn("ITEM_NAME", typeof(string))); data.Columns.Add(new DataColumn("ITEM_VALUE", typeof(string))); } break; case "MED_OPERATION_ANALGESIC_MASTER": data = ModelHelper <MED_OPERATION_ANALGESIC_MASTER> .ConvertSingleToDataTable(docDataRepository.GetAnalgesicMaster(patientId, visitId, operId)); if (data.Rows.Count == 0) { MED_OPERATION_ANALGESIC_MASTER model = new MED_OPERATION_ANALGESIC_MASTER() { PATIENT_ID = patientId, VISIT_ID = visitId, OPER_ID = operId }; data = ModelHelper <MED_OPERATION_ANALGESIC_MASTER> .ConvertSingleToDataTable(model); } break; case "MED_OPER_RISK_ESTIMATE": data = ModelHelper <MED_OPER_RISK_ESTIMATE> .ConvertSingleToDataTable(docDataRepository.GetRickEstimate(patientId, visitId, operId)); if (data.Rows.Count == 0) { MED_OPER_RISK_ESTIMATE model = new MED_OPER_RISK_ESTIMATE() { PATIENT_ID = patientId, VISIT_ID = visitId, OPER_ID = operId }; data = ModelHelper <MED_OPER_RISK_ESTIMATE> .ConvertSingleToDataTable(model); } break; case "MED_OPER_ANALGESIC_MEDICINE": data = ModelHelper <MED_OPER_ANALGESIC_MEDICINE> .ConvertListToDataTable(operationInfoRepository.GetAnalgesicMedicineList(patientId, visitId, operId).Data); break; case "MED_OPER_ANALGESIC_TOTAL": data = ModelHelper <MED_OPER_ANALGESIC_TOTAL> .ConvertListToDataTable(operationInfoRepository.GetAnalgesicTotalList(patientId, visitId, operId).Data); break; case "MED_QIXIE_QINGDIAN": data = ModelHelper <MED_QIXIE_QINGDIAN> .ConvertListToDataTable(operationInfoRepository.GetOperCheckList(patientId, visitId, operId).Data); break; case "MED_ANESTHESIA_INPUT_DATA": data = ModelHelper <MED_ANESTHESIA_INPUT_DATA> .ConvertSingleToDataTable(docDataRepository.GetAnesthestaInputData(patientId, visitId, operId)); if (data.Rows.Count == 0) { MED_ANESTHESIA_INPUT_DATA model = new MED_ANESTHESIA_INPUT_DATA() { PATIENT_ID = patientId, VISIT_ID = visitId, OPER_ID = operId }; data = ModelHelper <MED_ANESTHESIA_INPUT_DATA> .ConvertSingleToDataTable(model); } break; case "MED_BJCA_SIGN": data = ModelHelper <MED_BJCA_SIGN> .ConvertListToDataTable(commonRepository.GetBjcaSignList(patientId, visitId, operId).Data); break; default: throw new NotImplementedException(string.Format("当前未定义从表{0}中获取数据的方法!", tableName)); } return(data); }
protected override void OnSaveData(Dictionary <string, DataTable> dataSource) { base.OnSaveData(dataSource); List <MED_OPERATION_MASTER> operationMasterDataTable = ModelHelper <MED_OPERATION_MASTER> .ConvertDataTableToList(dataSource["MED_OPERATION_MASTER"]); MED_OPERATION_MASTER masterRow = operationMasterDataTable.Count > 0 ? operationMasterDataTable[0] : null; if (txtOutRoomTime.Text != "" && masterRow != null) { if (!string.IsNullOrEmpty(masterRow.OPER_STATUS_CODE.ToString()) || masterRow.OPER_STATUS_CODE < (int)OperationStatus.OutOperationRoom) { masterRow.ANES_START_TIME = masterRow.START_DATE_TIME; masterRow.ANES_END_TIME = masterRow.END_DATE_TIME; masterRow.OPER_STATUS_CODE = (int)OperationStatus.OutOperationRoom; ExtendApplicationContext.Current.PatientInformationExtend.IN_DATE_TIME = masterRow.IN_DATE_TIME; ExtendApplicationContext.Current.PatientInformationExtend.OUT_DATE_TIME = masterRow.OUT_DATE_TIME; ExtendApplicationContext.Current.PatientInformationExtend.START_DATE_TIME = masterRow.START_DATE_TIME; ExtendApplicationContext.Current.PatientInformationExtend.END_DATE_TIME = masterRow.END_DATE_TIME; ExtendApplicationContext.Current.PatientInformationExtend.OPER_STATUS_CODE = masterRow.OPER_STATUS_CODE; ExtendApplicationContext.Current.OperationStatus = OperationStatus.OutOperationRoom; } } ExtendApplicationContext.Current.PatientInformationExtend.OPER_ROOM_NO = masterRow.OPER_ROOM_NO; MED_OPERATION_MASTER operMaster = null; if (operationMasterDataTable != null && operationMasterDataTable.Count > 0) { operMaster = operationMasterDataTable[0]; } List <MED_PAT_MASTER_INDEX> patIndexList = ModelHelper <MED_PAT_MASTER_INDEX> .ConvertDataTableToList(dataSource["MED_PAT_MASTER_INDEX"]); MED_PAT_MASTER_INDEX patMasterIndex = null; if (patIndexList != null && patIndexList.Count > 0) { patMasterIndex = patIndexList[0]; } List <MED_PAT_VISIT> patVisitList = ModelHelper <MED_PAT_VISIT> .ConvertDataTableToList(dataSource["MED_PAT_VISIT"]); MED_PAT_VISIT patVisit = null; if (patVisitList != null && patVisitList.Count > 0) { patVisit = patVisitList[0]; } List <MED_OPERATION_EXTENDED> operExtended = ModelHelper <MED_OPERATION_EXTENDED> .ConvertDataTableToList(dataSource["MED_OPERATION_EXTENDED"]); //OperationInfoService.SaveMedicalBasicDoc(operMaster, patIndex, patVisit, null, null, null, null, operExtended, null, null); MED_PATS_IN_HOSPITAL patsInHospital = null; MED_ANESTHESIA_PLAN anesPlan = null; MED_ANESTHESIA_PLAN_EXAM anesPlanExam = null; MED_ANESTHESIA_PLAN_PMH anesPlanPmh = null; List <MED_POSTOPERATIVE_EXTENDED> postExtended = null; List <MED_PREOPERATIVE_EXPANSION> preExpansion = null; operationInfoRepository.SaveMedicalBasicDoc(new { operMaster, patMasterIndex, patVisit, patsInHospital, anesPlan, anesPlanExam, anesPlanPmh, operExtended, postExtended, preExpansion }); }
public RequestResult <MED_PATS_IN_HOSPITAL> GetPatsInHospital(string patientID, int visitID) { MED_PATS_IN_HOSPITAL data = _careDocService.GetPatsInHospital(patientID, visitID); return(Success(data)); }
public RequestResult <int> SavePatsInHospital(MED_PATS_IN_HOSPITAL item) { string address = "PacuOperationInfo/SavePatsInHospital"; return(BaseRepository.PostCallApi <MED_PATS_IN_HOSPITAL>(address, item)); }
/// <summary> /// 保存数据源 /// </summary> protected override bool OnSaveData(Dictionary <string, DataTable> dataSource) { List <MED_ANESTHESIA_INPUT_DATA> anesInputData = new ModelHandler <MED_ANESTHESIA_INPUT_DATA>().FillModel(dataSource["MED_ANESTHESIA_INPUT_DATA"]); if (anesInputData != null && anesInputData.Count > 0) { CareDocService.ClientInstance.SaveAnesInputData(anesInputData[0]); } List <MED_OPERATION_MASTER> operMasterList = new ModelHandler <MED_OPERATION_MASTER>().FillModel(dataSource["MED_OPERATION_MASTER"]); MED_OPERATION_MASTER operMaster = null; if (operMasterList != null && operMasterList.Count > 0) { operMaster = operMasterList[0]; } List <MED_PAT_MASTER_INDEX> patIndexList = new ModelHandler <MED_PAT_MASTER_INDEX>().FillModel(dataSource["MED_PAT_MASTER_INDEX"]); MED_PAT_MASTER_INDEX patIndex = null; if (patIndexList != null && patIndexList.Count > 0) { patIndex = patIndexList[0]; } List <MED_PAT_VISIT> patVisitList = new ModelHandler <MED_PAT_VISIT>().FillModel(dataSource["MED_PAT_VISIT"]); MED_PAT_VISIT patVisit = null; if (patVisitList != null && patVisitList.Count > 0) { patVisit = patVisitList[0]; } List <MED_ANESTHESIA_PLAN> anesPlanList = new ModelHandler <MED_ANESTHESIA_PLAN>().FillModel(dataSource["MED_ANESTHESIA_PLAN"]); MED_ANESTHESIA_PLAN anesPlan = null; if (anesPlanList != null && anesPlanList.Count > 0) { anesPlan = anesPlanList[0]; } List <MED_ANESTHESIA_PLAN_PMH> anesPlanPMHList = new ModelHandler <MED_ANESTHESIA_PLAN_PMH>().FillModel(dataSource["MED_ANESTHESIA_PLAN_PMH"]); MED_ANESTHESIA_PLAN_PMH anesPlanPmh = null; if (anesPlanPMHList != null && anesPlanPMHList.Count > 0) { anesPlanPmh = anesPlanPMHList[0]; } List <MED_ANESTHESIA_PLAN_EXAM> anesPlanExamList = new ModelHandler <MED_ANESTHESIA_PLAN_EXAM>().FillModel(dataSource["MED_ANESTHESIA_PLAN_EXAM"]); MED_ANESTHESIA_PLAN_EXAM anesPlanExam = null; if (anesPlanExamList != null && anesPlanExamList.Count > 0) { anesPlanExam = anesPlanExamList[0]; } List <MED_PREOPERATIVE_EXPANSION> preExpansion = new ModelHandler <MED_PREOPERATIVE_EXPANSION>().FillModel(dataSource["MED_PREOPERATIVE_EXPANSION"]); List <MED_PATS_IN_HOSPITAL> patsInHospitalList = new ModelHandler <MED_PATS_IN_HOSPITAL>().FillModel(dataSource["MED_PATS_IN_HOSPITAL"]); MED_PATS_IN_HOSPITAL patsInHospital = null; if (patsInHospitalList != null && patsInHospitalList.Count > 0) { patsInHospital = patsInHospitalList[0]; } List <MED_OPERATION_EXTENDED> operExtended = new ModelHandler <MED_OPERATION_EXTENDED>().FillModel(dataSource["MED_OPERATION_EXTENDED"]); List <MED_POSTOPERATIVE_EXTENDED> postExtended = new ModelHandler <MED_POSTOPERATIVE_EXTENDED>().FillModel(dataSource["MED_POSTOPERATIVE_EXTENDED"]); bool result = CareDocService.ClientInstance.SaveMedicalBasicDoc(new { operMaster, patIndex, patVisit, patsInHospital, anesPlan, anesPlanExam, anesPlanPmh = anesPlanPmh, operExtended, postExtended, preExpansion }); return(result); }
public bool SaveMedicalBasicDoc(MED_OPERATION_MASTER operMaster, MED_PAT_MASTER_INDEX patMasterIndex, MED_PAT_VISIT patVisit, MED_PATS_IN_HOSPITAL patsInHospital, MED_ANESTHESIA_PLAN anesPlan, MED_ANESTHESIA_PLAN_EXAM anesPlanExam, MED_ANESTHESIA_PLAN_PMH anesPlanPmh, List <MED_OPERATION_EXTENDED> operExtended, List <MED_POSTOPERATIVE_EXTENDED> postExtended, List <MED_PREOPERATIVE_EXPANSION> preExpansion) { bool flag = true; if (operMaster != null) { flag = flag & dapper.Set <MED_OPERATION_MASTER>().Save(operMaster); } if (patVisit != null) { flag = flag & dapper.Set <MED_PAT_VISIT>().Save(patVisit); } if (patMasterIndex != null) { flag = flag & dapper.Set <MED_PAT_MASTER_INDEX>().Save(patMasterIndex); } if (patsInHospital != null) { flag = flag & dapper.Set <MED_PATS_IN_HOSPITAL>().Save(patsInHospital); } if (anesPlan != null) { flag = flag & dapper.Set <MED_ANESTHESIA_PLAN>().Save(anesPlan); } if (anesPlanPmh != null) { flag = flag & dapper.Set <MED_ANESTHESIA_PLAN_PMH>().Save(anesPlanPmh); } if (anesPlanExam != null) { flag = flag & dapper.Set <MED_ANESTHESIA_PLAN_EXAM>().Save(anesPlanExam); } if (operExtended != null && operExtended.Count > 0) { flag = flag & dapper.Set <MED_OPERATION_EXTENDED>().Save(operExtended) > 0 ? true : false; //foreach (var item in operExtended) //{ // flag = flag & dapper.Set<MED_OPERATION_EXTENDED>().Save(item); //} } if (postExtended != null && postExtended.Count > 0) { flag = flag & dapper.Set <MED_POSTOPERATIVE_EXTENDED>().Save(postExtended) > 0 ? true : false; //foreach (var item in postExtended) //{ // flag = flag & dapper.Set<MED_POSTOPERATIVE_EXTENDED>().Save(item); //} } if (preExpansion != null && preExpansion.Count > 0) { flag = flag & dapper.Set <MED_PREOPERATIVE_EXPANSION>().Save(preExpansion) > 0 ? true : false; //foreach (var item in preExpansion) //{ // flag = flag & dapper.Set<MED_PREOPERATIVE_EXPANSION>().Save(item); //} } if (flag) { dapper.SaveChanges(); } return(flag); }