예제 #1
0
        private void xapFormControl1_FormCreated(object sender, EventArgs e)
        {
            cof.getControlByName(xapFormControl1, "drugsUse", "fg_long").Enabled = false;
            cof.getControlByName(xapFormControl1, "drugsUse", "bak_des").Visible = false;
            cof.getControlByName(xapFormControl1, "drugsUse", "dt_fail").Visible = false;

            this.EmsHeadDO.Emsdrugs.Fg_treat = true;//默认为治疗用药

            cof.adjustHeight(this.xapFormControl1, "drugsUse", adjustHeightIds, -58);
            XTabControl       tabControl = new XTabControl();
            List <ControlTab> tabs       = xapFormControl1.FormModel.Tabs;

            dic            = tabs[0].Pages[0].DicUserRenders;
            gv             = xapFormControl1.GetGridView("drug");//药品列表
            gv.MouseClick += new MouseEventHandler(gv_MouseClick);

            gv_change         = this.xapFormControl1.GetGridView("change");//变动用药
            gv_change.Visible = false;

            //SetGridPolicy(true);
            xapFormControl1.SetTabPageEnabled("drugsUse", !IsReadOnly);

            SetGridPolicy(!IsReadOnly);
            cof.getControlByName(xapFormControl1, "drugsUse", "fg_long").Enabled = false;
            if (cof.getControlByName(xapFormControl1, "drugsUse", "fg_long").ValueCode == "True" && this.EmsHeadDO.IsNEW)
            {
                this.EmsHeadDO.Emsdrugs.Use_days = null;
            }

            //cof.getControlByName(xapFormControl1,"drugsUse", "fg_long").Visible = false;
            gv.ReadOnly = false;
            gv.DataTable.Columns[0].ReadOnly                = true;
            gv.DataTable.Columns[1].ReadOnly                = true;
            gv.DataTable.Columns[4].ReadOnly                = true;
            gv.DataTable.Columns["Quan_cur"].ReadOnly       = true;
            gv.DataTable.Columns["Name_unit_sale"].ReadOnly = true;
            XTabControl tabControl1 = tabs[0].tabContrl;
            XTabPage    xtab        = tabControl1.XTabPages[1];

            tabControl1.SelectedIndexChanged += new XTabControl.selectedIndexChanged(tabControl1_SelectedIndexChanged);
            xtab.Controls.Clear();
            xtab.Controls.Add(desView);
            //失效日期控件
            UserRender usfail = xapFormControl1.GetUserRender("drugsUse", "dt_fail");

            dt_fail = usfail.Renders[0] as xap.cli.sdk.render.Items.XCalendarTimerComboBox;

            cof.getControlByName(xapFormControl1, "drugsUse", "work_time").LostFocus += new EventHandler(Work_time_LostFocus);
            cof.getControlByName(xapFormControl1, "drugsUse", "dt_fail").LostFocus   += new EventHandler(Dt_fail_LostFocus);

            if (this.EmsHeadDO.Emsdrugs.EmsOrDrugList[0].Id_anti == null)
            {
            }
        }
예제 #2
0
        void xapFormControl1_DataChanged(object sender, DataChangedEventArgs e)
        {
            switch (e.PropName)//计算结束日期
            {
            case "Dt_begin_ui":
                DateTime adm  = cof.GetServerDataTime();  //TODO: 入院时间
                string   info = cof.CompareWithAdmission(EmsHeadDO.PatInfo.Id_ent, EmsHeadDO.Emsdrugs.Dt_begin_ui);
                if (info != "")
                {
                    this.ShowInfo(info);
                    return;
                }
                if (EmsHeadDO.Emsdrugs.Dt_begin_ui != null)
                {
                    UserRender us = xapFormControl1.GetUserRender("drugsUse", "dt_end_ui");
                    xap.cli.sdk.render.Items.XCalendarTimerComboBox dt_begin = us.Renders[0] as xap.cli.sdk.render.Items.XCalendarTimerComboBox;
                    dt_begin.MinDate = EmsHeadDO.Emsdrugs.Dt_begin_ui.Value;
                }
                //草药在拆分时必须要有结束时间,出院带药界面中没有结束时间控件,所以将结束时间设为开始往后7天
                //EmsHeadDO.Emsdrugs.Dt_end_ui = ((DateTime)EmsHeadDO.Emsdrugs.Dt_begin_ui).AddDays(7);
                break;

            case "Dt_end_ui":    //计算医嘱天数
                EmsHeadDO.Emsdrugs.Use_days = cof.GetUseDays(EmsHeadDO.Emsdrugs.Dt_begin_ui, EmsHeadDO.Emsdrugs.Dt_end_ui);
                break;

            case "Orders":
                if (EmsHeadDO.Emsdrugs.Orders != null)
                {
                    ((XNumbericUpDown)((XLabelBaseUserRender)xapFormControl1.GetUserRender("drugsUse", "orders_boil")).UserRender).MaxValue = (double)EmsHeadDO.Emsdrugs.Orders;
                    EmsHeadDO.Emsdrugs.Orders_boil = EmsHeadDO.Emsdrugs.Orders;
                }
                this.setTime_cur();
                setQauntum(this.EmsHeadDO.Emsdrugs.Orders);
                break;
            }
            if (!userEditFlag && !e.PropName.Equals("Note_or"))
            {
                cof.SetNoteOr(this.EmsHeadDO);
            }
        }
