Пример #1
0
 public override void OnClose()
 {
     // 清理工厂中残存信息
     EmsDriverFactory.EmsDriverShare().Clear();
     BaseEmsView.BaseEmsInfoContext.Clear();
     base.OnClose();
 }
Пример #2
0
        /// <summary>
        ///  处理医嘱编辑逻辑
        /// </summary>
        /// <param name="ciOrderDO"></param>
        /// <returns></returns>
        private bool HandleEditOrder(CiOrderDO ciOrderDO)
        {
            if (this.ent4BannerDTO == null || null == ciOrderDO)
            {
                this.SetStatusMsg("没有患者相关的就诊信息");
                return(false);
            }

            if (string.IsNullOrEmpty(ciOrderDO.Sd_srvtp))
            {
                this.ShowInfo("该医嘱没有服务类型");
                return(false);
            }

            this.orderDo = ciOrderDO;

            var ins = EmsDriverFactory.EmsDriverShare().DriverWith(ciOrderDO.Id_srv, ciOrderDO.Sd_srvtp, this, this.ent4BannerDTO);

            if (ins == null)
            {
                return(false);
            }

            var emsView = ins.GetEmsView();

            SwitchEmsView(emsView);

            emsView.GetViewModel().EditOrder(ciOrderDO);

            emsView.Refresh();

            // 设置状态
            this.isCreateEms = false;


            this.allowEdit = QureyEditEnbale(ciOrderDO, ent4BannerDTO);


            if (!this.allowEdit)
            {
                this.SentNotify(EventCodeType.NM_UIMSG_DISABLE_EDIT);
            }
            else
            {
                this.SentNotify(EventCodeType.NM_UIMSG_ALLOW_EDIT);
            }

            emsView.SetFocus();

            return(true);
        }
Пример #3
0
        /// <summary>
        /// 处理辅助录入助手新建医疗单逻辑
        /// </summary>
        /// <param name="ems"></param>
        /// <returns></returns>
        private bool HandleEditEmsDTO(CiEmsDTO ems)
        {
            if (this.ent4BannerDTO == null || null == ems)
            {
                this.SetStatusMsg("没有患者相关的就诊信息");
                return(false);
            }

            if (string.IsNullOrEmpty(ems.Sd_srvtp))
            {
                this.ShowInfo("该医嘱没有服务类型");
                return(false);
            }


            var ins = EmsDriverFactory.EmsDriverShare().DriverWith(ems.Id_srv, ems.Sd_srvtp, this, this.ent4BannerDTO);

            if (ins == null)
            {
                return(false);
            }

            var emsView = ins.GetEmsView();

            SwitchEmsView(emsView);

            emsView.GetViewModel().EditEms(ems);

            emsView.Refresh();

            // 设置状态
            this.isCreateEms = false;

            //this.SentNotify(EventCodeType.NM_UIMSG_CREATE_BUTTONGROUP);
            this.allowEdit = true;

            this.SentNotify(EventCodeType.NM_UIMSG_ALLOW_EDIT);


            return(true);
        }
