Esempio n. 1
0
        public bool OrdValivate(ciordems.d.EmsUIDTO headDo, CiorderBaseControl ci)
        {
            if (headDo.Emsdrugs.Orders < 1)
            {
                ci.OrdErrorList.Add("医嘱付数不能小于1");
            }
            if (headDo.IsOpData)
            {
                if (headDo.Emsdrugs.Dt_end_ui != null && (headDo.Emsdrugs.Dt_begin_ui.Value < DateTime.Now.AddMinutes(-10)))
                {
                    ci.OrdErrorList.Add("开始日期不能在当前日期之前!");
                }
            }


            if (headDo.Emsdrugs.Dt_end_ui != null && (headDo.Emsdrugs.Dt_begin_ui > headDo.Emsdrugs.Dt_end_ui))
            {
                ci.OrdErrorList.Add("结束日期不能在开始日期之前!");
            }
            //校验在开始时间和结束时间之间有没有有效执行顿数,没有给提示
            new OrderDrugHerbViewModel().judgeBeginEndTimeHasMpTimes(headDo.Emsdrugs.Dt_begin_ui, headDo.Emsdrugs.Dt_end_ui, headDo.Emsdrugs.Id_freq);
            if (headDo.Emsdrugs.EmsOrDrugList.Count == 0)
            {
                ci.OrdErrorList.Add("没有任何药品!");
            }

            bool bcf = headDo.Emsdrugs.EmsOrDrugList.GroupBy(i => i.Id_mm).Where(g => g.Count() > 1).Count() >= 1;

            if (bcf)
            {
                ci.OrdErrorList.Add("药品有重复!");
            }
            #region 空药品
            if (headDo.Emsdrugs.EmsOrDrugList.Count(p => p.Id_srv == null || p.Id_srv == "" || p.Name_srv == null || p.Name_srv == "" || p.Spec_mm == null || p.Spec_mm == "" || p.Spec_mm == null || p.Spec_mm == "") > 0)
            {
                ci.OrdErrorList.Add("药品有空数据!");
            }

            #endregion

            #region 总量大于0
            foreach (EmsOrDrug item in headDo.Emsdrugs.EmsOrDrugList)
            {
                if (item.Quan_med == null || item.Quan_med.ToDouble() <= 0)
                {
                    ci.OrdErrorList.Add(item.Name_mm + "剂量必须大于0!");
                }
            }
            #endregion
            #region 药品库存的判断
            string mmcounterror = LogicEx.GetInstance().validateDrugCount(headDo.Emsdrugs.EmsOrDrugList.ToList());
            if (!string.IsNullOrEmpty(mmcounterror))
            {
                ci.OrdErrorList.Add(mmcounterror);
            }
            #endregion


            return(true);
        }
        public bool OrdValivate(EmsUIDTO headDo, CiorderBaseControl ci)
        {
            List <string> errList = new List <string>();

            if (headDo.Emsdrugs.Use_days == null || headDo.Emsdrugs.Use_days == 0)
            {
                errList.Add("医嘱使用天数不能为空!请检查!");
            }
            foreach (EmsOrDrug ems in headDo.Emsdrugs.EmsOrDrugList)
            {
                if (ems.Quan_cur == null || ems.Quan_cur == 0)
                {
                    errList.Add("【" + ems.Name_srv + "】总量不能为空!请检查!");
                    break;
                }
            }
            #region 药品库存的判断
            string mmcounterror = LogicEx.GetInstance().validateDrugCount(headDo.Emsdrugs.EmsOrDrugList.ToList());
            if (!string.IsNullOrEmpty(mmcounterror))
            {
                errList.Add(mmcounterror);
            }
            #endregion
            if (errList.Count > 0)
            {
                ci.OrdErrorList.AddRange(errList);
                return(false);
            }
            return(true);
        }
Esempio n. 3
0
        public bool OrdValivate(EmsUIDTO uiDto, CiorderBaseControl ci)
        {
            List <string> errList = new List <string>();

            #region 开始日期不能小于入院日期
            string errMsg = LogicEx.GetInstance().CompareWithAdmission(uiDto.PatInfo.Id_ent, uiDto.Emsdrugs.Dt_begin_ui);
            if (!string.IsNullOrEmpty(errMsg))
            {
                errList.Add(errMsg);
            }
            #endregion

            #region 结束日期要大于开始日期
            DateTime?dtBegin = uiDto.Emsdrugs.Dt_begin_ui;
            DateTime?dtEnd   = uiDto.Emsdrugs.Dt_end_ui;
            if (dtBegin != null && dtEnd != null)
            {
                if (dtEnd < dtBegin)
                {
                    errList.Add(OrdParam.MESSAGE_TIEMCHECK);
                }
            }
            #endregion

            if (errList.Count > 0)
            {
                ci.OrdErrorList.AddRange(errList);
                return(false);
            }
            return(true);
        }
Esempio n. 4
0
 public CiOrderDO SaveDTO(EmsUIDTO emsHeadDO, CiEmsDTO dto, int Eu_sourcemd, delegateBeforeSave OnBeforeSaveEms = null)
 {
     //保存前进行患者状态校验
     judgePatEntStatus(emsHeadDO.PatInfo);
     model.SaveCiDTO(emsHeadDO, dto, Eu_sourcemd);
     dto.Id_dept_ns = emsHeadDO.PatInfo.Id_dep_nur;
     //校验频次、剂量、剂量单位
     if (!LogicEx.GetInstance().validateBeforeSaveCiEmsDto(emsHeadDO, dto))
     {
         return(null);
     }
     //设置医保信息 后台获取医保目录类型的方法已经被注释掉了,前台在调用浪费时间
     // LogicEx.GetInstance().setHpInfo(dto, emsHeadDO.PatInfo.Id_hp);
     //if (emsHeadDO.IsNEW && LogicEx.GetInstance().validateEmsUIDTO(dto))
     //{
     //    List<string> errorList = LogicEx.GetInstance().validateFreqAndUnitmed(dto);
     //    if (errorList.Count > 0)
     //    {
     //        string strErr = "";
     //        errorList.ForEach(
     //            p => { strErr += string.Format("{0}.{1}\n", errorList.IndexOf(p) + 1, p); });
     //        string errInfo = " 验证失败,操作取消!\n" + strErr;
     //        this.ShowInfo(errInfo, "提示:");
     //        return null;
     //    }
     //}
     if (OnBeforeSaveEms != null)
     {
         OnBeforeSaveEms(dto);
     }
     return(ordMaintainService.SaveCiEmsDTO(dto, CiEnContextUtil.GetCiEnContext(emsHeadDO.PatInfo, EmsAppModeEnum.IVEMSAPPMODE)));
 }
Esempio n. 5
0
        /// <summary>
        /// 弹出物品选择器
        /// </summary>
        /// <param name="ds"></param>
        /// <param name="def"></param>
        /// <param name="atPoint"></param>
        private void ShowMmSelector(XDataRow row, List <EmsOrDrug> ds, EmsOrDrug def, Point atPoint, bool canEdit = true)
        {
            var mmContainer = new XBaseControl();

            mmContainer.Size = new Size(473, 160);

            var query = from items in ds orderby items.Fact_count descending select items;

            var mm = new ExtMmRefView(LogicEx.GetInstance().ConvertDataSouse <EmsOrDrug>(query.ToList()), def, false);

            mm.Dock = DockStyle.Fill;
            mmContainer.AddRender(mm);
            var popWindow = new XContextForm(mmContainer);

            mm.Event_SelectChanged += (sender, e) =>
            {
                EmsOrDrug orDrug = EmsHeadDO.Emsdrugs.EmsOrDrugList[gv.FocusedRowHandle];
                var       mmDrug = e.Data as EmsOrDrug;

                if (mmDrug == null)
                {
                    if (orDrug.Fg_self == true)
                    {
                        orDrug.Name_mm = orDrug.Name_srv;
                        orDrug.Id_mm   = null;
                    }
                    popWindow.Close();
                    return;
                }

                #region 皮试逻辑的判断
                if (mmDrug.Fg_skintest != null && mmDrug.Fg_skintest == true)
                {
                    SkinTestLogic logic = new SkinTestLogic(EmsHeadDO.PatInfo);
                    orDrug.Name_mm    = mmDrug.Name_mm;
                    orDrug.Id_mm      = mmDrug.Id_mm;
                    orDrug.Id_srvskin = mmDrug.Id_srvskin;
                    if (logic.skinTestLogic(orDrug).Equals("0"))
                    {
                        popWindow.Close();
                        return;
                    }
                }
                #endregion
                cof.CopyTo(mmDrug, orDrug, "Id_srv", "Name_srv");
                cof.concateMMSpecAndName(orDrug);
                orDrug.Fg_mm = true;
                updateTableCustomerComtrol();
                popWindow.Close();
            };
            popWindow.Show(atPoint);
            mm.Enabled = canEdit;
        }