예제 #3
0
        void xapFormControl1_FormCreated(object sender, EventArgs e)
        {
            //备用条件和失效日期隐藏
            cof.getControlByName(xapFormControl1, "drugsUse", "bak_des").Visible = false;
            cof.getControlByName(xapFormControl1, "drugsUse", "dt_fail").Visible = false;
            cof.adjustHeight(this.xapFormControl1, "drugsUse", adjustHeightIds, -58);
            //首日最大执行次数
            int?freqct    = this.EmsHeadDO.Emsdrugs.Freqct;
            int numgreqct = 0;

            if (freqct != null)
            {
                numgreqct = (int)freqct;
            }
            XLabelBaseUserRender tmpUserRender = this.xapFormControl1.GetUserRender("drugsUse", "quan_firday_mp") as XLabelBaseUserRender;

            XNumbericUpDown numRender = tmpUserRender.UserRender as XNumbericUpDown;

            numRender.MaxValue = (double)numgreqct;
            numRender.MinValue = 0;


            XTabControl       tabControl = new XTabControl();
            List <ControlTab> tabs       = xapFormControl1.FormModel.Tabs;

            dic = tabs[0].Pages[0].DicUserRenders;

            gv             = xapFormControl1.GetGridView("drug");//药品属性表
            gv.MouseClick += new MouseEventHandler(gv_MouseClick);
            gv.ReadOnly    = true;
            UserRender btnDel = this.xapFormControl1.GetUserRender("drugsUse", "del");//删除按钮

            btnDel.MouseClick += new MouseEventHandler(btnDel_MouseClick);

            UserRender btnAdd = this.xapFormControl1.GetUserRender("drugsUse", "btnAdd");//新增按钮

            btnAdd.MouseClick += new MouseEventHandler(btnAdd_MouseClick);
            //UserRender btnOK = xapFormControl1.GetUserRender("drugsUse", "btnSave");//保存
            //btnOK.MouseClick += new MouseEventHandler(btnOK_MouseClick);
            gv_change = xapFormControl1.GetGridView("change");//变动用药

            SetGridPolicy(true);
            gv.ReadOnly           = false;
            gv.DataTable.ReadOnly = false;
            //gv.DataTable.Columns["Name_srv"].ReadOnly = true;
            //gv.DataTable.Columns["Name_mm"].ReadOnly = true;
            gv.DataTable.Columns["Quan_cur"].ReadOnly       = true;
            gv.DataTable.Columns["Name_unit_sale"].ReadOnly = true;
            //长期医嘱使用天数为空
            if (cof.getControlByName(xapFormControl1, "drugsUse", "fg_long").ValueCode == "True" && this.EmsHeadDO.IsNEW)
            {
                this.EmsHeadDO.Emsdrugs.Use_days = null;
            }
            //cof.getControlByName(xapFormControl1,"drugsUse", "fg_long").Enabled = false;

            //----------药品说明----------------------
            XTabControl tabControl1 = tabs[0].tabContrl;
            XTabPage    xtab        = tabControl1.XTabPages[1];

            tabControl1.SelectedIndexChanged += new XTabControl.selectedIndexChanged(tabControl1_SelectedIndexChanged);
            xtab.Controls.Clear();
            xtab.Controls.Add(desView);

            cof.getControlByName(xapFormControl1, "drugsUse", "work_time").LostFocus += new EventHandler(Work_time_LostFocus);
            cof.getControlByName(xapFormControl1, "drugsUse", "dt_fail").LostFocus   += new EventHandler(Dt_fail_LostFocus);

            //失效日期控件
            UserRender usfail = xapFormControl1.GetUserRender("drugsUse", "dt_fail");

            dt_fail = usfail.Renders[0] as xap.cli.sdk.render.Items.XCalendarTimerComboBox;
        }
