private void FloatFrm_Load(object sender, EventArgs e) { if (!AccessControl.CheckModifyRight(PermissionContext.ANESRECORDOPER)) { if (_anesthesiaEventsEditor != null) { _anesthesiaEventsEditor.SetReadOnly(true); } } btnOK.Top = 2000; btnCancel.Top = 2000; btnOK.Enabled = false; btnCancel.Enabled = false; Icon = System.Drawing.Icon.ExtractAssociatedIcon(Application.ExecutablePath); if (ExtendApplicationContext.Current.SystemStatus == ProgramStatus.PACURecord) { eventNo = "1"; } else if (ExtendApplicationContext.Current.SystemStatus == ProgramStatus.CPBReport) { eventNo = "2"; } else if (ApplicationConfiguration.IsYouDaoProgram) { eventNo = "3"; } this.Location = floatLocation; eventTable = OperationInfoService.GetAnesEventList(ExtendApplicationContext.Current.PatientContextExtend.PatientID, ExtendApplicationContext.Current.PatientContextExtend.VisitID, ExtendApplicationContext.Current.PatientContextExtend.OperID, eventNo).ToList(); InitEventList(); }
/// <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="rightKey"></param> /// <returns></returns> private PermissionContext.RightType GetOperatorDocRightType(string rightKey) { if ((CheckRight(PermissionContext.MODIFYDOCUMENTFOREVER) & PermissionContext.RightType.Modify) == PermissionContext.RightType.Modify) { return(PermissionContext.RightType.Modify); } if ((CheckRight(PermissionContext.MODIFYDOCUMENT) & PermissionContext.RightType.Modify) == PermissionContext.RightType.Modify) { return(PermissionContext.RightType.Modify); } PermissionContext.RightType rightType = CheckRight(rightKey); //判读是否超级用户 if (ExtendApplicationContext.Current.LoginUser.isMDSD) { return(rightType); } //获取手术表 MED_OPERATION_MASTER operationMasterRow = OperationInfoService.GetOperMaster(ExtendApplicationContext.Current.PatientContextExtend.PatientID, ExtendApplicationContext.Current.PatientContextExtend.VisitID, ExtendApplicationContext.Current.PatientContextExtend.OperID); List <MED_OPERATION_SHIFT_RECORD> operationShift = OperationInfoService.GetShiftRecordListByID(ExtendApplicationContext.Current.PatientContextExtend.PatientID, ExtendApplicationContext.Current.PatientContextExtend.VisitID, ExtendApplicationContext.Current.PatientContextExtend.OperID); try { //检查是否为 麻醉医生、手术医生 if (operationMasterRow != null) { bool find = false; if (!find && !string.IsNullOrEmpty(operationMasterRow.ANES_DOCTOR) && (IsLoginUser(operationMasterRow.ANES_DOCTOR))) { find = true; } else if (!find && !string.IsNullOrEmpty(operationMasterRow.FIRST_ANES_ASSISTANT) && (IsLoginUser(operationMasterRow.FIRST_ANES_ASSISTANT))) { find = true; } else if (!find && !string.IsNullOrEmpty(operationMasterRow.SECOND_ANES_ASSISTANT) && (IsLoginUser(operationMasterRow.SECOND_ANES_ASSISTANT))) { find = true; } else if (!find && !string.IsNullOrEmpty(operationMasterRow.THIRD_ANES_ASSISTANT) && (IsLoginUser(operationMasterRow.THIRD_ANES_ASSISTANT))) { find = true; } else if (!find && !string.IsNullOrEmpty(operationMasterRow.FOURTH_ANES_ASSISTANT) && (IsLoginUser(operationMasterRow.FOURTH_ANES_ASSISTANT))) { find = true; } if (!find) { //检查是否为 交班医生 if (operationShift != null && operationShift.Count > 0) { foreach (MED_OPERATION_SHIFT_RECORD row in operationShift) { if (!find && !string.IsNullOrEmpty(row.PERSON) && (IsLoginUser(row.PERSON))) { find = true; } } } if (!find) { rightType = PermissionContext.RightType.Browse; } } } else//麻醉主记录为空 { rightType = PermissionContext.RightType.Browse; } } catch (Exception ex) { throw ex; } return(rightType); }
// 获取手术收费权限 只有该患者的护士可以 public PermissionContext.RightType GetOperBillRightType(string rightKey) { if ((CheckRight("所有手术收费") & PermissionContext.RightType.Modify) == PermissionContext.RightType.Modify) { return(PermissionContext.RightType.Modify); } PermissionContext.RightType rightType = CheckRight(rightKey); //判读是否超级用户 if (ExtendApplicationContext.Current.LoginUser.isMDSD) { return(rightType); } //获取手术表 MED_OPERATION_MASTER operationMasterRow = OperationInfoService.GetOperMaster(ExtendApplicationContext.Current.PatientContextExtend.PatientID, ExtendApplicationContext.Current.PatientContextExtend.VisitID, ExtendApplicationContext.Current.PatientContextExtend.OperID); List <MED_OPERATION_SHIFT_RECORD> operationShift = OperationInfoService.GetShiftRecordListByID(ExtendApplicationContext.Current.PatientContextExtend.PatientID, ExtendApplicationContext.Current.PatientContextExtend.VisitID, ExtendApplicationContext.Current.PatientContextExtend.OperID); try { //检查是否为 护士 if (operationMasterRow != null) { bool find = false; if (!find && !string.IsNullOrEmpty(operationMasterRow.FIRST_SUPPLY_NURSE) && (IsLoginUser(operationMasterRow.FIRST_SUPPLY_NURSE))) { find = true; } else if (!find && !string.IsNullOrEmpty(operationMasterRow.SECOND_SUPPLY_NURSE) && (IsLoginUser(operationMasterRow.SECOND_SUPPLY_NURSE))) { find = true; } else if (!find && !string.IsNullOrEmpty(operationMasterRow.THIRD_SUPPLY_NURSE) && (IsLoginUser(operationMasterRow.THIRD_SUPPLY_NURSE))) { find = true; } else if (!find && !string.IsNullOrEmpty(operationMasterRow.FIRST_OPER_NURSE) && (IsLoginUser(operationMasterRow.FIRST_OPER_NURSE))) { find = true; } else if (!find && !string.IsNullOrEmpty(operationMasterRow.SECOND_OPER_NURSE) && (IsLoginUser(operationMasterRow.SECOND_OPER_NURSE))) { find = true; } else if (!find && !string.IsNullOrEmpty(operationMasterRow.THIRD_OPER_NURSE) && (IsLoginUser(operationMasterRow.THIRD_OPER_NURSE))) { find = true; } if (!find) { rightType = PermissionContext.RightType.Browse; } } else//麻醉主记录为空 { rightType = PermissionContext.RightType.Browse; } return(rightType); } catch (Exception ex) { throw ex; } //return PermissionContext.RightType.Browse; ; }
protected override void OnSaveData(Dictionary <string, DataTable> dataSource)//, ref bool bNeedMsg { foreach (MTextBox mtb in textBoxs) { if (string.IsNullOrEmpty(mtb.Text) && !string.IsNullOrEmpty(mtb.InputNeededMessage)) { MessageBoxFormPC.Show("*号为必填项目,请重新填写"); // bNeedMsg = false; return; } } string patientID = BindControls("MED_PAT_MASTER_INDEX", "PATIENT_ID"); if (operationMaster == null) { operationMaster = new MED_OPERATION_MASTER(); } operationMaster.SetValue("PATIENT_ID", patientID); operationMaster.SetValue("VISIT_ID", visitID); operationMaster.SetValue("OPER_ID", operID); operationMaster.SetValue("OPER_ROOM", ExtendAppContext.CurntSelect.OperRoom); operationMaster.SetValue("HOSP_BRANCH", ExtendAppContext.CurntSelect.HospBranchCode); operationMaster.SetValue("EMERGENCY_IND", BindControls("MED_OPERATION_MASTER", "EMERGENCY_IND")); operationMaster.SetValue("DEPT_CODE", BindControls("MED_OPERATION_MASTER", "DEPT_CODE")); operationMaster.SetValue("BED_NO", BindControls("MED_OPERATION_MASTER", "BED_NO")); operationMaster.SetValue("SCHEDULED_DATE_TIME", BindControls("MED_OPERATION_MASTER", "SCHEDULED_DATE_TIME")); operationMaster.SetValue("OPER_ROOM_NO", BindControls("MED_OPERATION_MASTER", "OPER_ROOM_NO")); operationMaster.SetValue("SEQUENCE", BindControls("MED_OPERATION_MASTER", "SEQUENCE")); operationMaster.SetValue("ANES_DOCTOR", BindControls("MED_OPERATION_MASTER", "ANES_DOCTOR")); operationMaster.SetValue("DIAG_BEFORE_OPERATION", BindControls("MED_OPERATION_MASTER", "DIAG_BEFORE_OPERATION")); operationMaster.SetValue("OPERATION_NAME", BindControls("MED_OPERATION_MASTER", "OPERATION_NAME")); operationMaster.SetValue("OPER_STATUS_CODE", 2); if (currentOperSchedule != null) { currentOperSchedule.SetValue("OPER_STATUS_CODE", 2); } if (patVisit == null) { patVisit = new MED_PAT_VISIT(); } patVisit.SetValue("PATIENT_ID", patientID); patVisit.SetValue("VISIT_ID", visitID); patVisit.SetValue("INP_NO", BindControls("MED_PATS_IN_HOSPITAL", "INP_NO")); if (patMasterIndex == null) { patMasterIndex = new MED_PAT_MASTER_INDEX(); } patMasterIndex.SetValue("PATIENT_ID", patientID); patMasterIndex.SetValue("NAME", BindControls("MED_PAT_MASTER_INDEX", "NAME")); patMasterIndex.SetValue("SEX", BindControls("MED_PAT_MASTER_INDEX", "SEX")); patMasterIndex.SetValue("DATE_OF_BIRTH", BindControls("MED_PAT_MASTER_INDEX", "DATE_OF_BIRTH")); string strOperName = BindControls("MED_OPERATION_MASTER", "OPER_NAME"); if (!string.IsNullOrEmpty(strOperName)) { string[] operNameArr = strOperName.Split('+'); for (int i = 0; i < operNameArr.Length; i++) { MED_OPERATION_NAME operName = new MED_OPERATION_NAME(); operName.SetValue("PATIENT_ID", operationMaster.PATIENT_ID); operName.SetValue("VISIT_ID", operationMaster.VISIT_ID); operName.SetValue("OPER_ID", operationMaster.OPER_ID); operName.SetValue("OPER_NO", i + 1); operName.SetValue("OPER_NAME", operNameArr[i].ToString()); operNameNewList.Add(operName); } } MED_ANESTHESIA_PLAN anesPlan = OperationInfoService.GetAnesPlan(patientID, visitID, operID); MED_ANESTHESIA_PLAN_PMH anesPlanPmh = OperationInfoService.GetAnesPlanPmh(patientID, visitID, operID); MED_ANESTHESIA_PLAN_EXAM anesPlanExam = OperationInfoService.GetAnesPlanExam(patientID, visitID, operID); if (anesPlan == null) { anesPlan = new MED_ANESTHESIA_PLAN(); anesPlan.SetValue("PATIENT_ID", patientID); anesPlan.SetValue("VISIT_ID", visitID); anesPlan.SetValue("OPER_ID", operID); } if (anesPlanPmh == null) { anesPlanPmh = new MED_ANESTHESIA_PLAN_PMH(); anesPlanPmh.SetValue("PATIENT_ID", patientID); anesPlanPmh.SetValue("VISIT_ID", visitID); anesPlanPmh.SetValue("OPER_ID", operID); } if (anesPlanExam == null) { anesPlanExam = new MED_ANESTHESIA_PLAN_EXAM(); anesPlanExam.SetValue("PATIENT_ID", patientID); anesPlanExam.SetValue("VISIT_ID", visitID); anesPlanExam.SetValue("OPER_ID", operID); } OperationInfoService.SavePatientOperation(currentOperSchedule, patVisit, patMasterIndex, null, operNameNewList, operationMaster, anesPlan, anesPlanPmh, anesPlanExam, null); }
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(); } }