Beispiel #1
0
        }//频次

        protected override void OnRefResult(object sender, RefResultEventArgs e)
        {
            RefDataCollection data = e.RefResultSet;

            if (e.BindingFieldName == "Name_freq")
            {
                if (data.IsEmpty)
                {
                    EmsHeadDO.Emsdrugs.Sd_frequnitct = null;
                    EmsHeadDO.Emsdrugs.Id_freq       = null;
                    EmsHeadDO.Emsdrugs.Freqct        = null;
                    return;
                }
                string id_freq = data.FirstData["Id_freq"] as string;//获取字段值
                EmsHeadDO.Emsdrugs.Sd_frequnitct = data.FirstData["Sd_frequnitct"] as string;
                EmsHeadDO.Emsdrugs.Freqct        = null;
                this.setTime_cur();
                setQauntum(this.EmsHeadDO.Emsdrugs.Orders);
            }
            if (e.BindingFieldName.Equals("Name_srv"))
            {
                //新增时候 参照写会
                EmsOrDrug drugNew = gv.GetFocusedRow().RowDataSource as EmsOrDrug;
                if (e.RefResultSet.IsEmpty)
                {
                    drugNew.Id_srv         = "";
                    drugNew.Name_srv       = "";
                    drugNew.Spec_mm        = "";
                    drugNew.Quan_med       = null;
                    drugNew.Name_unit_med  = "";
                    drugNew.Quan_cur       = null;
                    drugNew.Name_unit_sale = "";
                    drugNew.Note_ext       = "";
                    drugNew.Name_mm        = "";
                    drugNew.Name_boildes   = "";
                    return;
                }
                string strSrv = data.FirstData["Name"].ToString();
                if (EmsHeadDO.Emsdrugs.EmsOrDrugList.Count(p => p.Name_srv == strSrv) > 1)
                {
                    this.ShowInfo("存在相同的服务!");
                    drugNew.Name_srv = null;
                    drugNew.Id_srv   = null;
                    return;
                }
                drugNew.Quan_med = double.Parse(data.FirstData["Quan_med"].ToString());
                XapDataList <EmsOrDrug> drugs = cof.GetSrvMm(EmsHeadDO, drugNew.Id_srv, EmsHeadDO.PatInfo.Code_entp);
                if (drugs.Count > 0)
                {
                    EmsOrDrug drugRef = drugs.FirstOrDefault();
                    cof.CopyTo(drugRef, drugNew, "Id_srv", "Name_srv");
                    cof.concateExtNote(new XapDataList <EmsOrDrug>()
                    {
                        drugNew
                    }, EmsHeadDO.PatInfo, EmsHeadDO);
                }
                this.setTime_cur();
                setQauntum(this.EmsHeadDO.Emsdrugs.Orders);
            }
        }