Esempio n. 6
0
 public ExtDrugForm(EmsUIDTO CiHeadDo, EmsOrDrug drug) : this()
 {
     InitializeComponent();
     drugmm   = new EmsOrDrug();
     sourcemm = drug;
     LogicEx.GetInstance().CopyTo(drug, drugmm);
     mm = new ExtOrderDrugDialog(CiHeadDo, drug);
     splitContainer1.AddControl(this.orCom, xap.cli.sdk.controls.ControlPosition.Bottom, 30);
     splitContainer1.AddControl(mm, xap.cli.sdk.controls.ControlPosition.Center);
     this.saveButton.MouseClick   += new MouseEventHandler(saveButton_MouseClick);
     this.cancelButton.MouseClick += new MouseEventHandler(cancelButton_MouseClick);
     this.Controls.Add(splitContainer1);
 }
        /// <summary>
        /// 药品的唯一编码
        /// </summary>
        /// <param name="icno">医保卡号</param>
        /// <returns></returns>
        public static List <MedicalSharingDTO> MedicalSharingValidate(BaseContext context, MedicalSharingDTO[] medicalSharingDto, Ent4BannerDTO ent4BannerDto)
        {
            ciOrderQryService = XapServiceMgr.find <ICiOrdQryService>();
            string errMsg = "";
            //当前时间
            DateTime systemDateTime = LogicEx.GetInstance().GetSystemDateTime();

            infoMedicalSharingDto = new List <MedicalSharingDTO>();

            //本院数据 签署未交费的验证
            // LocalValiDate(context, medicalSharingDto, ent4BannerDto, systemDateTime); // -- 2017-1--16 Bug:0109210, 废弃不用 (费用负责)

            //医保中心的50天的数据
            //判断时间是否超出 10分钟
            //医保中心的数据
            ClincHistoryTradeInfo historyTradeInfo = MedicalSharingCache.getMedicalData(ent4BannerDto.No_hp);

            if (historyTradeInfo == null)
            {
                return(infoMedicalSharingDto);
            }
            DateTime?serverDateTime  = historyTradeInfo.SysInfo.ServerDateTime;
            DateTime serverDateTime2 = new DateTime();

            if (serverDateTime != null)
            {
                serverDateTime2 = (DateTime)serverDateTime;
            }
            System.TimeSpan timespan = systemDateTime.Subtract(serverDateTime2);
            if (timespan != null && timespan.TotalMinutes > 10)
            {
                GetMedicalsharingData.Instance.getMedicalsharingData(ent4BannerDto, context, out errMsg, "");
            }
            //判断排斥有的药品
            //不限制药品
            //中草药,葡萄糖及氯化钠相关注射液。溶媒类

            //重复开药(同一天)
            //医嘱不可重复:在医保共享数据中若已存在某医嘱,本次开立的医嘱中,不能有保内的同样的医嘱。再确认一下。
            //若出现重复,提示信息【医嘱共享数据中已存在该药品,不可重复开立】,按钮【放弃开立】【自费开立】

            // 【医嘱共享数据中已存在该药品,不可重复开立】,按钮【放弃开立】【自费开立】";
            //天数是否超出
            //遍历医保共享数据,若(交易日期 + 药品开立天数)- 当前日期  > 5时,该医嘱不可开立
            OutValiDate(context, medicalSharingDto, historyTradeInfo, ent4BannerDto, systemDateTime);



            //return dict;
            return(infoMedicalSharingDto);
        }
Esempio n. 8
0
 public override bool OnEventHandle(object sender, xap.rui.engine.DictionaryEventArgs e)
 {
     if (AssToolEx.EventCodeOfEventArgs(e).Equals(EventCodeType.EVENT_EMS_APBU_ADD))
     {
         var emsdto = (GetViewModel().GetEmsUIDTO() as EmsUIDTO);
         //备血医嘱开立,1、保存医嘱,2、后签署医嘱,3、生成用血医嘱
         if (orIsOpen())
         {
             if (!this.SentNotify(EventCodeType.NM_EMS_SAVE) || this.GetViewModel().getCiOrderDO() == null)
             {
                 return(false);
             }
             LogicEx.GetInstance().SignCiOrder(new CiOrderDO[] { this.GetViewModel().getCiOrderDO() }, this.GetViewModel().GetEnt4BannerDTO());
             if (!this.SentNotify(EventCodeType.EVENT_EMS_REFRESH))
             {
                 return(false);
             }
             MedSrvDO medSrcDO = LogicEx.GetInstance().getApBuSrv();
             if (null != medSrcDO && emsdto.CiordubDTO != null)
             {
                 this.GetViewModel().SetCustomParam(creatBuEmsDO(this.GetViewModel().getCiOrderDO().Id_or, medSrcDO));
                 // SentNotify(EventCodeType.NM_EMS_CREATE, EmsCreatedParameter.TAGKEY, new EmsCreatedParameter(medSrcDO, null, emsdto.CiordubDTO));
                 this.SentNotify(EventCodeType.NM_EMS_CREATE, EmsCreatedParamList.TAGKEY, new EmsCreatedParamList()
                 {
                     new EmsCreatedParameter(medSrcDO, null, emsdto.CiordubDTO)
                 });
             }
         }//医嘱已签署,生成用血医嘱
         else
         {
             MedSrvDO medSrcDO = LogicEx.GetInstance().getApBuSrv();
             if ((this.GetViewModel().getCiEmsDTO() as CiEmsDTO).Id_or != null)
             {
                 //拼接用血医嘱的元数据
                 creatBuEmsDO((this.GetViewModel().getCiEmsDTO() as CiEmsDTO).Id_or, medSrcDO);
             }
             if (null != medSrcDO && emsdto.CiordubDTO != null)
             {
                 this.GetViewModel().SetCustomParam(emsdto.CiordubDTO);
                 // SentNotify(EventCodeType.NM_EMS_CREATE, EmsCreatedParameter.TAGKEY, new EmsCreatedParameter(medSrcDO, null, emsdto.CiordubDTO));
                 this.SentNotify(EventCodeType.NM_EMS_CREATE, EmsCreatedParamList.TAGKEY, new EmsCreatedParamList()
                 {
                     new EmsCreatedParameter(medSrcDO, null, emsdto.CiordubDTO)
                 });
             }
         }
     }
     return(base.OnEventHandle(sender, e));
 }
