/// <summary> /// 刷新界面数据 /// </summary> public void RefreshData() { // 在刷新数据时可能是定时器刷新也可能是消息指令刷新,为了防止数据冲突,使用对象锁 lock (this.locker) { try { // 每次刷新时从数据库中获取患者信息 MED_PAT_INFO patInfo = PatInfoService.ClientInstance.GetCurPatientInfo(ExtendAppContext.Current.OperDeptCode, ExtendAppContext.Current.OperRoomNo); this.CurPatientModel = PatientModel.CreateModel(patInfo); if (null != this.CurPatientModel) { this.IsSelectedBorderVisibility = Visibility.Visible; ExtendAppContext.Current.PatientInformationExtend = this.CurPatientModel.Med_Pat_Info; //设置状态灯亮 int lightIndex = OperationStatusHelper.GetOperStatusIndex(ExtendAppContext.Current.PatientInformationExtend.OPER_STATUS_CODE); KeyBoardStateCache.KeyBoard.OpenSecondKeyBoardAllLed(lightIndex); // 刷新患者的体征数据 this.RefreshVitalSignList(); // 刷新监护仪和麻醉机的图标显示 this.RefreshMonitor(); } else { this.IsSelectedBorderVisibility = Visibility.Collapsed; ExtendAppContext.Current.PatientInformationExtend = null; //关闭状态灯 if (KeyBoardStateCache.KeyBoard != null) { KeyBoardStateCache.KeyBoard.CloseSecondKeyBoardAllLed(); } } // 设置图片显示或隐藏 this.SetOperationVisibility(); // 刷新手术时长信息 this.RefreshOperationLength(); } catch (Exception ex) { Logger.Error("获取术中信息异常", ex); this.ShowMessageBox("获取术中信息发生异常。", MessageBoxButton.OK, MessageBoxImage.Error); } } }
private void SetOperStatusEnable() { OperationStatus operSate = OperationStatusHelper.OperationStatusFromString(ViewFlag); int patStatuIndex = OperationStatusHelper.GetOperStatusIndex(ExtendAppContext.Current.PatientInformationExtend.OPER_STATUS_CODE); int curntEditIndex = OperationStatusHelper.GetOperStatusIndex((int)operSate); //当前编辑已填写的状态的时间 if (patStatuIndex > curntEditIndex) { visibIndex = patStatuIndex; } //编辑新的状态时间 else { visibIndex = curntEditIndex; operStatusCode = (int)operSate; } StepIndex = visibIndex - 1; curntStatusCode = (int)operSate; enableIndex = curntEditIndex; switch (visibIndex) { case 1: InRoomVisible = Visibility.Visible; InRoomFinish = true; break; case 2: InRoomVisible = Visibility.Visible; AnesStartVisible = Visibility.Visible; InRoomFinish = true; AnesStartFinish = true; break; case 3: InRoomVisible = Visibility.Visible; AnesStartVisible = Visibility.Visible; OperStartVisible = Visibility.Visible; InRoomFinish = true; AnesStartFinish = true; OperStartFinish = true; break; case 4: InRoomVisible = Visibility.Visible; AnesStartVisible = Visibility.Visible; OperStartVisible = Visibility.Visible; OperEndVisible = Visibility.Visible; InRoomFinish = true; AnesStartFinish = true; OperStartFinish = true; OperEndFinish = true; break; case 5: InRoomVisible = Visibility.Visible; AnesStartVisible = Visibility.Visible; OperStartVisible = Visibility.Visible; OperEndVisible = Visibility.Visible; AnesEndVisible = Visibility.Visible; InRoomFinish = true; AnesStartFinish = true; OperStartFinish = true; OperEndFinish = true; AnesEndFinish = true; break; case 6: InRoomVisible = Visibility.Visible; AnesStartVisible = Visibility.Visible; OperStartVisible = Visibility.Visible; OperEndVisible = Visibility.Visible; AnesEndVisible = Visibility.Visible; OutRoomVisible = Visibility.Visible; InRoomFinish = true; AnesStartFinish = true; OperStartFinish = true; OperEndFinish = true; AnesEndFinish = true; OutRoomFinish = true; break; } switch (enableIndex) { case 1: InRoomEnable = true; InRoomBackVisible = Visibility.Visible; InRoomFinish = false; break; case 2: AnesStartEnable = true; AnesStartBackVisible = Visibility.Visible; AnesStartFinish = false; break; case 3: OperStartEnable = true; OperStartBackVisible = Visibility.Visible; OperStartFinish = false; break; case 4: OperEndEnable = true; OperEndBackVisible = Visibility.Visible; OperEndFinish = false; break; case 5: AnesEndEnable = true; AnesEndBackVisible = Visibility.Visible; AnesEndFinish = false; break; case 6: OutRoomEnable = true; OutRoomBackVisible = Visibility.Visible; OutRoomFinish = false; break; } }