/// <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); }
/// <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); }