Esempio n. 9
0
 /// <summary>
 /// 设置在院执行的可编辑状态和执行次数
 /// </summary>
 private void fgoutstate()
 {
     if (this.EmsHeadDO.Emsdrugs.Fg_mp_in == true)
     {
         (this.xapFormControl1.GetUserRender("drugsUse", "times_mp_in") as XLabelBaseUserRender).Enabled = true;
         int total = LogicEx.GetInstance().GetDrugUseTotalCount(this.EmsHeadDO);
         ((this.xapFormControl1.GetUserRender("drugsUse", "times_mp_in") as XLabelBaseUserRender).UserRender as XNumbericUpDown).MaxValue = total;
         if ((this.EmsHeadDO.Emsdrugs.Times_mp_in == null ? 0 : this.EmsHeadDO.Emsdrugs.Times_mp_in) > total)
         {
             this.EmsHeadDO.Emsdrugs.Times_mp_in = total;
         }
     }
     else
     {
         (this.xapFormControl1.GetUserRender("drugsUse", "times_mp_in") as XLabelBaseUserRender).Enabled   = false;
         (this.xapFormControl1.GetUserRender("drugsUse", "times_mp_in") as XLabelBaseUserRender).ValueText = "";
     }
 }
Esempio n. 10
0
        /////////添加检验、检查、诊疗多剂量多次执行,杨敬本20171111
        public override void OnDataChanged(Object ds, string fieldName, string value)
        {
            if (String.IsNullOrEmpty(fieldName))
            {
                return;
            }

            if (fieldName.ToLower().Equals("fg_urgent"))
            {
                this.uiEmsDTO.Emsapobs.Fg_urgent = bool.Parse(value);
            }
            else if (fieldName.Equals("Use_days") || fieldName.Equals("customercolumn_med_unit") || fieldName.Equals("customercolumn_sale_unit"))
            {
                EmsOrDrug itemDrug = ds as EmsOrDrug;
                if (itemDrug != null && itemDrug.Quan_med != null && itemDrug.Id_freq != null && itemDrug.Freqct != null && itemDrug.Use_days != null)
                {
                    itemDrug.Quan_cur   = this.logicEx.getNotDrugTotal(itemDrug.Quan_med.ToDouble(), itemDrug.Id_freq, itemDrug.Freqct.Value, itemDrug.Use_days.Value);
                    itemDrug.Totalprice = itemDrug.Price * itemDrug.Quan_cur;
                }
            }
            else if (fieldName.Equals("Dt_plan"))
            {
                this.uiEmsDTO.Emsapobs.Dt_begin_ui = this.uiEmsDTO.Emsapobs.Dt_plan;
                if (this.uiEmsDTO.Emsapobs.Dt_begin_ui == null)
                {
                    this.uiEmsDTO.Emsapobs.Dt_end_ui = this.uiEmsDTO.Emsapobs.Dt_begin_ui;
                }
                else
                {
                    this.uiEmsDTO.Emsapobs.Dt_end_ui = ((DateTime)this.uiEmsDTO.Emsapobs.Dt_begin_ui).AddDays((int)this.uiEmsDTO.Emsapobs.Use_days);
                }
            }
            else if (fieldName.Equals("customercolumn_details"))
            {
                //TODO 后台抽出新的方法后需要替换
                EmsOrDrug itemDrug = ds as EmsOrDrug;
                MedSrvDO  medSrv   = new MedSrvDO();
                medSrv.Id_srv   = itemDrug.Id_srv;
                medSrv.Id_primd = itemDrug.Id_pri;
                LogicEx logicEx = LogicEx.GetInstance();
                itemDrug.Totalprice = logicEx.getSrvNotMMPri(medSrv, this.uiEmsDTO.Emsapobs.EmsOrObsList, this.ent4BannerDTO.Id_pripat);
                itemDrug.Price      = itemDrug.Totalprice;
            }
        }
Esempio n. 11
0
        void xapFormControl1_ModelFilled(object sender, EventArgs e)
        {
            UserRender us = xapFormControl1.GetUserRender("ordobs", "dt_plan");

            xap.cli.sdk.render.Items.XCalendarTimerComboBox dt_begin = us.Renders[0] as xap.cli.sdk.render.Items.XCalendarTimerComboBox;
            DateTime dataA = (LogicEx.GetInstance()).GetServerDataTime();

            dt_begin.MinDate = dataA;
            dt_begin.MaxDate = cof.GetServerDataTime().AddDays(OrdParam.GetOrdParam.orBeforStartDays);


            gv.DataTable.DataSource      = CiHeadDo.Emsapobs.EmsOrObsList;
            gv_drug.DataTable.DataSource = CiHeadDo.Emsapobs.EmsOrDrugList;
            if (CiHeadDo.Emsapobs.EmsOrObsList.Count > 0)
            {
                //gv.DataTable.Rows[0].SetMultiSelectStatus(true);
                gv.DataTable.Rows[0].Selected = true;
            }
        }
Esempio n. 12
0
        protected void OnTableGridControl_SelectedRowChanged(object sender, XSelectedRowChangedEventArgs e)
        {
            CiOrdFeeSrvDTO feeSrv = e.Data as CiOrdFeeSrvDTO;

            if (null != feeSrv && e.Selected)
            {
                CiOrderDO ord = this.model.GetOrderDO(feeSrv.Id_or);
                if (null != ord)
                {
                    if (this.model.GetEnt4BannerDTO() != null && this.model.GetEnt4BannerDTO().Sd_status == EnDictCodeConst.SD_ENSTATUS_OP_FINISH)
                    {
                        return;
                    }
                    this.SentMessage(ord.Sd_su_or.Equals("0") && LogicEx.GetInstance().isIdEmpOrEqualIdpsn(ord.Id_emp_or) ? EventCodeType.EVENT_FEEBILL_ALLOWEDIT : EventCodeType.EVENT_FEEBILL_FORBIDEDIT);
                    return;
                }
                this.SentMessage(EventCodeType.EVENT_FEEBILL_FORBIDEDIT);
            }
        }
Esempio n. 13
0
        protected override void onUnitSelectChanged(object sender, object ds)
        {
            XComboBoxUnit xComboBoxUnit = sender as XComboBoxUnit;
            EmsOrDrug     drug          = ds as EmsOrDrug;
            int           selectIndex   = xComboBoxUnit.SelectIndex;

            // 选择没有变化
            if (String.IsNullOrEmpty(drug.Name_unit_medu_virtual) == String.IsNullOrEmpty(xComboBoxUnit.ValueUnit) || xComboBoxUnit.ValueUnit.Equals(drug.Name_unit_medu_virtual))
            {
                return;
            }
            if (selectIndex == 0)
            {
                if (drug.Quan_medu_virtual != null)
                {
                    drug.Quan_medu_virtual      = drug.Quan_medu_virtual.DoubleValue() * drug.Factor_mb.DoubleValue();
                    drug.Name_unit_medu_virtual = xComboBoxUnit.ValueUnit;
                }
                else
                {
                    drug.Quan_medu_virtual = null;
                    drug.Quan_med          = null;
                }
            }
            else if (selectIndex == 1)
            {
                if (drug.Quan_medu_virtual != null)
                {
                    //判断能否整除,如果能整除直接取整除的值,不能整除设置为空,让医生重新录入
                    if (LogicEx.GetInstance().divided(drug.Quan_medu_virtual, drug.Factor_mb))
                    {
                        drug.Quan_medu_virtual      = drug.Quan_medu_virtual.DoubleValue() / drug.Factor_mb.DoubleValue();
                        drug.Name_unit_medu_virtual = xComboBoxUnit.ValueUnit;
                    }
                    else
                    {
                        drug.Quan_medu_virtual = null;
                        drug.Quan_med          = null;
                    }
                }
            }
            xComboBoxUnit.ValueText = drug.Quan_medu_virtual == null ? "" : drug.Quan_medu_virtual + "";
        }