예제 #4
0
        void xapFormControl1_ModelFilled(object sender, EventArgs e)
        {
            //xapFormControl1.SetEditable(!IsReadOnly);
            xapFormControl1.SetTabPageEnabled("drugsUse", !IsReadOnly);
            //getControlByName("drugsUse", "work_time").Enabled = false;//首日执行时间
            //SetGridPolicy(!IsReadOnly);
            //group = this.xapFormControl1.GetUserRender("drugsUse", "group") as XGroupBox;
            EmsHeadDO.Emsdrugs.EmsOrDrug = cof.MmSortList(EmsHeadDO.Emsdrugs.EmsOrDrug);
            if (gv != null)
            {
                gv.DataTable.DataSource     = EmsHeadDO.Emsdrugs.EmsOrDrugList;
                EmsHeadDO.Emsdrugs.Id_dep   = EmsHeadDO.Emsdrugs.EmsOrDrugList.FirstOrDefault().Id_mp_dep;
                EmsHeadDO.Emsdrugs.Name_dep = EmsHeadDO.Emsdrugs.EmsOrDrugList.FirstOrDefault().Name_mp_dep;
            }
            GetMpTimes(EmsHeadDO.Emsdrugs.Id_freq);


            //	治疗用药、预防用药:只有抗生素类型的药品(BD_SRV_DRUG.fg_anti抗菌药物标志),才显示这两个控件。这两个选项框互斥。
            //if (cof.IsAntDrug(EmsHeadDO.Emsdrugs.Id_srv))
            //{
            //    getControlByName("drugsUse", "fg_treat").Visible = true;//治疗用药
            //    getControlByName("drugsUse", "fg_propc").Visible = true;//预防用药
            //    EmsHeadDO.Emsdrugs.Fg_treat = true;//默认治疗用药
            //}
            //else
            //{
            //    getControlByName("drugsUse", "fg_treat").Visible = false;//治疗用药
            //    getControlByName("drugsUse", "fg_propc").Visible = false;//预防用药

            //}
            //限制开始时间的时间范围,入院日期,最大提前日期
            UserRender us = xapFormControl1.GetUserRender("drugsUse", "dt_begin_ui");

            xap.cli.sdk.render.Items.XCalendarTimerComboBox dt_begin = us.Renders[0] as xap.cli.sdk.render.Items.XCalendarTimerComboBox;
            DateTime?dataA = new GetInHosTime().GetPatInHosTime(EmsHeadDO.PatInfo.Id_ent);

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

            //限制结束时间的时间范围,入院日期,最大提前日期
            UserRender usend = xapFormControl1.GetUserRender("drugsUse", "dt_end_ui");

            xap.cli.sdk.render.Items.XCalendarTimerComboBox dt_end = usend.Renders[0] as xap.cli.sdk.render.Items.XCalendarTimerComboBox;

            dt_end.MinDate = EmsHeadDO.Emsdrugs.Dt_begin_ui;
            //dt_end.MaxDate = cof.GetServerDataTime().AddDays(OrdParam.GetOrdParam.orBeforStartDays);

            //备用药结束时间
            //UserRender usfail = xapFormControl1.GetUserRender("drugsUse", "dt_fail");
            //xap.cli.sdk.render.Items.XCalendarTimerComboBox dt_fail = usfail.Renders[0] as xap.cli.sdk.render.Items.XCalendarTimerComboBox;

            UserRender name_route = xapFormControl1.GetUserRender("drugsUse", "name_route");

            name_route.Focus();

            //dt_fail.MinDate = EmsHeadDO.Emsdrugs.Dt_begin_ui;
            //dt_fail.MaxDate = cof.GetServerDataTime().AddHours(this.Context.GetOrgParam<int>(ICiOrdNSysParamConst.SYS_PARAM_TemporaryPrnOrValidTime));
            mapUnit = new Dictionary <string, string>();
            //记录单位名称
            mapUnit.Add(EmsHeadDO.Emsdrugs.EmsOrDrugList[0].Id_srv, EmsHeadDO.Emsdrugs.EmsOrDrugList[0].Name_unit_sale);
            EmsHeadDO.Emsdrugs.EmsOrDrugList[0].Name_unit_sale = "";
            //--------变动用药-------------
            //drugChange = this.xapFormControl1.GetUserRender("drugsUse", "fg_dose_anoma") as XLabelBaseUserRender;
            //gv_change.Visible = drugChange.Checked;
            //gv_change.Parent.Parent.Parent.Visible = drugChange.Checked;
            drugChange.ValueTextChanged += new EventHandler(drugChange_ValueChanged);

            if (!drugChange.Checked)
            {
                if (isMove)
                {
                    //cof.adjustHeight(this.xapFormControl1, "drugsUse", this.adjustHeightIds, -110);
                    isMove = false;
                }
                else
                {
                }
                //group.Location = new Point(group.Location.X, group.Location.Y - 108);
            }


            GetMpTimes(EmsHeadDO.Emsdrugs.Id_freq);
            initPoint = getControlByName("drugsUse", "fg_dose_anoma").Location;
        }