Beispiel #2
0
        //频次
        protected override void OnRefResult(object sender, RefResultEventArgs e)
        {
            RefDataCollection data = e.RefResultSet;

            if (e.BindingFieldName.Equals("Name_srv"))
            {
                string id_srv        = data.FirstData["Id_srv"] as string;
                int    drugListCount = this.EmsHeadDO.Emsdrugs.EmsOrDrugList.Count;
                for (int i = 0; i < drugListCount - 1; i++)
                {
                    EmsOrDrug tmpEmsOrDrug = this.EmsHeadDO.Emsdrugs.EmsOrDrugList[i];
                    if (tmpEmsOrDrug.Id_srv == id_srv)
                    {
                        this.ShowInfo("服务重复!");
                        this.EmsHeadDO.Emsdrugs.EmsOrDrugList[this.EmsHeadDO.Emsdrugs.EmsOrDrugList.Count - 1].Id_srv         = "";
                        this.EmsHeadDO.Emsdrugs.EmsOrDrugList[this.EmsHeadDO.Emsdrugs.EmsOrDrugList.Count - 1].Name_srv       = "";
                        this.EmsHeadDO.Emsdrugs.EmsOrDrugList[this.EmsHeadDO.Emsdrugs.EmsOrDrugList.Count - 1].Spec_mm        = "";
                        this.EmsHeadDO.Emsdrugs.EmsOrDrugList[this.EmsHeadDO.Emsdrugs.EmsOrDrugList.Count - 1].Quan_med       = null;
                        this.EmsHeadDO.Emsdrugs.EmsOrDrugList[this.EmsHeadDO.Emsdrugs.EmsOrDrugList.Count - 1].Name_unit_med  = "";
                        this.EmsHeadDO.Emsdrugs.EmsOrDrugList[this.EmsHeadDO.Emsdrugs.EmsOrDrugList.Count - 1].Quan_cur       = null;
                        this.EmsHeadDO.Emsdrugs.EmsOrDrugList[this.EmsHeadDO.Emsdrugs.EmsOrDrugList.Count - 1].Name_unit_sale = "";
                        //btnDel_MouseClick(null,null);
                        //this.EmsHeadDO.Emsdrugs.EmsOrDrugList.AddNew();
                        return;
                    }
                }
                //.EmsOrDrugList[focusOrDrug];

                XapDataList <EmsOrDrug> drugs = cof.GetSrvMm(this.EmsHeadDO, id_srv, this.EmsHeadDO.PatInfo.Code_entp);
                if (drugs.Count > 0)
                {
                    EmsOrDrug drugRef = drugs.FirstOrDefault();
                    EmsOrDrug drugNew = xapFormControl1.GetFocused <EmsOrDrug>("drug");
                    cof.CopyTo(drugRef, drugNew, "Id_srv", "Name_srv");
                }
                if (this.EmsHeadDO.Emsdrugs.Fg_outp == true)
                {
                    this.manageUnitName("out");
                }
                else
                {
                    this.manageUnitName("in");
                }
                cof.GetDrugTotal(this.EmsHeadDO);
            }
            else if (e.BindingFieldName.Equals("Name_unit_sale"))
            {
                cof.GetDrugTotal(this.EmsHeadDO);
            }
            if (e.BindingFieldName == "Name_freq")
            {
                //RefDataCollection data = e.RefResultSet;
                string id_freq = data.FirstData["Id_freq"] as string;//获取字段值
                this.EmsHeadDO.Emsdrugs.Sd_frequnitct = data.FirstData["Sd_frequnitct"] as string;
                this.EmsHeadDO.Emsdrugs.Freqct        = null;
                if (data.FirstData["Freqct"].ToString() != "")
                {
                    this.EmsHeadDO.Emsdrugs.Freqct = int.Parse(data.FirstData["Freqct"].ToString());
                }
                this.EmsHeadDO.Emsdrugs.Fg_long = data.FirstData["Fg_long"].ToString() == "Y" ? true : false;
                GetMpTimes(this.EmsHeadDO.Emsdrugs.Id_freq);
                if (cof.getControlByName(xapFormControl1, "drugsUse", "fg_outp").ValueText == "true")
                {
                    cof.GetDrugTotal(this.EmsHeadDO);
                }
                if (data.FirstData["Fg_prnor"].ToString() == "Y")// 备用医嘱 true 并且 长临为 临时
                {
                    XLabelBaseUserRender tmpRender = cof.getControlByName(xapFormControl1, "drugsUse", "fg_long");
                    int h = 0;//高度变动值
                    if (tmpRender.ValueCode == "False")
                    {
                        if (cof.getControlByName(xapFormControl1, "drugsUse", "dt_fail").Visible == false)
                        {
                            h += 29;
                        }
                        cof.getControlByName(xapFormControl1, "drugsUse", "dt_fail").Visible = true;//临时医嘱失效日期

                        this.EmsHeadDO.Emsdrugs.Dt_fail = cof.GetSpareEndTime(this.EmsHeadDO.Emsdrugs.Dt_begin_ui.Value);
                        dt_fail.MinDate = this.EmsHeadDO.Emsdrugs.Dt_begin_ui.Value.AddDays(-1);
                        dt_fail.MaxDate = this.EmsHeadDO.Emsdrugs.Dt_begin_ui.Value.AddHours(this.Context.GetOrgParam <int>(ICiOrdNSysParamConst.SYS_PARAM_TemporaryPrnOrValidTime));
                        cof.getControlByName(xapFormControl1, "drugsUse", "bak_des").ValueText = "";
                    }
                    else
                    {
                        if (cof.getControlByName(xapFormControl1, "drugsUse", "dt_fail").Visible == true)
                        {
                            h += -29;
                        }
                        cof.getControlByName(xapFormControl1, "drugsUse", "dt_fail").Visible = false;//长期医嘱失效日期禁用

                        this.EmsHeadDO.Emsdrugs.Dt_fail  = null;
                        this.EmsHeadDO.Emsdrugs.Use_days = null;
                        cof.getControlByName(xapFormControl1, "drugsUse", "bak_des").ValueText = "执行最小间隔时间:6小时。";
                    }
                    if (cof.getControlByName(xapFormControl1, "drugsUse", "bak_des").Visible == false)
                    {
                        h += 29;
                    }
                    cof.getControlByName(xapFormControl1, "drugsUse", "bak_des").Visible = true;
                    cof.adjustHeight(this.xapFormControl1, "drugsUse", adjustHeightIds, h);
                    this.xapFormControl1.Refresh();
                }
                else
                {
                    int h = 0;
                    if (cof.getControlByName(xapFormControl1, "drugsUse", "dt_fail").Visible == true)
                    {
                        h += -29;
                    }
                    cof.getControlByName(xapFormControl1, "drugsUse", "dt_fail").Visible = false;//临时医嘱失效日期
                    if (cof.getControlByName(xapFormControl1, "drugsUse", "bak_des").Visible == true)
                    {
                        h += -29;
                    }
                    cof.getControlByName(xapFormControl1, "drugsUse", "bak_des").Visible = false;

                    //cof.adjustHeight(this.xapFormControl1,"drugsUse", adjustHeightIds, 20, "up");
                    cof.getControlByName(xapFormControl1, "drugsUse", "bak_des").ValueText = "";
                    this.EmsHeadDO.Emsdrugs.Dt_fail = null;
                    cof.adjustHeight(this.xapFormControl1, "drugsUse", adjustHeightIds, h);
                    this.xapFormControl1.Refresh();
                }

                //可将下面放到算法里
                if (this.EmsHeadDO.Emsdrugs.Fg_pmor.Value && !this.EmsHeadDO.Emsdrugs.Fg_long.Value) // 临时医嘱 true 并且 长临为 临时
                {
                    cof.getControlByName(xapFormControl1, "drugsUse", "dt_fail").Enabled = true;     //临时医嘱失效日期
                    this.EmsHeadDO.Emsdrugs.Dt_fail = cof.GetSpareEndTime(this.EmsHeadDO.Emsdrugs.Dt_begin_ui.Value);
                }
                else
                {
                    cof.getControlByName(xapFormControl1, "drugsUse", "dt_fail").Enabled = false;//临时医嘱失效日期
                    this.EmsHeadDO.Emsdrugs.Dt_fail = null;
                }
                //获取总量

                if (data.FirstData["Fg_long_edit"].ToString() == "Y")
                {
                    cof.getControlByName(xapFormControl1, "drugsUse", "fg_long").Enabled = true;
                }
                else
                {
                    cof.getControlByName(xapFormControl1, "drugsUse", "fg_long").Enabled = false;
                }

                if (this.EmsHeadDO.Emsdrugs.Fg_long == false)
                { //如果是临时的 使用天数和结束日期置灰
                    cof.getControlByName(xapFormControl1, "drugsUse", "Use_days").Enabled  = false;
                    cof.getControlByName(xapFormControl1, "drugsUse", "dt_end_ui").Enabled = false;
                }
                else
                {
                    cof.getControlByName(xapFormControl1, "drugsUse", "Use_days").Enabled  = true;
                    cof.getControlByName(xapFormControl1, "drugsUse", "dt_end_ui").Enabled = true;
                }
            }
        }
        public void setEmsOrDrugList(XapDataList <EmsOrDrug> list)
        {
            lock (this) {
                IMaterialStockService stoctService = XapServiceMgr.find <IMaterialStockService>();
                List <GetStockReqDTO> reqDtos      = new List <GetStockReqDTO>();
                if (emsOrDrugList == null)
                {
                    emsOrDrugList = new XapDataList <EmsOrDrug>();
                }
                for (int i = 0; i < list.Count; i++)
                {
                    if (list[i].Fg_mm == true)
                    {
                        GetStockReqDTO reqDTO = new GetStockReqDTO();
                        reqDTO.Id_mm       = list[i].Id_mm;
                        reqDTO.Id_dep      = list[i].Id_dep_wh;
                        reqDTO.Req_unit_id = list[i].Id_unit_sale;
                        reqDtos.Add(reqDTO);
                    }
                }
                if (reqDtos.Count > 0)
                {
                    MaterialStockDTO[] stockdto = null;
                    try
                    {
                        stockdto = stoctService.getMaterialStocks(reqDtos.ToArray());
                    }
                    catch (Exception ex)
                    {
                        ex.Publish();
                        //this.ShowInfo(ex.Message);
                    }
                    if (stockdto == null)
                    {
                        return;
                    }
                    for (int i = list.Count - 1; i >= 0; i--)
                    {
                        MaterialStockDTO materialDo = stockdto.FirstOrDefault(p => p.Id_mm == list[i].Id_mm);
                        if (materialDo != null)
                        {
                            FDouble mmcount  = materialDo.Quan_stock;
                            int?    mmStatus = materialDo.Mmstatus;
                            //药房无此药的移除
                            if (mmStatus != null && mmStatus == (int)MaterialStatus.NORELATION)
                            {
                                list.RemoveAt(i);
                            }
                            else
                            {
                                list[i].Fact_count = mmcount;
                                list[i].Price      = materialDo.Price_act;
                                list[i].Mmstatus   = materialDo.Mmstatus;

                                EmsOrDrug ems = emsOrDrugList.FirstOrDefault(p => p.Id_mm == list[i].Id_mm);
                                if (ems != null)
                                {
                                    emsOrDrugList.Remove(ems);
                                }
                                emsOrDrugList.Add(list[i]);
                            }
                        }
                    }
                    List <EmsOrDrug> sortList = null;
                    try
                    {
                        sortList = emsOrDrugList.OrderByDescending(p => p.Fact_count).OrderBy(p => p.Mmstatus).ToList();
                    }
                    catch //(Exception e)
                    {
                        // e.Message;
                    }

                    if (emsOrDrugList == null)
                    {
                        emsOrDrugList = new XapDataList <EmsOrDrug>();
                    }
                    else
                    {
                        emsOrDrugList.Clear();
                    }
                    sortList.ForEach(p => emsOrDrugList.Add(p));
                }
            }
        }