Esempio n. 14
0
        public override bool OrdValivate(object model, BaseEmsView sender)
        {
            sender.OrdErrorList.Clear();

            if (!(sender is  EmsHerbsViewGrid))
            {
                base.OrdValivate(model, sender);
            }


            var Emsdrugs = (model as EmsHerbsViewModel).GetFormDataSource() as EmsDrugItemDO;

            #region 检查空数据
            {
                var drug = Emsdrugs.EmsOrDrugList.ToList().FirstOrDefault(p => p.Id_srv == null);
                if (drug != null)
                {
                    sender.OrdErrorList.Add("草药列表中存在空数据,请删除后保存");
                }
            }
            #endregion

            #region 检查草药总量为 0
            {
                var resultList = Emsdrugs.EmsOrDrugList.Where(p => !p.IsDELETED).ToList().Where(p => p.Quan_cur == null || p.Quan_cur == 0);
                if (resultList.Count() > 0)
                {
                    sender.OrdErrorList.Add(String.Join(",", resultList.Select(p => p.Name_mm)) + " 总量为 0");
                }
            }
            #endregion

            #region 药品库存的判断
            string mmcounterror = LogicEx.GetInstance().validateDrugCount(Emsdrugs.EmsOrDrugList.Where(p => !p.IsDELETED).ToList());
            if (!string.IsNullOrEmpty(mmcounterror))
            {
                sender.OrdErrorList.Add(mmcounterror);
            }
            #endregion

            return(sender.OrdErrorList.Count == 0);
        }
Esempio n. 15
0
        /// <summary>
        /// 门诊撤回
        /// </summary>
        /// <param name="orders"></param>
        /// <param name="code"></param>
        /// <param name="id"></param>
        public CiOrderDO[] OPOnUpdateSu(CiOrderDO[] orders, string code, string id)
        {
            String[] id_ors = new string[orders.Count()];
            int      i      = 0;

            foreach (CiOrderDO order in orders)
            {
                id_ors[i] = order.Id_or;
                i++;
            }

            FDateTime fa = new FDateTime();

            fa = this.stoptime;
            if (fa == null)
            {
                fa = LogicEx.GetInstance().GetSystemDateTime();
            }
            return(this.maintainService.ciOrderSignBack(id_ors, id));
        }