예제 #5
0
        void xapFormControl1_ModelFilled(object sender, EventArgs e)
        {
            //xapFormControl1.SetEditable(!IsReadOnly);
            // xapFormControl1.SetTabPageEnabled("drugsUse", !IsReadOnly);
            cof.getControlByName(xapFormControl1, "drugsUse", "work_time").Enabled = false;//首日执行时间
            //SetGridPolicy(!IsReadOnly);
            group = this.xapFormControl1.GetUserRender("drugsUse", "group") as XGroupBox;
            this.EmsHeadDO.Emsdrugs.EmsOrDrug = cof.MmSortList(this.EmsHeadDO.Emsdrugs.EmsOrDrug);
            if (gv != null)
            {
                gv.DataTable.DataSource = this.EmsHeadDO.Emsdrugs.EmsOrDrugList;
            }
            mapUnit = new Dictionary <string, string>();
            //记录单位名称
            mapUnit.Add(this.EmsHeadDO.Emsdrugs.EmsOrDrugList[0].Id_srv, this.EmsHeadDO.Emsdrugs.EmsOrDrugList[0].Name_unit_sale);
            if (this.EmsHeadDO.IsNEW)
            {
                GetMpTimes(this.EmsHeadDO.Emsdrugs.Id_freq);
                //设置执行次数的最大值和最小值
                cof.setFreqctMaxMin(this.EmsHeadDO, xapFormControl1);
                this.EmsHeadDO.Emsdrugs.EmsOrDrugList[0].Name_unit_sale = "";
            }
            else
            {
                string exctime = cof.GetWorkTime(this.EmsHeadDO.Emsdrugs.Id_freq);

                if (exctime != null && exctime != "")
                {
                    exctimes = exctime.Split(';');
                    Array.Sort(exctimes);
                    Array.Reverse(exctimes);
                }
                cof.setMpWorkTimesOnEdit(this.EmsHeadDO, exctimes);
                XLabelBaseUserRender tmpUserRender = this.xapFormControl1.GetUserRender("drugsUse", "quan_firday_mp") as XLabelBaseUserRender;
                XNumbericUpDown      numRender     = tmpUserRender.UserRender as XNumbericUpDown;
                numRender.MaxValue = (double)this.EmsHeadDO.Emsdrugs.Quan_firday_mp;
                numRender.MinValue = 0;
            }

            //	治疗用药、预防用药:只有抗生素类型的药品(BD_SRV_DRUG.fg_anti抗菌药物标志),才显示这两个控件。这两个选项框互斥。
            if (cof.IsAntDrug(this.EmsHeadDO.Emsdrugs.Id_srv))
            {
                cof.getControlByName(xapFormControl1, "drugsUse", "fg_treat").Visible = true; //治疗用药
                cof.getControlByName(xapFormControl1, "drugsUse", "fg_propc").Visible = true; //预防用药
                this.EmsHeadDO.Emsdrugs.Fg_treat = true;                                      //默认治疗用药
            }
            else
            {
                cof.getControlByName(xapFormControl1, "drugsUse", "fg_treat").Visible = false; //治疗用药
                cof.getControlByName(xapFormControl1, "drugsUse", "fg_propc").Visible = false; //预防用药
            }
            //限制开始时间的时间范围,入院日期,最大提前日期
            UserRender us = xapFormControl1.GetUserRender("drugsUse", "dt_begin_ui");

            xap.cli.sdk.render.Items.XCalendarTimerComboBox dt_begin = us.Renders[0] as xap.cli.sdk.render.Items.XCalendarTimerComboBox;
            DateTime?dataA = new GetInHosTime().GetPatInHosTime(this.EmsHeadDO.PatInfo.Id_ent);

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

            //限制结束时间的时间范围,入院日期,最大提前日期
            UserRender usend = xapFormControl1.GetUserRender("drugsUse", "dt_end_ui");

            xap.cli.sdk.render.Items.XCalendarTimerComboBox dt_end = usend.Renders[0] as xap.cli.sdk.render.Items.XCalendarTimerComboBox;

            UserRender name_route = xapFormControl1.GetUserRender("drugsUse", "name_route");

            name_route.Focus();

            dt_end.MinDate = this.EmsHeadDO.Emsdrugs.Dt_begin_ui;
            //dt_end.MaxDate = cof.GetServerDataTime().AddDays(OrdParam.GetOrdParam.orBeforStartDays);

            //备用药失效时间

            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.GetServerDataTime().AddHours(OrdParam.GetOrdParam.backOrActiveTime);

            cof.setDrugConStateAfterFilled(this.EmsHeadDO.Emsdrugs.Id_freq, this.adjustHeightIds, this.xapFormControl1);
            cof.setGridColumnEdit(gv, this.EmsHeadDO);
        }