Beispiel #4
0
        //void btnOK_MouseClick(object sender, MouseEventArgs e)
        //{
        //    xapFormControl1.SaveForm();
        //    this.Save(this);
        //    EmsHeadDO.Sd_srvtp="";

        //}
        //频次
        protected override void OnRefResult(object sender, RefResultEventArgs e)
        {
            RefDataCollection data = e.RefResultSet;

            if (data == null || data.Count == 0)
            {
                this.ShowInfo("频次为空");
                return;
            }
            if (e.BindingFieldName == "Name_freq")
            {
                string id_freq  = data.FirstData["Id_freq"] as string;//获取字段值
                string frequnit = data.FirstData["Id_freq"] as string;
                int    freqct   = int.Parse(data.FirstData["Freqct"].ToString());
                EmsHeadDO.Emsdrugs.Freqct        = int.Parse(data.FirstData["Freqct"].ToString());
                EmsHeadDO.Emsdrugs.Sd_frequnitct = data.FirstData["Sd_frequnitct"] as string;
                GetDoseDrugData(id_freq);
                EmsHeadDO.Emsdrugs.Work_time = cof.GetWorkTime(id_freq);
                this.setTime_cur();
                setQauntum(this.EmsHeadDO.Emsdrugs.Times_cur);
                fgoutstate();
            }

            //新增时候 参照写会
            EmsOrDrug drugNew = xapFormControl1.GetFocused <EmsOrDrug>("drug");

            if (e.BindingFieldName.Equals("Name_srv"))
            {
                if (e.RefResultSet.IsEmpty)
                {
                    drugNew.Id_srv         = "";
                    drugNew.Name_srv       = "";
                    drugNew.Spec_mm        = "";
                    drugNew.Quan_med       = null;
                    drugNew.Name_unit_med  = "";
                    drugNew.Quan_cur       = null;
                    drugNew.Name_unit_sale = "";
                    drugNew.Note_ext       = "";
                    drugNew.Name_mm        = "";
                    return;
                }
                int focuIndex = gv.DataTable.FocusedRow.Index;
                if (data.FirstData["Id_srv"] == null)
                {
                    return;
                }
                string id_srv = data.FirstData["Id_srv"] as string;
                string fg_ctm = data.FirstData["Fg_ctm"] as string;
                if (fg_ctm == null || "N" == fg_ctm)
                {
                    drugNew.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(item_PropertyChanged);
                    XapDataList <EmsOrDrug> drugs = cof.GetSrvMm(EmsHeadDO, id_srv, EmsHeadDO.PatInfo.Code_entp);

                    if (drugs.Count > 0)
                    {
                        //执行科室填充
                        DrugUtils.fillExecDetps(drugs, EmsHeadDO.Emsdrugs.Id_route, EmsHeadDO.PatInfo);
                        foreach (EmsOrDrug ems in drugs)
                        {
                            if (EmsHeadDO.Emsdrugs.EmsOrDrug.Contains(ems))
                            {
                                continue;
                            }
                            EmsHeadDO.Emsdrugs.EmsOrDrug.Add(ems);
                        }
                        EmsOrDrug drugRef = drugs.FirstOrDefault();
                        if (drugRef.Fg_skintest != null && drugRef.Fg_skintest == true)
                        {
                            SkinTestLogic logic = new SkinTestLogic(EmsHeadDO.PatInfo);
                            if (logic.skinTestLogic(drugRef).Equals("0"))
                            {
                                return;
                            }
                        }
                        cof.CopyTo(drugRef, drugNew, "Id_srv", "Name_srv");
                        cof.concateMMSpecAndName(drugNew);
                        cof.concateExtNote(new XapDataList <EmsOrDrug> {
                            drugNew
                        }, EmsHeadDO.PatInfo, EmsHeadDO);
                        //新启动一个线程设置服务的物品库存信息
                        cof.threadSetMaterialInfoOfDrug(drugs, middle);
                        this.setTime_cur();
                        setQauntum(this.EmsHeadDO.Emsdrugs.Times_cur);
                        //毒麻药品核对患者信息
                        //if (cof.verifyPois(drugNew.Fg_pois.Value, drugNew.Sd_pois))
                        //{
                        //    OrSrvAgentInfoDO agentInfo = cof.newOrSrvAgentInfoDOFromBanner(EmsHeadDO.PatInfo);
                        //    if (drugNew.Agentinfolist == null) {
                        //        drugNew.Agentinfolist = new FArrayList();
                        //    }
                        //    drugNew.Agentinfolist.Add(agentInfo);
                        //    CheckPatAgentInfoDialog dialog = new CheckPatAgentInfoDialog(agentInfo);
                        //    dialog.ShowDialog();
                        //}
                    }
                    else
                    {
                        this.ShowInfo("服务未绑定物品,请与信息科联系!", "提示");
                        drugNew.Id_srv         = "";
                        drugNew.Name_srv       = "";
                        drugNew.Spec_mm        = "";
                        drugNew.Quan_med       = null;
                        drugNew.Name_unit_med  = "";
                        drugNew.Quan_cur       = null;
                        drugNew.Name_unit_sale = "";
                        return;
                    }
                }
                else
                {
                    //参照回写是自定义服务时的操作
                    handleRefResultSrvIsFtmSrv(drugNew);
                }
            }
            this.updateTableCustomerComtrol();
        }