Esempio n. 16
0
        /// <summary>
        /// 查询医保规则
        /// </summary>
        /// <param name="id_srv"></param>
        /// <param name="id_mm"></param>
        /// <param name="patinfo"></param>
        /// <returns></returns>
        public BdHpIndicationDTO getBdHpIndicationDTO(string id_srv, string id_mm, Ent4BannerDTO patinfo)
        {
            if (string.IsNullOrEmpty(id_srv) || patinfo == null || string.IsNullOrEmpty(patinfo.Id_hp) || true != patinfo.Fg_hpfundpay)
            {
                return(null);
            }
            CiEnContextDTO   contextdto = CiEnContextUtil.GetCiEnContext(patinfo);
            ICiOrdQryService service    = XapServiceMgr.find <ICiOrdQryService>();
            BdHpIndicDTO     bdhpindic  = service.getBdHpIndicationDTO(id_srv, id_mm, contextdto);

            if (bdhpindic != null)
            {
                BdHpIndicationDTO bdHpIndication = new BdHpIndicationDTO();
                LogicEx.GetInstance().CopyTo(bdhpindic, bdHpIndication);
                return(bdHpIndication);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 17
0
        /// <summary>
        /// 住院
        /// </summary>
        /// <param name="orders"></param>
        /// <param name="code"></param>
        /// <param name="id"></param>
        public void OnUpdateSu(CiOrderDO[] orders, string code, string id)
        {
            List <IdVProperty> idVdoList = new List <IdVProperty>();

            foreach (CiOrderDO order in orders)
            {
                IdVProperty idVdo = new IdVProperty();
                idVdo.Id  = order.Id_or;
                idVdo.Ver = order.Sv;
                idVdoList.Add(idVdo);
            }

            FDateTime fa = new FDateTime();

            fa = this.stoptime;
            if (fa == null)
            {
                fa = LogicEx.GetInstance().GetSystemDateTime();
            }
            this.maintainService.updateOrdStatusInfo(idVdoList.ToArray(), fa, code);
        }
Esempio n. 18
0
 public void Clear(Cididtozy zy)
 {
     LogicEx.GetInstance().Clear(zy);
     zy.Fg_majdi  = false;
     zy.Fg_suspdi = false;
 }
Esempio n. 19
0
 public void Clear(Cidixy xy)
 {
     LogicEx.GetInstance().Clear(xy);
     xy.Fg_majdi  = false;
     xy.Fg_suspdi = false;
 }
Esempio n. 20
0
        public override bool OnRefResultData(string fieldName, Object ds)
        {
            if (!base.OnRefResultData(fieldName, ds))
            {
                if (fieldName.Equals("Name_freq") && ds != null)
                {
                    EmsOrDrug drug = ds as EmsOrDrug;
                    this.uiEmsDTO.Emsdrugs.Freqct        = drug.Freqct;
                    this.uiEmsDTO.Emsdrugs.Id_freq       = drug.Id_freq;
                    this.uiEmsDTO.Emsdrugs.Name_freq     = drug.Name_freq;
                    this.uiEmsDTO.Emsdrugs.Sd_frequnitct = drug.Sd_frequnitct;
                    this.uiEmsDTO.Emsdrugs.Fg_long       = drug.Fg_long;
                    if (drug.Sd_frequnitct == BdSrvDictCodeConst.SD_FREQUNIT_ONCE)
                    {
                        drug.Use_days = 1;
                        this.uiEmsDTO.Emsdrugs.Use_days = 1;
                    }
                    FillSameFreqInfo(this.uiEmsDTO.Emsdrugs.Id_freq, this.uiEmsDTO.Emsdrugs.Name_freq, this.uiEmsDTO.Emsdrugs.Sd_frequnitct, this.uiEmsDTO.Emsdrugs.Fg_long, this.uiEmsDTO.Emsdrugs.Freqct);

                    this.HandleOrderTimes();
                    this.setQauntum((int)this.uiEmsDTO.Emsdrugs.Times_cur);
                    this.uiEmsDTO.Emsdrugs.EmsOrDrugList.ToList().ForEach(item =>
                    {
                        if (item.Price != null && item.Quan_cur != null)
                        {
                            item.Totalprice = item.Price * item.Quan_cur;
                        }
                    });
                }
                else if (fieldName.Equals("Name_srv") && ds != null)
                {
                    EmsOrDrug drug = ds as EmsOrDrug;


                    if (drug.Fg_ctm != null && drug.Fg_ctm.Value)
                    {
                        drug.Name_mm = String.Format("【{0}】", drug.Name_srv);
                    }
                }


                else if (fieldName.Equals("Name_route"))
                {
                    EmsOrDrug drug = ds as EmsOrDrug;
                    this.FillSameRouteInfo(drug);
                    this.uiEmsDTO.Emsdrugs.Id_route   = drug.Id_route;
                    this.uiEmsDTO.Emsdrugs.Name_route = drug.Name_route;
                    this.id_dosages = LogicEx.GetInstance().getDrugRouteOfDoSages(this.uiEmsDTO.Emsdrugs.Id_route);
                }
                else if (fieldName.Equals("Name_mp_dep"))
                {
                    EmsOrDrug drug = ds as EmsOrDrug;
                    this.uiEmsDTO.Emsdrugs.Id_dep   = drug.Id_mp_dep;
                    this.uiEmsDTO.Emsdrugs.Name_dep = drug.Name_mp_dep;
                }
                else if (fieldName.Equals("Name_dep"))
                {
                    FillSameMpDeptInfo(this.uiEmsDTO.Emsdrugs);
                }
                else if (fieldName.Equals("Name_routedes"))
                {
                    if (!bEdit_Note_or)
                    {
                        logicEx.SetNoteOr(this.uiEmsDTO);
                    }
                }
            }
            return(false);
        }
Esempio n. 21
0
        /// <summary>
        /// 查询医疗单使能编辑状态
        /// </summary>
        /// <param name="o"></param>
        /// <param name="e"></param>
        /// <returns></returns>
        private bool QureyEditEnbale(CiOrderDO o, Ent4BannerDTO e)
        {
            bool bEnable = o.Sd_su_or.Equals("0") && e.Sd_status != EnDictCodeConst.SD_ENSTATUS_OP_FINISH && LogicEx.GetInstance().isIdEmpOrEqualIdpsn(o);

            if (-1 == nOpOrValidTime)
            {
                try {
                    nOpOrValidTime = this.Context.GetOrgParam <int>(ICiOrdNSysParamConst.SYS_PARAM_OpOrValidTime);

                    bEnable &= ((o.Dt_invalid.Value - DateTime.Now).Hours <= nOpOrValidTime);
                }
                catch (XapServiceException ex) {
                    this.SetStatusMsg(ex.ErrorMsg.Message);
                    bEnable = false;
                }
            }

            return(bEnable);
        }
Esempio n. 22
0
        public override bool OrdValivate(object model, BaseEmsView sender)
        {
            EmsDrugItemDO Emsdrugs = (model as EmsDrugsViewModel).GetFormDataSource() as EmsDrugItemDO;

            if (base.OrdValivate(model, sender) && Emsdrugs != null)
            {
                #region 药品重复检查
                IEnumerable <IGrouping <string, EmsOrDrug> > enuma = Emsdrugs.EmsOrDrugList.Where(p => !p.IsDELETED).GroupBy(i => i.Id_mm).Where(g => g.Count() > 1);
                bool bcf = enuma.Count() >= 1;
                if (bcf)
                {
                    foreach (IGrouping <string, EmsOrDrug> group in enuma)
                    {
                        EmsOrDrug ems = group.First();
                        sender.OrdErrorList.Add("药品【" + ems.Name_mm + "】有重复!");
                    }
                }
                #endregion

                #region 空药品
                if (Emsdrugs.EmsOrDrugList.Count(p => !p.IsDELETED && string.IsNullOrEmpty(p.Id_srv)) > 0)
                {
                    sender.OrdErrorList.Add("药品有空数据!");
                }

                #endregion

                #region 剂|总量大于0
                foreach (EmsOrDrug item in Emsdrugs.EmsOrDrugList.Where(p => !p.IsDELETED).ToList())
                {
                    if (item.Quan_med == null || item.Quan_med.ToDouble() <= 0)
                    {
                        sender.OrdErrorList.Add(item.Name_mm + "剂量必须大于0!");
                    }
                    if (item.Quan_cur == null || item.Quan_cur.ToDouble() <= 0)
                    {
                        sender.OrdErrorList.Add(item.Name_mm + "总量必须大于0!");
                    }
                }
                #endregion
                List <string> depMps = new List <string>();
                foreach (EmsOrDrug item in Emsdrugs.EmsOrDrugList.Where(p => !p.IsDELETED).ToList())
                {
                    if (!depMps.Contains(item.Id_mp_dep))
                    {
                        depMps.Add(item.Id_mp_dep);
                    }
                }
                if (depMps.Count() > 1)
                {
                    sender.OrdErrorList.Add("药品的执行科室不一致,不能保存!");
                }
                #region 执行科室校验
                #endregion
                #region 在院执行为true时,在院执行次数必须大于0
                if (Emsdrugs.Fg_mp_in == true && (Emsdrugs.Times_mp_in == null || Emsdrugs.Times_mp_in <= 0))
                {
                    sender.OrdErrorList.Add("在院执行时,在院执行次数必须大于0!");
                }
                #endregion
                #region 药品不能为空
                if (Emsdrugs.EmsOrDrugList.Count(p => !p.IsDELETED) == 0)
                {
                    sender.OrdErrorList.Add("药品不能为空!");
                }
                #endregion


                #region 用药天数必须大于0
                if (Emsdrugs.Use_days < 0)
                {
                    sender.OrdErrorList.Add("用药天数小于0!");
                }
                #endregion
                #region 药品的单价不能为空
                string priceError = "";
                foreach (EmsOrDrug drug in Emsdrugs.EmsOrDrugList.Where(p => !p.IsDELETED))
                {
                    if (drug.Price == null)
                    {
                        priceError += "药品【" + drug.Name_srv + "】的价格为空,请与信息科联系!";
                    }
                }
                if (priceError != "")
                {
                    sender.OrdErrorList.Add(priceError);
                }
                #endregion
                #region 校验每个服务的药品用法是否在剂型关联的用法集合里
                List <string> id_dosages = new List <string>();
                foreach (EmsOrDrug drug in Emsdrugs.EmsOrDrugList.Where(p => !p.IsDELETED))
                {
                    id_dosages.Add(drug.Id_dosage);
                }
                RouteDosageRefDO[] rdros = LogicEx.GetInstance().getRouteDoSageRefDOById_dosages(id_dosages);
                string             error = "";
                foreach (EmsOrDrug drug in Emsdrugs.EmsOrDrugList.Where(p => !p.IsDELETED))
                {
                    RouteDosageRefDO item = rdros.FirstOrDefault(p => p.Id_dosage == drug.Id_dosage && p.Id_route == drug.Id_route);
                    if (item == null)
                    {
                        UdidocDO udidoc = LogicEx.GetInstance().getUdidocDOById(drug.Id_dosage);
                        if (udidoc != null)
                        {
                            error += drug.Name_srv + "剂型为" + udidoc.Name + ",不能使用" + drug.Name_route + "用法;";
                        }
                    }
                }
                if (error != "")
                {
                    sender.OrdErrorList.Add(error);
                }
                #endregion
                #region 药品库存的判断
                string mmcounterror = LogicEx.GetInstance().validateDrugCount(Emsdrugs.EmsOrDrugList.ToList());
                if (!string.IsNullOrEmpty(mmcounterror))
                {
                    sender.OrdErrorList.Add(mmcounterror);
                }
                #endregion
                #region 空数据记录提示
                EmsOrDrug drugitem = Emsdrugs.EmsOrDrugList.Where(p => !p.IsDELETED).ToList().FirstOrDefault(p => p.Id_srv == null);
                if (drugitem != null)
                {
                    sender.OrdErrorList.Add("医疗单列表中存在空数据,请删除后保存");
                }
                #endregion
                #region 用法数据完整性校验
                if (String.IsNullOrEmpty(Emsdrugs.Id_route))
                {
                    sender.OrdErrorList.Add("药品的用法ID为空,请重新选择用法");
                }
                #endregion
            }

            return(sender.OrdErrorList.Count == 0);
        }
Esempio n. 23
0
 /// <summary>
 /// 获取内置算法工具对象
 /// </summary>
 /// <returns></returns>
 public LogicEx GetLogicEx()
 {
     return(LogicEx.GetInstance());
 }
Esempio n. 24
0
        /// <summary>
        /// 医嘱签署
        /// </summary>
        /// <param name="orders"></param>
        /// <param name="patInfo"></param>
        /// <returns></returns>
        public bool SignOrders(CiOrderDO[] orders, Ent4BannerDTO ent4BannerDto, FMap2 map2)
        {
            // TODO:填写医嘱签署逻辑
            if (orders == null || orders.Length == 0)
            {
                return(false);
            }

            OrderOperateDTO operateDTO = new OrderOperateDTO();
            // 增加就诊上下文环境,用户医嘱签署时,在医嘱中保存保外诊断相关属性
            CiEnContextDTO contextDTO = CiEnContextUtil.GetCiEnContext(ent4BannerDto, EmsAppModeEnum.SVEMSAPPMODE, this.context);

            operateDTO.Document = new FArrayList();
            orders.ToList <CiOrderDO>().ForEach(ord => { operateDTO.Document.append(ord.Id_or); });


            operateDTO.EnContext = contextDTO;
            operateDTO.Extension = map2;
            OrderRstDTO orderRstDTO = orderActionSign.exec(new OrderOperateDTO[] { operateDTO })[0];

            if (orderRstDTO == null)
            {
                return(false);
            }
            FMap2 emsExtension = orderRstDTO.Extension;

            if (emsExtension != null)
            {
                if (emsExtension["specilDrugs"] != null)
                {
                    //特殊药判断提示
                    if (!this.IsContinue("提示", emsExtension["specilDrugs"].ToString()))
                    {
                        return(SignOrders(orders, ent4BannerDto, emsExtension));
                    }
                    else
                    {
                        return(false);
                    }
                }
                //医保规则
                if (emsExtension["hprule"] != null)
                {
                    FArrayList2 hplist      = (FArrayList2)emsExtension["hprule"];
                    bool        information = false; // fasle  提示, true 终止

                    if (hplist != null && hplist.Count > 0)
                    {
                        List <MedicalSharingDTO> medicalSharinglist = new List <MedicalSharingDTO>();

                        foreach (MedicalSharingDTO dto in hplist)
                        {
                            if (dto != null && dto.Code == "Stop")
                            {
                                information = true;
                            }
                            medicalSharinglist.Add(dto);
                        }
                        using (MedicalSharingInfoForm from = new MedicalSharingInfoForm(medicalSharinglist))
                        {
                            from.Text = "医保规则验证";
                            if (information)
                            {
                                from.confirmBtn.Visible = false;
                                from.cancelBtn.Text     = "确定";
                            }
                            else
                            {
                                from.cancelBtn.Visible = false;
                                from.confirmBtn.Text   = "确定";
                            }
                            if (from.ShowDialog() == DialogResult.OK)
                            {
                                return(SignOrders(orders, ent4BannerDto, emsExtension));
                            }
                            else
                            {
                                return(false);
                            }
                        }
                    }
                }
                if (emsExtension["willCheckIdOrs"] != null)
                {
                    //医保和临床路径未判断的话,就弹窗进行判断
                    FArrayList   willCheckIdOrs = (FArrayList)emsExtension["willCheckIdOrs"];
                    string[]     id_ors         = willCheckIdOrs.Cast <string>().ToArray();
                    OrReport     report         = new OrReport(id_ors);
                    DialogResult result         = report.ShowDialog(XFormManager.MainFrom);
                    if (result == DialogResult.OK)
                    {
                        FMap2 map = map2;
                        return(SignOrders(orders, ent4BannerDto, map));
                    }
                    else
                    {
                        return(false);
                    }
                }

                if (emsExtension.Keys.Contains("UnCheckIdors"))
                {
                    //开立权限校验
                    FArrayList    uncheckidList = emsExtension["UnCheckIdors"] as FArrayList;
                    List <string> uncheckids    = uncheckidList.Cast <String>().ToList();
                    if (uncheckids.Count == orders.Length)
                    {
                        this.ShowInfo(emsExtension["ErrMsg"].ToString());
                        return(false);
                    }
                    if (!this.IsContinue("提示", emsExtension["ErrMsg"] + "是否继续?"))
                    {
                        return(false);
                    }
                    else
                    {
                        if (uncheckids.Count > 0)
                        {
                            List <CiOrderDO> ciordlist = orders.ToList();
                            foreach (string idor in uncheckids)
                            {
                                ciordlist.Remove(ciordlist.Find(p => p.Id_or == idor.Trim()));
                            }
                            FMap2 map = new FMap2();
                            return(SignOrders(ciordlist.ToArray(), ent4BannerDto, map));
                        }
                    }
                }

                if (emsExtension["checkPatInfoSrvs"] != null)
                {
                    // 如果是毒麻药,需要保存代理人信息
                    FArrayList              checkPatInfoSrvs = (FArrayList)emsExtension["checkPatInfoSrvs"];
                    OrSrvAgentInfoDO        agentInfo        = LogicEx.GetInstance().newOrSrvAgentInfoDOFromBanner(ent4BannerDto);
                    CheckPatAgentInfoDialog dialog           = new CheckPatAgentInfoDialog(agentInfo, checkPatInfoSrvs);
                    if (dialog.ShowDialog() == DialogResult.OK)
                    {
                        this.maintainService.saveCheckPatInfo(checkPatInfoSrvs, agentInfo);
                        FMap2 map = new FMap2();
                        return(SignOrders(orders, ent4BannerDto, map));
                    }
                    else
                    {
                        return(false);
                    }
                }

                this.initMrSignCiOrderList(emsExtension);
            }

            return(true);
        }
Esempio n. 25
0
        //签署
        protected virtual bool SignOrd()
        {
            bool isSignSucc = false;
            var  orders     = this.xapFormControl1.GetSelected <CiOrderDO>();
            // 从选中的列表项目中,过滤出未签署的医嘱项目
            var orderlist = orders.Where(ord => ord.Sd_su_or == CiDictCodeConst.SD_SU_OPEN && ord.Fg_sign == false && LogicEx.GetInstance().isIdEmpOrEqualIdpsn(ord)).ToList();

            if (orderlist.Count > 0)
            {
                if (orderlist.Count == orders.Length)
                {
                    isSignSucc = DoSignOrder(orderlist.ToArray());
                    //this.viewModel.SignCiOrder(orderlist.ToArray(), this.patDo);
                    this.LoadData();
                }
                else
                {
                    // 强制签署,是否需要更严谨的判断
                    if (this.IsContinue("提示", "未签署的医嘱才可【签署】!是否继续操作?"))
                    {
                        isSignSucc = DoSignOrder(orderlist.ToArray());
                        //this.viewModel.SignCiOrder(orderlist.ToArray(), this.patDo);
                        this.LoadData();
                    }
                }
                //OrdListView中签署已经调用这里不再调用
                // if (this.Context.GetOrgParam<int>(ICiOrdNSysParamConst.SYS_PARAM_OpOrSysncro2MrHandleMode) == 0)
                //  {
                //      this.fireCiOrderFlush2mrEvent(this.viewModel.opsignords);
                //  }
            }
            else
            {
                //this.ShowInfo("请选择【未签署】的医嘱项目!");
                this.ShowInfo("请选择当前登录医生开立且【未签署】的医嘱项目!");
            }
            return(isSignSucc);
        }
Esempio n. 26
0
        public bool OrdValivate(ciordems.d.EmsUIDTO headDo, CiorderBaseControl ci)
        {
            #region 出院带药下必须填写总量
            List <string> errList = new List <string>();
            if (headDo.Emsdrugs.Fg_outp != null && headDo.Emsdrugs.Fg_outp.Value)
            {
                foreach (EmsOrDrug item in headDo.Emsdrugs.EmsOrDrugList)
                {
                    if (item.Quan_cur == null || item.Quan_cur.ToDouble() <= 0)
                    {
                        errList.Add("出院带药必须填写总量,且大于0!");
                    }
                }
            }
            #endregion

            #region 开始日期不能小于入院日期
            if (!headDo.IsOpData)
            {
                string errMsg = cof.CompareWithAdmission(headDo.PatInfo.Id_ent, headDo.Emsdrugs.Dt_begin_ui);
                if (!string.IsNullOrEmpty(errMsg))
                {
                    errList.Add(errMsg);
                }
            }
            #endregion


            #region 结束日期不能大于开始日期
            if (headDo.Emsdrugs.Dt_end_ui != null && (headDo.Emsdrugs.Dt_begin_ui > headDo.Emsdrugs.Dt_end_ui))
            {
                errList.Add("结束日期不能在开始日期之前!");
            }

            #endregion



            bool bcf = headDo.Emsdrugs.EmsOrDrugList.GroupBy(i => i.Id_mm).Where(g => g.Count() > 1).Count() >= 1;
            if (bcf)
            {
                ci.OrdErrorList.Add("药品有重复!");
            }
            #region 空药品
            if (headDo.Emsdrugs.EmsOrDrugList.Count(p => p.Id_srv == null || p.Id_srv == "") > 0)
            {
                ci.OrdErrorList.Add("药品有空数据!");
            }

            #endregion

            #region 总量大于0
            foreach (EmsOrDrug item in headDo.Emsdrugs.EmsOrDrugList)
            {
                if (item.Quan_med == null || item.Quan_med.ToDouble() <= 0)
                {
                    ci.OrdErrorList.Add(item.Name_mm + "剂量必须大于0!");
                }
            }
            #endregion


            #region 药品不能为空
            if (headDo.Emsdrugs.EmsOrDrugList.Count == 0)
            {
                errList.Add("药品不能为空!");
            }
            #endregion
            #region
            if (headDo.Emsdrugs.Use_days < 0)
            {
                errList.Add("用药天数小于0!");
            }
            #endregion
            #region 药品库存的判断
            string mmcounterror = LogicEx.GetInstance().validateDrugCount(headDo.Emsdrugs.EmsOrDrugList.ToList());
            if (!string.IsNullOrEmpty(mmcounterror))
            {
                errList.Add(mmcounterror);
            }
            #endregion
            if (errList.Count > 0)
            {
                ci.OrdErrorList.AddRange(errList);
                return(false);
            }
            return(true);
        }
Esempio n. 27
0
        /// <summary>
        /// 签署
        /// </summary>
        /// <param name="orders"></param>
        /// <param name="ent4BannerDto"></param>
        /// <returns></returns>
        public bool SignCiOrder(CiOrderDO[] orders, Ent4BannerDTO ent4BannerDto)
        {
            if (orders.Count() == 0)
            {
                return(false);
            }
            // 增加就诊上下文环境,用户医嘱签署时,在医嘱中保存保外诊断相关属性
            CiEnContextDTO contextDTO = CiEnContextUtil.GetCiEnContext(ent4BannerDto, this.emsAppModeEnum, this.context);
            List <string>  idors      = orders.Select(p => p.Id_or).ToList();
            // 签署,如果不满足签署条件返回提示信息
            ValidateRtnInfoDTO vlInfoDto = this.maintainService.ciOrderSign(idors.ToArray(), contextDTO);
            FMap2 fm1 = vlInfoDto.Scenedatum;

            if (fm1 != null && fm1["specilDrugs"] != null)
            {
                if (this.IsContinue("提示", fm1["specilDrugs"].ToString()))
                {
                    return(false);
                }
            }
            if (fm1 != null && fm1["willCheckIdOrs"] != null)
            {
                //医保和临床路径未判断的话,就弹窗进行判断
                FArrayList   willCheckIdOrs = (FArrayList)fm1["willCheckIdOrs"];
                string[]     id_ors         = willCheckIdOrs.Cast <string>().ToArray();
                OrReport     report         = new OrReport(id_ors);
                DialogResult result         = report.ShowDialog(XFormManager.MainFrom);
                if (result == DialogResult.OK)
                {
                    return(SignCiOrder(orders, ent4BannerDto));
                }
                else
                {
                    return(false);
                }
            }
            //开立权限校验
            if (fm1 != null && fm1.Keys.Contains("UnCheckIdors"))
            {
                FArrayList    uncheckidList = fm1["UnCheckIdors"] as FArrayList;
                List <string> uncheckids    = uncheckidList.Cast <String>().ToList();// fm1["UnCheckIdors"].ToString().Substring(1, fm1["UnCheckIdors"].ToString().Length-2).Split(',').ToList();
                if (uncheckids.Count == orders.Length)
                {
                    this.ShowInfo(fm1["ErrMsg"].ToString());
                    return(false);
                }
                if (!this.IsContinue("提示", fm1["ErrMsg"] + "是否继续?"))
                {
                    return(false);
                }
                else
                {
                    if (uncheckids.Count > 0)
                    {
                        List <CiOrderDO> ciordlist = orders.ToList();
                        foreach (string idor in uncheckids)
                        {
                            ciordlist.Remove(ciordlist.Find(p => p.Id_or == idor.Trim()));
                        }
                        return(SignCiOrder(ciordlist.ToArray(), ent4BannerDto));
                    }
                    else
                    {
                        if (!this.IsContinue("提示", fm1["ErrMsg"] + "是否继续?"))
                        {
                            return(false);
                        }
                        else
                        {
                            if (uncheckids.Count > 0)
                            {
                                List <CiOrderDO> ciordlist = orders.ToList();
                                foreach (string idor in uncheckids)
                                {
                                    ciordlist.Remove(ciordlist.Find(p => p.Id_or == idor.Trim()));
                                }
                                return(SignCiOrder(ciordlist.ToArray(), ent4BannerDto));
                            }
                        }
                    }
                }
            }
            FMap2 HpMesage = vlInfoDto.Rtnvalue;

            if (HpMesage != null)
            {
                String message = (String)HpMesage["HPMessage"];
                if (message != null)
                {
                    this.ShowInfo(message);
                    vlInfoDto = this.maintainService.CiOrderSignMedicalInsurance(vlInfoDto.Scenedatum, code_entp);
                }
            }
            FMap2 fm = vlInfoDto.Rtnvalue;

            if (fm1 != null && fm1["checkPatInfoSrvs"] != null)
            {
                // 如果是毒麻药,需要保存代理人信息
                FArrayList              checkPatInfoSrvs = (FArrayList)fm1["checkPatInfoSrvs"];
                OrSrvAgentInfoDO        agentInfo        = LogicEx.GetInstance().newOrSrvAgentInfoDOFromBanner(ent4BannerDto);
                CheckPatAgentInfoDialog dialog           = new CheckPatAgentInfoDialog(agentInfo, checkPatInfoSrvs);
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    this.maintainService.saveCheckPatInfo(checkPatInfoSrvs, agentInfo);
                }
                else
                {
                    return(false);
                }
            }
            this.InitMrSignCiOrderList(vlInfoDto);
            ReactExtOrsAndStopOrsDO redo = (ReactExtOrsAndStopOrsDO)fm["willstopors"];

            if (!(redo != null && redo.Reactextdos != null && redo.Stopordos != null))
            {
                if (fm1 != null)
                {
                    vlInfoDto = maintainService.ciOrderSignStep1(fm1, ent4BannerDto.Code_entp, contextDTO);
                    this.InitMrSignCiOrderList(vlInfoDto);
                }
                return(true);
            }
            fm1.Add("willstopors", redo);
            FArrayList fa2   = new FArrayList();
            FArrayList extdo = redo.Reactextdos;
            FArrayList wildo = redo.Stopordos;

            if (extdo != null && wildo != null)
            {
                string strReactType       = "";
                string modifyStopTimeSrvs = ""; //修改停止时间的服务名称串
                string addStopTimeSrvs    = ""; //添加停止时间的服务名称串
                if (extdo.Count > 0)
                {
                    int?   reacttype = (extdo[0] as CiorderAggExtDO).Reacttype;
                    string name_or   = (extdo[0] as CiorderAggExtDO).Aggdo.getParentDO().Name_or;
                    if (reacttype != null)
                    {
                        if ((int)reacttype == 1)
                        {
                            strReactType = "全排斥";
                        }
                        else if ((int)reacttype == 2)
                        {
                            strReactType = "组内排斥";
                        }
                    }
                    foreach (CiOrderDO stopordo in wildo)
                    {
                        if (stopordo.Fg_stop == null || stopordo.Fg_stop == false)
                        {
                            addStopTimeSrvs += stopordo.Name_or + ",";
                        }
                        else
                        {
                            modifyStopTimeSrvs += stopordo.Name_or + ",";
                        }
                    }
                    if (addStopTimeSrvs.Length > 0)
                    {
                        addStopTimeSrvs = addStopTimeSrvs.Substring(0, addStopTimeSrvs.Length - 1);
                    }
                    if (modifyStopTimeSrvs.Length > 0)
                    {
                        modifyStopTimeSrvs = modifyStopTimeSrvs.Substring(0, modifyStopTimeSrvs.Length - 1);
                    }
                    string msg = reactOrWarnInfo(name_or, strReactType, addStopTimeSrvs, modifyStopTimeSrvs);
                    var    a   = MessageBoxEx.Show(msg, "医嘱排斥", MessageBoxButtons.YesNo);
                    if (a == DialogResult.Yes)
                    {
                        maintainService.ciOrderSignStep1(fm1, ent4BannerDto.Code_entp, contextDTO);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
Esempio n. 28
0
        public bool OrdValivate(EmsUIDTO headDo, CiorderBaseControl ci)
        {
            List <string> errList = new List <string>();

            if (headDo.Emsdrugs.EmsOrDrugList.Count == 0)
            {
                errList.Add("请选择药品服务!");
                ci.OrdErrorList.AddRange(errList);
                return(false);
            }
            #region 出院带药下必须填写总量
            if (headDo.Emsdrugs.Fg_outp.Value)
            {
                foreach (EmsOrDrug item in headDo.Emsdrugs.EmsOrDrugList)
                {
                    if (item.Quan_cur == null || item.Quan_cur.ToDouble() <= 0)
                    {
                        errList.Add("出院带药必须填写总量,且大于0!");
                    }
                    if (item.Name_unit_sale == null || item.Name_unit_sale == "")
                    {
                        errList.Add("出院带药必须填写总量单位!");
                    }
                }
            }
            foreach (EmsOrDrug item in headDo.Emsdrugs.EmsOrDrugList)
            {
                if (item.Quan_med == null || item.Quan_med.ToDouble() <= 0)
                {
                    errList.Add(item.Name_srv + "剂量不能为空且要求大于0!");
                }
            }
            #endregion
            #region 长期标志下,使用天数必填

            #endregion
            #region 总量不能为0
            //foreach (EmsOrDrug item in headDo.Emsdrugs.EmsOrDrugList)
            //{
            //    if (item.Quan_cur == null || item.Quan_cur.Value == 0 || item.Quan_cur.Value < 0)
            //    {
            //        errList.Add("总量必须大于0!");
            //    }
            //}
            #endregion

            #region 执行次数不能大于频次数
            if (!headDo.IsOpData)
            {
                //if (headDo.Emsdrugs.Quan_firday_mp == null)
                //{
                //    errList.Add("首次执行次数不能为空!");
                //}
                if ((headDo.Emsdrugs.Freqct != null) && (headDo.Emsdrugs.Quan_firday_mp > headDo.Emsdrugs.Freqct))
                {
                    errList.Add("首次执行次数不能大于医嘱频次数!");
                }
            }


            #endregion

            #region

            #endregion

            #region 开始日期不能小于入院日期
            string errMsg = cof.CompareWithAdmission(headDo.PatInfo.Id_ent, headDo.Emsdrugs.Dt_begin_ui);
            if (!string.IsNullOrEmpty(errMsg))
            {
                errList.Add(errMsg);
            }
            #endregion



            #region 结束日期不能小于开始日期
            if (headDo.Emsdrugs.Dt_end_ui != null && (headDo.Emsdrugs.Dt_begin_ui > headDo.Emsdrugs.Dt_end_ui))
            {
                errList.Add("结束日期不能在开始日期之前!");
            }

            #endregion



            #region  频次=星期时,当录入值必须为7的倍数
            if (!string.IsNullOrEmpty(headDo.Emsdrugs.Sd_srvtp) && headDo.Emsdrugs.Sd_srvtp.Equals(BdSrvDictCodeConst.SD_FREQUNIT_WEEK) && headDo.Emsdrugs.Use_days % 7 != 0)
            {
                errList.Add("周为频次下,天数必须是7的倍数!");
            }
            #endregion

            #region 药品库存的判断
            string mmcounterror = LogicEx.GetInstance().validateDrugCount(headDo.Emsdrugs.EmsOrDrugList.ToList());
            if (!string.IsNullOrEmpty(mmcounterror))
            {
                errList.Add(mmcounterror);
            }
            #endregion



            if (errList.Count > 0)
            {
                ci.OrdErrorList.AddRange(errList);
                return(false);
            }
            return(true);
        }
Esempio n. 29
0
        public override void HandleState(object sender, DictionaryEventArgs e)
        {
            IMedreferralCrudService service = XapServiceMgr.find <IMedreferralCrudService>();
            String eventCode = AssToolEx.EventCodeOfEventArgs(e);

            if (eventCode.Equals("MedReferralSaveAction"))
            {
                if (ViewModel.MedReferralDO.Dt_referralperiodbegin > ViewModel.MedReferralDO.Dt_referralperiodend)
                {
                    EventDelegate.ShowInfo(OrdParam.MESSAGE_TIEMCHECK);
                    return;
                }

                if ((ViewModel.MedReferralDO.Str_name_di != null && ViewModel.MedReferralDO.Str_name_di.Length > 300) ||
                    (ViewModel.MedReferralDO.Reason_referral != null && ViewModel.MedReferralDO.Reason_referral.Length > 300) ||
                    (ViewModel.MedReferralDO.Des_initialdiag != null && ViewModel.MedReferralDO.Des_initialdiag.Length > 300) ||
                    (ViewModel.MedReferralDO.Des_question != null && ViewModel.MedReferralDO.Des_question.Length > 300) ||
                    (ViewModel.MedReferralDO.Diagtreatment != null && ViewModel.MedReferralDO.Diagtreatment.Length > 300))
                {
                    EventDelegate.ShowInfo("填写内容超长!");
                    return;
                }

                if (String.IsNullOrWhiteSpace(ViewModel.MedReferralDO.Str_name_di) ||
                    String.IsNullOrWhiteSpace(ViewModel.MedReferralDO.Reason_referral) ||
                    String.IsNullOrWhiteSpace(ViewModel.MedReferralDO.Name_org_referral2))
                {
                    EventDelegate.ShowInfo("请填写必填项!");
                    return;
                }

                dataSource = service.save(new MedReferralDO[] { ViewModel.GetFormDataSource() as MedReferralDO })[0];
                if (null != dataSource)
                {
                    LogicEx.GetInstance().CopyTo <MedReferralDO>(dataSource, ViewModel.MedReferralDO);
                    EventDelegate.SetStatusMsg("医保转诊单保存成功。");
                }
                else
                {
                    EventDelegate.ShowInfo("医保转诊单保存失败。");
                }
            }
            else if (eventCode.Equals("MedReferralPrintAction"))
            {
                if (ViewModel.MedReferralDO == null || ViewModel.MedReferralDO.Id_medreferral == null)
                {
                    return;
                }
                bool   res     = false;
                string strFile = "iih_report/461010_menzhenyishengzhan/YBZZD.xml";

                Dictionary <string, string> qryParams = new Dictionary <string, string>();
                qryParams.Add("$id_medreferral", ViewModel.MedReferralDO.Id_medreferral);

                res = this.rpt_viewer.PrintRptFile(strFile, qryParams, true);

                if (res)
                {
                    ViewModel.MedReferralDO.Times_print += 1;
                    ViewModel.MedReferralDO.Status       = DOStatus.UPDATED;
                    dataSource = service.save(new MedReferralDO[] { ViewModel.MedReferralDO })[0];
                    eventPrint(null, null);
                }
            }
        }
Esempio n. 30
0
 void cancelButton_MouseClick(object sender, MouseEventArgs e)
 {
     LogicEx.GetInstance().CopyTo(drugmm, sourcemm, true);
     Close();
 }