Пример #4
0
        /// <summary>
        /// 创建医疗服务单
        /// </summary>
        /// <param name="medSrvDO"></param>
        private bool HandleCreateEms(EmsCreatedParameter emsCreateParameter, object param = null)
        {
            #region 1.有效性验证
            // 针对 Banner 的 有效性判断,该结构中含有患者就诊信息结构
            if (this.ent4BannerDTO == null || emsCreateParameter == null || emsCreateParameter.getMedSrvDO() == null)
            {
                return(false);
            }

            var medSrvDO = emsCreateParameter.getMedSrvDO();

            #endregion

            #region 2.获取指定类型的医疗单UI对象
            var t0 = new AssCostTimeTool(String.Format("创建医疗单时候({0}),总耗时:", medSrvDO.Name), false);

            var t1  = new AssCostTimeTool("创建医疗单时候,实例化UI模型耗时:", false);
            var ins = EmsDriverFactory.EmsDriverShare().DriverWith(medSrvDO.Id_srv, medSrvDO.Sd_srvtp, this, this.ent4BannerDTO);
            if (ins == null)
            {
                return(false);
            }

            var emsView = ins.GetEmsView();

            GetDefaultEmsView().ClearContext();

            SwitchEmsView(emsView);

            t1.SaveTimeLog();
            #endregion

            #region 3.医疗单模型加载数据
            emsView.GetViewModel().AddNew();
            if (param == null)
            {
                param = emsCreateParameter.GetParameter();
            }

            emsView.GetViewModel().SetCustomParam(param);

            // 加载数据
            t1.Reset("创建医疗单时候,数据模型加载数据耗时:");
            if (!emsView.GetViewModel().LoadMedSrv(emsCreateParameter))
            {
                if (!String.IsNullOrEmpty(emsView.GetViewModel().GetErrorMsg()))
                {
                    this.SetStatusMsg(emsView.GetViewModel().GetErrorMsg());
                }

                return(false);
            }
            if (emsView.GetViewModel().GetTipInfoMsg().Length > 0 && !getFgselfpay(emsView.GetViewModel()))
            {
                this.ShowInfo(this, emsView.GetViewModel().GetTipInfoMsg());
                //emsView.GetViewModel().ClearTipInfo();
            }
            //服务不可开立校验
            if (medSrvDO != null && !String.IsNullOrEmpty(medSrvDO.Id_srv))
            {
                var dic = AssToolEx.OrdEnabelValivate((new String[] { medSrvDO.Id_srv }), this.ent4BannerDTO.Code_entp);
                if (dic.ContainsKey(medSrvDO.Id_srv))
                {
                    //this.SetStatusMsg(dic[medSrvDO.Id_srv]);
                    this.ShowInfo(dic[medSrvDO.Id_srv]);
                    return(false);
                }
            }



            ////异步执行的委托
            //xap.rui.appfw.async.AsyncExecuteDelegate workDelegate = workArgs =>
            //{
            //    //参数是Argument,这是自己传入的,自行转化类型
            //    var argList = workArgs.Argument as List<object>;
            //    BaseEmsViewModel model = argList[0] as BaseEmsViewModel;
            //    EmsCreatedParameter crt = argList[1] as EmsCreatedParameter;
            //    // 异步调用,远程服务等。返回结果保存在参数的Result中。
            //    workArgs.Result = model.LoadMedSrv(crt);
            //};
            ////异步执行完毕后,回到调用线程执行的完毕委托
            //xap.rui.appfw.async.AsyncDoneDelegate doneDelegate = doneArgs =>
            //{
            //    //如果已经取消了,则返回
            //    if (doneArgs.Cancelled)
            //        return;
            //    //如果异步执行时发生了异常,可以在这里处理
            //    if (doneArgs.Error != null)
            //    {
            //        Exception ex = doneArgs.Error;
            //        //记录日志
            //        LogManager.GetLogger().ErrorEx(ex.Message, ex);
            //        //发布异常到UI
            //        ex.Publish();
            //        //标记为已处理异常,如果不标记,框架会抛出异常
            //        //doneArgs.ErrorHandled = true;
            //        return;
            //    }

            //    //异步执行完毕后,处理异步数据结果
            //    var data = doneArgs.Result ;
            //};

            ////
            //List<object> argsList = new List<object>();
            //argsList.Add(emsView.GetViewModel());
            //argsList.Add(emsCreateParameter);
            ////
            //workDelegate.AsyncExecute(argsList, doneDelegate);



            // 设置状态
            this.isCreateEms = true;

            // 刷新UI
            emsView.Refresh();
            t1.SaveTimeLog();
            #endregion

            #region 4.其他医疗单状态处理
            //
            t1.Reset("创建医疗单时候,其他事件处理耗时:");
            this.allowEdit = true;
            // 允许 UI 编辑
            var ret = this.SentNotify(EventCodeType.NM_UIMSG_ALLOW_EDIT);

            t1.SaveTimeLog();
            t0.SaveTimeLog();
            #endregion

            return(ret);
        }