Beispiel #5
0
        protected override void OnRefResult(object sender, RefResultEventArgs e)
        {
            RefDataCollection data = e.RefResultSet;

            if (data.Count == 0)
            {
                return;
            }
            if (e.BindingFieldName == "Name_freq")
            {
                if (e.RefResultSet.IsEmpty)
                {
                    return;
                }
                string id_freq = data.FirstData["Id_freq"] as string;//获取字段值
                this.EmsHeadDO.Emsdrugs.Sd_frequnitct = data.FirstData["Sd_frequnitct"] as string;
                this.EmsHeadDO.Emsdrugs.Freqct        = null;
                if (data.FirstData["Freqct"].ToString() != "")
                {
                    this.EmsHeadDO.Emsdrugs.Freqct = int.Parse(data.FirstData["Freqct"].ToString());
                }
                this.EmsHeadDO.Emsdrugs.Fg_long = data.FirstData["Fg_long"].ToString() == "Y" ? true : false;
            }
            string code_freq = data.FirstData["Code"] as string;//获取字段值

            if (code_freq == "once")
            {
                this.EmsHeadDO.Emsdrugs.Fg_long = false;//长临标识 变临时
                //getControlByName("drugsUse", "fg_long").Enabled = false;//

                this.EmsHeadDO.Emsdrugs.Dt_end_ui = this.EmsHeadDO.Emsdrugs.Dt_begin_ui;
            }

            if (e.BindingFieldName.Equals("Name_srv"))
            {
                //新增时候 参照写会
                EmsOrDrug drugNew = gv.GetFocusedRow().RowDataSource as EmsOrDrug;
                string    strSrv  = data.FirstData["Name"].ToString();
                if (this.EmsHeadDO.Emsdrugs.EmsOrDrugList.Count(p => p.Name_srv == strSrv) > 1)
                {
                    this.ShowInfo("存在相同的服务!");
                    drugNew.Name_srv = null;
                    drugNew.Id_srv   = null;
                    return;
                }
                drugNew.Quan_med = data.FirstData["Quan_med"] == null?null:new FDouble(data.FirstData["Quan_med"].ToString());
                XapDataList <EmsOrDrug> drugs = cof.GetSrvMm(this.EmsHeadDO, drugNew.Id_srv, this.EmsHeadDO.PatInfo.Code_entp);
                if (drugs.Count > 0)
                {
                    EmsOrDrug drugRef = drugs.FirstOrDefault();
                    cof.CopyTo(drugRef, drugNew, "Id_srv", "Name_srv");
                    cof.concateExtNote(new XapDataList <EmsOrDrug>()
                    {
                        drugNew
                    }, this.EmsHeadDO.PatInfo, this.EmsHeadDO);
                }
                else
                {
                    this.ShowInfo("服务未绑定物品,请与信息科联系!", "提示");
                    drugNew.Id_srv         = "";
                    drugNew.Name_srv       = "";
                    drugNew.Name_mm        = "";
                    drugNew.Id_mm          = "";
                    drugNew.Spec_mm        = "";
                    drugNew.Quan_med       = null;
                    drugNew.Name_unit_med  = "";
                    drugNew.Quan_cur       = null;
                    drugNew.Name_unit_sale = "";
                    return;
                }
            }
        }