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 String getMedicalsharingData(Ent4BannerDTO ent4Banner, BaseContext context, out string errMessage, string str) { ClincHistoryTradeInfo historyInfo = null; EachCommDTO eachCommDTO = new EachCommDTO(); eachCommDTO.Code_hp = ent4Banner.No_hp; eachCommDTO.Id_grp = context.Group.Id_grp; eachCommDTO.Id_org = context.Org.Id_org; eachCommDTO.Id_pat = ent4Banner.Id_pat; historyInfo = MedicalSharingCache.getMedicalData(ent4Banner.No_hp); if (historyInfo != null && historyInfo.SysInfo != null && historyInfo.SysInfo.ServerDateTime != null) { DateTime systemDateTime = LogicEx.GetInstance().GetSystemDateTime(); DateTime serverDateTime2 = (DateTime)historyInfo.SysInfo.ServerDateTime; System.TimeSpan timespan = systemDateTime.Subtract(serverDateTime2); if (timespan != null && timespan.TotalMinutes > 10) { historyInfo = service.GetClincHistoryInfo(eachCommDTO, out errMessage, str); //historyInfo = service.GetClincHistoryInfoByTest(); } } else { //historyInfo = service.GetClincHistoryInfoByTest(); // historyInfo = service.GetClincHistoryInfo(icno, out errMessage, str); historyInfo = service.GetClincHistoryInfo(eachCommDTO, out errMessage, str); } // ClincHistoryTradeInfo historyInfo = service.GetClincHistoryInfo(icno, out errMessage, str); // ClincHistoryTradeInfo historyInfo = service.GetClincHistoryInfoByTest();//测试数据 errMessage = ""; MedicalSharingCache.setMedicalSharingData(ent4Banner.No_hp, historyInfo, errMessage); return(""); }
public bool OrdValivate(EmsUIDTO headDo, CiorderBaseControl ci) { LogicEx logicEx = LogicEx.GetInstance(); List <string> errList = new List <string>(); if (headDo.Emsapobs.EmsOrObsList == null || headDo.Emsapobs.EmsOrObsList.Count == 0) { errList.Add("请选择检查项目"); } if (headDo.Emsapobs.EmsOrObsList.Count > 0) { bool isTrue = false; foreach (EmsObsLap obs in headDo.Emsapobs.EmsOrObsList) { if (obs.Name_srv == null || obs.Name_srv == "") { isTrue = true; } } if (isTrue) { errList.Add("检查项目不能空"); } } //if (headDo.Emsapobs.Dt_plan < logicEx.GetServerDataTime()) // errList.Add("检查时间不能小于当前时间!"); if (errList.Count > 0) { ci.OrdErrorList.AddRange(errList); return(false); } return(true); }
public void GetOrConfirmList(OrConfirm orfirm) { OrderList.Clear(); OrConfirm[] orfirms = qryservice.getCiOrdConfirmedQry(orfirm); if (orfirms == null || orfirms.Count() == 0) { return; } var notshowList = new List <OrConfirm>(); nowtime = LogicEx.GetInstance().GetSystemDateTime(); foreach (OrConfirm confirm in orfirms) { if (SetSorNameValue(confirm)) { notshowList.Add(confirm); } } IOrderedEnumerable <OrConfirm> gg = orfirms.OrderBy(item => item.Name_su_or); IOrderedEnumerable <OrConfirm> ff = gg.OrderBy(item => item.Name_bed); OrderList = ff.ToArray(); foreach (OrConfirm confirm in notshowList) { OrderList.Remove(confirm); } }
public bool OrdValivate(EmsUIDTO headDo, CiorderBaseControl ci) { List <string> errList = new List <string>(); if (headDo.Emsdrugs.Use_days == null) { errList.Add("【" + headDo.Emsdrugs.Name_srv + "】使用天数不能为空, 请检查!"); } else if (headDo.Emsdrugs.Use_days == 0) { errList.Add("【" + headDo.Emsdrugs.Name_srv + "】使用天数不能为 0天,请检查!"); } if (headDo.Emsdrugs.EmsOrDrugList[0].Quan_cur == null || headDo.Emsdrugs.EmsOrDrugList[0].Quan_cur == 0) { errList.Add("【" + headDo.Emsdrugs.Name_srv + "】总量不能为空!请检查!"); } #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); }
public override CiOrderDO Save2Order() { ciOrder = base.Save2Order(); if (this.ciEmsDTO.Id_or == null) { MedSrvDO medSrcDO = LogicEx.GetInstance().getApBuSrv(); if (medSrcDO != null) { CiorderAggDO ciagg = orService.findById(ciOrder.Id_or); OrdApBtDO[] btdos = btService.find("id_or='" + ciOrder.Id_or + "'", null, FBoolean.False); OrdApBtDO btdo = btdos[0]; uiEmsDTO.CiordubDTO = new CiordubDTO(); uiEmsDTO.CiordubDTO.Id_or_rel = ciOrder.Id_or; uiEmsDTO.CiordubDTO.Applyform = btdo.No_applyform; uiEmsDTO.CiordubDTO.Orsrvname = ciagg.getOrdSrvDO()[0].Name; uiEmsDTO.CiordubDTO.Id_srv = ciOrder.Id_srv; uiEmsDTO.CiordubDTO.Quan_medu = ciagg.getOrdSrvDO()[0].Quan_medu; uiEmsDTO.CiordubDTO.Id_unit = ciagg.getOrdSrvDO()[0].Id_medu; uiEmsDTO.CiordubDTO.Dt_bt_pl = Convert.ToDateTime(btdo.Dt_bt_pl); uiEmsDTO.CiordubDTO.Num_margin_bu = btdo.Num_margin_bu; uiEmsDTO.CiordubDTO.Id_emp_sign = ciOrder.Id_emp_sign; uiEmsDTO.CiordubDTO.Name_emp_sign = ciOrder.Emp_sign_name; uiEmsDTO.CiordubDTO.Id_route = medSrcDO.Id_route; uiEmsDTO.CiordubDTO.Name_route = medSrcDO.Route_name; uiEmsDTO.CiordubDTO.Quan_medu_ub = uiEmsDTO.CiordubDTO.Quan_medu; uiEmsDTO.CiordubDTO.Name_unit = ciagg.getOrdSrvDO()[0].Medu_name; uiEmsDTO.CiordubDTO.Id_unit = uiEmsDTO.MedSrvDO.Id_unit_med; } } return(ciOrder); }
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))); }
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); }
/// <summary> /// 查询医保规则 /// </summary> /// <param name="id_srv"></param> /// <param name="id_mm"></param> /// <param name="patinfo"></param> /// <returns></returns> public BdHpIndicationDTO[] getBdHpIndicationDTO(string[] id_srvs, string[] id_mms, Ent4BannerDTO patinfo) { if (id_srvs == null || 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.getBdHpIndicationDTOs(id_srvs, id_mms, contextdto); if (bdhpindic != null) { BdHpIndicationDTO[] bdHpIndications = new BdHpIndicationDTO[bdhpindic.Length]; for (int i = 0; i < bdhpindic.Length; i++) { BdHpIndicationDTO bdHpIndication = new BdHpIndicationDTO(); LogicEx.GetInstance().CopyTo(bdhpindic[i], bdHpIndication); bdHpIndications[i] = bdHpIndication; } return(bdHpIndications); } else { return(null); } }
/// <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; }
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); }
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)); }
/// <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 = ""; } }
/////////添加检验、检查、诊疗多剂量多次执行,杨敬本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; } }
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); } }
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 + ""; }
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; } }
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); }
/// <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)); }
/// <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); } }
/// <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); }
public void Clear(Cididtozy zy) { LogicEx.GetInstance().Clear(zy); zy.Fg_majdi = false; zy.Fg_suspdi = false; }
public void Clear(Cidixy xy) { LogicEx.GetInstance().Clear(xy); xy.Fg_majdi = false; xy.Fg_suspdi = false; }
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); } } }
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); }
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); }
/// <summary> /// 获取内置算法工具对象 /// </summary> /// <returns></returns> public LogicEx GetLogicEx() { return(LogicEx.GetInstance()); }
/// <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); }
//签署 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); }