Ejemplo n.º 1
0
        /// <summary>
        /// 根据单据类型修改打印标识
        /// </summary>
        /// <param name="sdsheetpys"></param>
        public void UpdateFgprn(string[] sdsheettps)
        {
            FMap2 updatedataMap = new FMap2();

            foreach (string sd in sdsheettps)
            {
                EmsprntmplAggDO[] aggdo = emsprntmplAggDOs.Where(p => p.getParentDO().Sd_ciprintsheettp == sd).ToArray();
                foreach (EmsprntmplAggDO agg in aggdo)
                {
                    if (this.dicUrlIDs.ContainsKey(agg.getParentDO().Tmplurl))
                    {
                        string ids = "";
                        foreach (string id in this.dicUrlIDs[agg.getParentDO().Tmplurl])
                        {
                            ids += string.Format(",{0}", id);
                        }
                        updatedataMap.Add(sd, ids.Substring(1));
                    }
                }
            }

            service.UpdatePrintFgprn(updatedataMap);
        }
Ejemplo n.º 2
0
        public medSrvRadioViewModel(string code_entp, string fgUse, string strWhere)
        {
            this.service    = XapServiceMgr.find <IMedsrvMDOCrudService>();
            this.qryService = XapServiceMgr.find <ICiOrdQryService>();
            if (string.IsNullOrEmpty(strWhere))
            {
                return;
            }
            //medSrvDOList = qryService.getClassMedSrvDOS("  a0.fg_active='Y' and a0.fg_or ='Y' and  a0.Id_srvca = '" + strWhere + "' and "+ fgUse +"='Y'", "Id_srvca",false);

            medSrvDOMap = qryService.getClassMedSrvMap(code_entp, "  a0.fg_active='Y' and a0.fg_or ='Y' and  a0.Id_srvca = '" + strWhere + "' and " + fgUse + "='Y'", "Id_srvca");

            // medSrvDOList.AddRange( map["medSrvList"] as XapDataList<MedSrvDO>);
            SrvStatusMap = medSrvDOMap["srvStatusMap"] as FMap2;



            FArrayList2 objList = medSrvDOMap["medSrvList"] as FArrayList2;

            if (objList != null)
            {
                medSrvDOList = (XapDataList <MedSrvDO>)objList.Cast <MedSrvDO>().ToArray();
            }

            //medSrvDOList = service.find("  a0.fg_active='Y' and  a0.Id_srvca = '" + strWhere + "'", "Id_srvca", false);
            if (medSrvDOList != null && medSrvDOList.Count > 0)
            {
                medSrvDOListPyCode = new XapDataList <MedSrvDO>();
                foreach (MedSrvDO medSrv in medSrvDOList)
                {
                    if (medSrv.Id_srv == null)
                    {
                        medSrvDOListPyCode.Add(medSrv);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        //private void getEmrList()
        //{
        //    if (medicaRecordCard == null)
        //    {
        //        medicaRecordCard = new MedicalRecordCard();
        //        medicaRecordCard.Text = "首次病程";
        //        SecCols.AddRender(medicaRecordCard);
        //    }


        //   // medicaRecordCard.Location = new Point(570, 10);
        //    //大屏情况下列宽度的重置
        //    if (RelativeUIParam.ScreenSize == ScreenSize.Large)
        //    {
        //        medicaRecordCard.Size = new Size(medicaRecordCard.Size.Width, 488);
        //    }
        //    else {
        //        medicaRecordCard.Size = new Size(medicaRecordCard.Size.Width, 300);
        //    }

        //    // todo
        //    List<Object> listmr = new List<object>();
        //    listmr.Add("Mainsuit_name");
        //    listmr.Add("Newillnes_name");
        //    listmr.Add("Physical_name");
        //    listmr.Add("Commonly_name");
        //    if (ent4BannerDto != null)
        //     {
        //        medicaRecordCard.Data = this.model.getOrderPandectEmrDTO("10", ent4BannerDto.Id_ent);
        //     }
        //    //medicaRecordCard.DataSource = listmr;

        //    //   medicaRecordCard.MouseDoubleClick += new MouseEventHandler(ContentControl_MouseDoubleClick);
        //}
        /// <summary>
        /// 创建末次病程卡片
        /// </summary>
        private void getFirstEmrData()
        {
            if (firstProgressNoteCard == null)
            {
                firstProgressNoteCard      = new ProgressNoteCard();
                firstProgressNoteCard.Text = "首次病程";
                SecCols.AddRender(firstProgressNoteCard);
            }
            //大屏情况下列宽度的重置
            if (RelativeUIParam.ScreenSize == ScreenSize.Large)
            {
                firstProgressNoteCard.Size = new Size(firstProgressNoteCard.Size.Width, 488);
            }
            else
            {
                firstProgressNoteCard.Size = new Size(firstProgressNoteCard.Size.Width, 300);
            }
            if (ent4BannerDto != null)
            {
                FMap2  dataMap = this.model.getEndEmrData(ent4BannerDto.Id_ent, FBoolean.True);
                string dateStr = "", typeStr = "", endEmrDataStr = "";
                if (dataMap.Keys.Contains("dt_rd"))
                {
                    dateStr = (dataMap["dt_rd"] as FDateTime).ToString();
                }
                if (dataMap.Keys.Contains("mrtp_name"))
                {
                    typeStr = dataMap["mrtp_name"] as string;
                }
                if (dataMap.Keys.Contains("strArea"))
                {
                    endEmrDataStr = dataMap["strArea"] as string;
                }
                firstProgressNoteCard.SetData(dateStr, typeStr, endEmrDataStr);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取医保审核,临床路径审核数据
        /// </summary>
        /// <param name="id_ors"></param>
        /// <returns></returns>
        public Dictionary <int, object> getReportData(string[] id_ors)
        {
            Dictionary <int, object> dataDic = new Dictionary <int, object>();

            CiorderAggDO[] ciordAggDOs = ciorderService.findByBIds(id_ors, FBoolean.False);
            FMap2          map2        = icOrdQryService.getMMName(id_ors);
            //医保审核数据
            // 医嘱列表中的适应症提示按钮弹出信息
            //1、显示需要医生干预的适应症条目。
            //2、医生干预后的也需要显示。
            //3、显示内容为费用项目
            XapDataList <OrdSrvDO> hpData = new XapDataList <OrdSrvDO>();

            foreach (CiorderAggDO aggDO in ciordAggDOs)
            {
                CiOrderDO ciOrderDO = aggDO.getParentDO();
                // 如果医保校验结果为不需要判断,不在医保审核列表显示
                if (ciOrderDO.Eu_hpindicjudge == (int)HpIndicJudgeEnum.NONEEDJUDGE)
                {
                    continue;
                }

                OrdSrvDO[] ordSrvDOs = aggDO.getOrdSrvDO();
                // 遍历服务项目获取医生判断的费用项目
                foreach (OrdSrvDO ordSrvDO in ordSrvDOs)
                {
                    // 如果是药品 并且是待判断的,才显示,非药品的不显示
                    if (ciOrderDO.Sd_srvtp.StartsWith(BdSrvTpDictCodeConst.SD_SRVTP_DRUG))
                    {
                        if (ordSrvDO.Fg_hpindicjudged != (int)HpIndicJudgeEnum.NONEEDJUDGE)
                        {
                            if (map2 != null)
                            {
                                if (map2[ordSrvDO.Id_orsrv] != null)
                                {
                                    string name     = (string)map2[ordSrvDO.Id_orsrv];
                                    string name_srv = ordSrvDO.Name;
                                    ordSrvDO.Name = name_srv + "(" + name + ")";
                                    hpData.Add(ordSrvDO);
                                }
                                else
                                {
                                    hpData.Add(ordSrvDO);
                                }
                            }
                            else
                            {
                                hpData.Add(ordSrvDO);
                            }
                        }
                    }
                    else if (ordSrvDO.Fg_bl == FBoolean.True)
                    {
                        hpData.Add(ordSrvDO);
                    }

                    // if (ordSrvDO.Fg_hpindicjudged == (int)HpIndicJudgeEnum.NONEEDJUDGE || ordSrvDO.Fg_bl == FBoolean.False) continue;
                    //if (ordSrvDO.Fg_bl != FBoolean.True) continue;
                    //hpData.Add(ordSrvDO);
                }
            }
            if (hpData.Count > 0)
            {
                dataDic.Add(ReportCodeDict.HP_REPORT_CODE, hpData);
            }
            //临床路径审核数据
            XapDataList <CiOrderDO> uncporData = new XapDataList <CiOrderDO>();

            foreach (CiorderAggDO aggDO in ciordAggDOs)
            {
                CiOrderDO ciOrderDO = aggDO.getParentDO();
                //门诊不含有临床路径
                if (BdFcDictCodeConst.SD_CODE_ENTP_OP.Equals(ciOrderDO.Code_entp))
                {
                    continue;
                }
                //临床路径的:0不判断,1待判断,2已判断
                if (ciOrderDO.Eu_uncporjudge == (int)HpIndicJudgeEnum.NONEEDJUDGE)
                {
                    continue;
                }
                uncporData.Add(ciOrderDO);
            }
            if (uncporData.Count > 0)
            {
                dataDic.Add(ReportCodeDict.UNCPOR_REPORT_CODE, uncporData);
            }
            return(dataDic);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 检查医疗单的映射
        /// </summary>
        /// <param name="emsDO"></param>
        /// <param name="ciEmsDto"></param>
        public void ObsViewFieldMapping(EmsUIDTO emsDO, CiEmsDTO ciEmsDto, MedSrvDO medSrvs)
        {
            FMap2       map       = (FMap2)ciEmsDto.Mapinfo;
            MedsrvAggDO medSrvAgg = null;

            if (map != null)
            {
                medSrvAgg = map["MedsrvAggDO"] as MedsrvAggDO;
            }
            emsDO.Emsapobs.Id_emsobs   = "";                                        //检查申请单主键
            emsDO.Emsapobs.Id_orsrv    = "";                                        //医嘱服务id
            emsDO.Emsapobs.Id_or       = "";                                        //	医嘱医疗单
            emsDO.Emsapobs.Id_srv      = ciEmsDto.Id_srv;                           //	服务id
            emsDO.Emsapobs.Name_srv    = ciEmsDto.Name;                             //	服务名称
            emsDO.Emsapobs.Id_srvtp    = ciEmsDto.Id_srvtp;                         //	服务类型
            emsDO.Emsapobs.Name_srvtp  = medSrvs.Srvtp_name;                        //_	服务类型名称 50
            emsDO.Emsapobs.Id_obstp    = "";                                        //	检查类型id	REF	检查类型_自定义档案
            emsDO.Emsapobs.Name_obstp  = "";                                        //	检查类型名称
            emsDO.Emsapobs.No_applyobs = ciEmsDto.Applyno;                          //	检查申请单号 20
            emsDO.Emsapobs.Fg_urgent   = false;                                     //	加急标识 1
            emsDO.Emsapobs.Fg_mp_bed   = false;                                     //	床旁执行标志 1
            emsDO.Emsapobs.Dt_plan     = ciEmsDto.Dt_begin;                         //	计划检查时间
            emsDO.Emsapobs.Id_di       = "";                                        //	诊断id	REF 疾病诊断
            emsDO.Emsapobs.Name_diag   = "";                                        //	诊断
            //emsDO.Emsapobs.Str_id_di = "";//	诊断编码拼接
            emsDO.Emsapobs.Str_name_di   = "";                                      //	诊断名称拼接 50
            emsDO.Emsapobs.Sd_pps        = "";                                      //	检查目的编码
            emsDO.Emsapobs.Id_pps        = "";                                      //	检查目的
            emsDO.Emsapobs.Name_pps      = "";                                      //	检查目的名称
            emsDO.Emsapobs.Des_pps       = "";                                      //	检查目的描述
            emsDO.Emsapobs.Des_sympsign  = "";                                      //	症状体征描述
            emsDO.Emsapobs.Id_body       = medSrvAgg.getMedSrvRisDO()[0].Id_body;   //  身体部位id	REF	部位编码_自定义档案
            emsDO.Emsapobs.Sd_body       = medSrvAgg.getMedSrvRisDO()[0].Sd_body;   //身体部位编码
            emsDO.Emsapobs.Name_body     = medSrvAgg.getMedSrvRisDO()[0].Name_body; //	身体部位名称
            emsDO.Emsapobs.Id_su_obs     = "";                                      //	检查申请单状态
            emsDO.Emsapobs.Sd_su_obs     = "";                                      //	检查申请单编码
            emsDO.Emsapobs.Id_pos        = medSrvAgg.getMedSrvRisDO()[0].Id_pos;    //;	身体体位id	REF	体位编码_自定义档案
            emsDO.Emsapobs.Sd_pos        = medSrvAgg.getMedSrvRisDO()[0].Sd_pos;    //身体体位编码
            emsDO.Emsapobs.Name_pos      = medSrvAgg.getMedSrvRisDO()[0].Name_pos;  //身体体位名称 50
            emsDO.Emsapobs.Id_samptp     = "";                                      //	标本类型id	REF	标本类型_自定义档案
            emsDO.Emsapobs.Name_samptp   = "";                                      //	标本类型名称
            emsDO.Emsapobs.Sd_samptp     = "";                                      //	标本类型编码
            emsDO.Emsapobs.Sortno        = 1;                                       //	序号
            emsDO.Emsapobs.Fg_chk        = false;                                   //	选择
            emsDO.Emsapobs.Announcements = medSrvAgg.getMedSrvRisDO()[0].Note;      //	注意事项	    备注
            //emsDO.Emsapobs.sv	版本号	S
            emsDO.Emsapobs.Id_srvca = medSrvs.Id_srvca;                             //	检验分类
            // emsDO.Emsapobs.sd_colltp	采集方法编码
            // emsDO.Emsapobs.id_colltp	采集方法id
            // emsDO.Emsapobs.des_labsamp	标本说明
            //emsDO.Emsapobs.Use_days	使用天数
            emsDO.Emsapobs.Id_mp_dep   = ciEmsDto.Id_dep_mp; //	执行科室ID
            emsDO.Emsapobs.Name_mp_dep = "";                 //     执行科室名称 50
            emsDO.Emsapobs.Price       = medSrvs.Pri;        //	价格
            //emsDO.Emsapobs.quan_cur	总量
            //emsDO.Emsapobs.id_unit_sale	总量单位 50
            //emsDO.Emsapobs.name_unit_sale	总量单位名称 50
            //emsDO.Emsapobs.fg_indic	适应症
            //emsDO.Emsapobs.id_unit_base	计数单位ID
            //emsDO.Emsapobs.name_unit_base	计数单位名称
            //emsDO.Emsapobs.quan_base	计数单位
            emsDO.Emsapobs.Innercode_srvca = medSrvs.Srvca_innercode; //	服务分类内部编码
            emsDO.Emsapobs.Fg_syncfee      = false;                   //	费用同步标识
            //套内项目
            setObsItem(emsDO, ciEmsDto, medSrvs);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 检验的项目映射字段
        /// </summary>
        private void setObsItem(EmsUIDTO emsDO, CiEmsDTO ciEmsDto, MedSrvDO medSrvs)
        {
            FMap2       map       = (FMap2)ciEmsDto.Mapinfo;
            MedsrvAggDO medSrvAgg = null;
            FArrayList  aggList   = null;

            if (map != null)
            {
                medSrvAgg = map["MedsrvAggDO"] as MedsrvAggDO;
                aggList   = map["SetItemMedsrvDO"] as FArrayList;
            }
            //套内项目
            XapDataList <EmsObsLap> obsList = new XapDataList <EmsObsLap>();

            if (medSrvs.Fg_set.Value && aggList != null)
            {
                foreach (MedsrvAggDO aggDO in aggList)
                {
                    int i = 0;
                    foreach (MedSrvRisDO itemRisDO in aggDO.getMedSrvRisDO())
                    {
                        EmsObsLap obs = new EmsObsLap();
                        obs.Id        = "";                        //	id	SINGLE	String	50
                        obs.Sd_body   = itemRisDO.Sd_body;         //	部位编码
                        obs.Name_body = itemRisDO.Name_body;       //	部位名称
                        obs.Sd_pos    = itemRisDO.Sd_pos;          //	体位编码
                        obs.Name_pos  = itemRisDO.Name_pos;        //	体位名称
                        //obs.If_mp_bed = itemRisDO.If_mp_bed;//	是否可床边执行
                        obs.Id_srv   = aggDO.getParentDO().Id_srv; //	检验编码
                        obs.Name_srv = aggDO.getParentDO().Name;   //	检验名称
                        //sortno	序号
                        obs.Id_pos  = itemRisDO.Id_pos;            //	体位id
                        obs.Id_body = itemRisDO.Id_body;           //	部位id
                        //id_orsrv	医嘱服务id
                        //id_or	医嘱医疗单
                        obs.Id_srvtp     = aggDO.getParentDO().Id_srvtp;   //	服务类型
                        obs.Name_srvtp   = aggDO.getParentDO().Srvtp_name; //	服务类型名称
                        obs.Id_obstp     = itemRisDO.Id_obstp;             //检查类型id
                        obs.Name_obstp   = itemRisDO.Obstp_name;           //	检查类型名称
                        obs.No_applyobs  = ciEmsDto.Applyno;               //	检查申请单号
                        obs.Fg_urgent    = ciEmsDto.Fg_urgent;             //	加急标识
                        obs.Fg_mp_bed    = ciEmsDto.Fg_mp_bed;             //	床旁执行标志
                        obs.Dt_plan      = ciEmsDto.Dt_begin;              //	计划检查时间
                        obs.Id_di        = "";                             //	诊断id
                        obs.Name_di      = "";                             //	诊断
                        obs.Str_id_di    = "";                             //	诊断编码拼接
                        obs.Str_name_di  = "";                             //	诊断名称拼接
                        obs.Sd_pps       = "";                             //	检查目的编码
                        obs.Id_pps       = "";                             //	检查目的
                        obs.Des_pps      = "";                             //	检查目的描述
                        obs.Des_sympsign = "";                             //	症状体征描述
                        obs.Id_su_obs    = CiDictCodeConst.ID_CI_OBS_SQ;   //检查申请单状态
                        obs.Sd_su_obs    = CiDictCodeConst.SD_CI_OBS_SQ;   //检查申请单编码
                        //obs.Id_samptp = itemRisDO.id	标本类型id
                        //name_samptp	标本类型名称
                        //sd_samptp	标本类型编码
                        obs.Fg_chk        = true;           //	选择
                        obs.Announcements = itemRisDO.Note; //	注意事项
                        //sv	版本号
                        //id_srvca	检验分类
                        //sd_colltp	采集方法编码
                        //id_colltp	采集方法id
                        //des_labsamp	标本说明
                        //id_contp	容器编码
                        //sd_contp	容器id
                        obs.Quan         = aggDO.getParentDO().Quan_med; //	标本需求量
                        obs.No_applyform = ciEmsDto.Applyno;             //申请单号
                        //biopsy	检查组织描述
                        obs.Fg_or     = aggDO.getParentDO().Fg_or;       //	医嘱标志
                        obs.Sd_srvtp  = aggDO.getParentDO().Sd_srvtp;    //	医嘱类型
                        obs.Id_freq   = aggDO.getParentDO().Id_freq;     //	医嘱频次
                        obs.Quan_medu = aggDO.getParentDO().Quan_med;    //	数值_医疗单位
                        obs.Id_medu   = aggDO.getParentDO().Id_unit_med; //	医疗单位
                        obs.Fg_bl     = aggDO.getParentDO().Fg_bl;       //	计费标志
                        obs.Code_srv  = aggDO.getParentDO().Code;        //	服务编码
                        //obs.Fg_edit = aggDO.getMedSrvSetItemDO()[i].Fg_edit; //	可选标识
                        //obs.Fg_body_update = aggDO.getMedSrvSetItemDO()[i].	部位可修改标示
                        //56		id_quan	标本需求量单位
                        //obs.id_hp = emsDO.PatInfo.Id_hp;//	医保
                        //name_hp	医保名称
                        //id_hpsrvtp	医保类型
                        //sd_hpsrvtp	医保类型编码
                        //eu_sourcemd	数据来源
                        i++;
                        obsList.Add(obs);
                    }
                }
            }
            else
            {
                EmsObsLap obs = new EmsObsLap();
                obs.Id        = "";                                      //	id	SINGLE	String	50
                obs.Sd_body   = medSrvAgg.getMedSrvRisDO()[0].Sd_body;   //	部位编码
                obs.Name_body = medSrvAgg.getMedSrvRisDO()[0].Name_body; //	部位名称
                obs.Sd_pos    = medSrvAgg.getMedSrvRisDO()[0].Sd_pos;    //	体位编码
                obs.Name_pos  = medSrvAgg.getMedSrvRisDO()[0].Name_pos;  //	体位名称
                //obs.If_mp_bed = itemRisDO.If_mp_bed;//	是否可床边执行
                obs.Id_srv   = medSrvAgg.getParentDO().Id_srv;           //	检验编码
                obs.Name_srv = medSrvAgg.getParentDO().Name;             //	检验名称
                //sortno	序号
                obs.Id_pos  = medSrvAgg.getMedSrvRisDO()[0].Id_pos;      //	体位id
                obs.Id_body = medSrvAgg.getMedSrvRisDO()[0].Id_body;     //	部位id
                //id_orsrv	医嘱服务id
                //id_or	医嘱医疗单
                obs.Id_srvtp     = medSrvAgg.getParentDO().Id_srvtp;         //	服务类型
                obs.Name_srvtp   = medSrvAgg.getParentDO().Srvtp_name;       //	服务类型名称
                obs.Id_obstp     = medSrvAgg.getMedSrvRisDO()[0].Id_obstp;   //检查类型id
                obs.Name_obstp   = medSrvAgg.getMedSrvRisDO()[0].Obstp_name; //	检查类型名称
                obs.No_applyobs  = ciEmsDto.Applyno;                         //	检查申请单号
                obs.Fg_urgent    = ciEmsDto.Fg_urgent;                       //	加急标识
                obs.Fg_mp_bed    = ciEmsDto.Fg_mp_bed;                       //	床旁执行标志
                obs.Dt_plan      = ciEmsDto.Dt_begin;                        //	计划检查时间
                obs.Id_di        = "";                                       //	诊断id
                obs.Name_di      = "";                                       //	诊断
                obs.Str_id_di    = "";                                       //	诊断编码拼接
                obs.Str_name_di  = "";                                       //	诊断名称拼接
                obs.Sd_pps       = "";                                       //	检查目的编码
                obs.Id_pps       = "";                                       //	检查目的
                obs.Des_pps      = "";                                       //	检查目的描述
                obs.Des_sympsign = "";                                       //	症状体征描述
                obs.Id_su_obs    = CiDictCodeConst.ID_CI_OBS_SQ;             //检查申请单状态
                obs.Sd_su_obs    = CiDictCodeConst.SD_CI_OBS_SQ;             //检查申请单编码
                //obs.Id_samptp = itemRisDO.id	标本类型id
                //name_samptp	标本类型名称
                //sd_samptp	标本类型编码
                obs.Fg_chk        = true;                               //	选择
                obs.Announcements = medSrvAgg.getMedSrvRisDO()[0].Note; //	注意事项
                //sv	版本号
                //id_srvca	检验分类
                //sd_colltp	采集方法编码
                //id_colltp	采集方法id
                //des_labsamp	标本说明
                //id_contp	容器编码
                //sd_contp	容器id
                obs.Quan         = medSrvAgg.getParentDO().Quan_med; //	标本需求量
                obs.No_applyform = ciEmsDto.Applyno;                 //申请单号
                //biopsy	检查组织描述
                obs.Fg_or     = medSrvAgg.getParentDO().Fg_or;       //	医嘱标志
                obs.Sd_srvtp  = medSrvAgg.getParentDO().Sd_srvtp;    //	医嘱类型
                obs.Id_freq   = medSrvAgg.getParentDO().Id_freq;     //	医嘱频次
                obs.Quan_medu = medSrvAgg.getParentDO().Quan_med;    //	数值_医疗单位
                obs.Id_medu   = medSrvAgg.getParentDO().Id_unit_med; //	医疗单位
                obs.Fg_bl     = medSrvAgg.getParentDO().Fg_bl;       //	计费标志
                obs.Code_srv  = medSrvAgg.getParentDO().Code;        //	服务编码
                obs.Fg_edit   = true;                                //	可选标识
                //obs.Fg_body_update = aggDO.getMedSrvSetItemDO()[i].	部位可修改标示
                //56		id_quan	标本需求量单位
                //obs.id_hp = emsDO.PatInfo.Id_hp;//	医保
                //name_hp	医保名称
                //id_hpsrvtp	医保类型
                //sd_hpsrvtp	医保类型编码
                //eu_sourcemd	数据来源
                obsList.Add(obs);
            }

            emsDO.Emsapobs.EmsOrObsList = obsList;
        }
Ejemplo n.º 7
0
        public override bool LoadMedSrv(EmsCreatedParameter emsCreatedParameter, int pos) //EmsCreateParameter
        {
            MedSrvDO med   = emsCreatedParameter.getMedSrvDO();
            String   id_mm = emsCreatedParameter.getMmID();

            if (String.IsNullOrEmpty(id_mm))
            {
                this.errorMsgString = "没有物品ID";
                return(false);
            }

            // 获取列表最后一个数据
            EmsOrDrug newDrug = null;

            AssCostTimeTool.Enabled = true;

            AssCostTimeTool t1 = new AssCostTimeTool("加载数据时候,LoadMedSrv2 解析 MedSrv 耗时:", false);

            EmsRstDTO[] rsts = CreateRemote(med.Id_srv, id_mm);
            EmsRstDTO   rst  = rsts[0];

            if (rst != null)
            {
                EmsDrugItemDO emsDrugItem = (rst.Document[0] as EmsDrugItemDO);
                //String utf8Str = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(rst.DocumentString));
                //EmsDrugItemDO emsDrugItem = new EmsDrugItemDO();
                //emsDrugItem.deSerializeJson(utf8Str);

                FMap2 emsExtMap = rst.Extension;

                MedSrvDO        medSrv = emsExtMap["MedSrvDO"] as MedSrvDO;
                OrWfDeptInfoDTO wf     = emsExtMap["OrWfDeptInfoDTO"] as OrWfDeptInfoDTO;

                emsDrugItem.EmsOrDrug = new XapDataList <EmsOrDrug>();

                // 列表中显示的物品
                XapDataList <EmsOrDrug> emsOrDrugList = new XapDataList <EmsOrDrug>();
                FArrayList drugList_ex = emsDrugItem.EmsOrDrugListEx;
                foreach (EmsOrDrug drug in drugList_ex)
                {
                    emsOrDrugList.Add(drug);
                    emsDrugItem.EmsOrDrug.Add(drug);
                }

                newDrug = this.GetSelectedObject() as EmsOrDrug;
                if (pos < 0)
                {
                    this.uiEmsDTO.MedSrvDO    = med;
                    emsDrugItem.EmsOrDrugList = emsOrDrugList;
                    this.uiEmsDTO.Emsdrugs    = emsDrugItem;
                    return(true);
                }

                //TODO: 可以放到查询药品前,重复就不用走后台了
                if (this.uiEmsDTO.Emsdrugs.EmsOrDrugList.Count(p => p.Name_srv == newDrug.Name_srv && !p.IsDELETED) > 1)
                {
                    this.errorMsgString = "已经存在服务【" + medSrv.Name + "】!";
                    this.uiEmsDTO.Emsdrugs.EmsOrDrugList.Remove(newDrug);
                    this.logicEx.Clear <EmsOrDrug>(newDrug);
                    newDrug.Status = DOStatus.NEW;
                    this.uiEmsDTO.Emsdrugs.EmsOrDrug.Clear();
                    this.uiEmsDTO.Emsdrugs.EmsOrDrug.Add(newDrug);
                    return(false);
                }

                // 获取从后台返回的用于医嘱列表显示的数据
                if (emsOrDrugList == null || string.IsNullOrEmpty(emsOrDrugList[0].Id_mm))
                {// TODO 什么情况没有数据
                    this.errorMsgString = "服务未绑定物品,请联系信息科!";
                    this.logicEx.Clear <EmsOrDrug>(newDrug);
                    return(false);
                }
                EmsOrDrug tempDrug = emsOrDrugList[0];

                if (!newDrug.IsUPDATED)
                {
                    tempDrug.Status = DOStatus.NEW;
                }
                else
                { // 增加该逻辑分支   针对 已保存的 医嘱项目 进行服务项目的修改 -- 2016-11-21 by wangqz
                    tempDrug.Status   = DOStatus.UPDATED;
                    tempDrug.Id_orsrv = newDrug.Id_orsrv;
                }


                // 新加的药品要与已有的保持同频次,同周期,同用法
                tempDrug.Id_route   = this.uiEmsDTO.Emsdrugs.Id_route;
                tempDrug.Name_route = this.uiEmsDTO.Emsdrugs.Name_route;

                // 草药外配标识在医疗单中,勾选外配,全为外配
                tempDrug.Fg_extdispense = this.uiEmsDTO.Emsdrugs.Fg_extdispense;

                // 同频次
                tempDrug.Id_freq       = this.uiEmsDTO.Emsdrugs.Id_freq;
                tempDrug.Name_freq     = this.uiEmsDTO.Emsdrugs.Name_freq;
                tempDrug.Sd_frequnitct = this.uiEmsDTO.Emsdrugs.Sd_frequnitct;
                tempDrug.Freqct        = this.uiEmsDTO.Emsdrugs.Freqct;

                // 如果只有一条记录,恢复到服务默认的频次,用法
                fillSameInfoWithMedSrvDO(tempDrug, medSrv);

                // 同周期
                tempDrug.Use_days = this.uiEmsDTO.Emsdrugs.Use_days;

                // 计算总次数 TODO 需要提供前台计算方法,数据都有了,不用走后台了
                int?times_cur = this.uiEmsDTO.Emsdrugs.Times_cur; // CalQuantumUtil.GetInstance().getTotalTimes(tempDrug.Id_freq, (int)this.uiEmsDTO.Emsdrugs.Use_days);


                int?orders = this.uiEmsDTO.Emsdrugs.Orders;
                // 计算总量
                tempDrug.Quan_cur = CalQuantumUtil.GetInstance().getMMQuantum(tempDrug.Sd_mupkgutp, tempDrug.Quan_med, tempDrug.Factor_mb, tempDrug.Factor_cb, orders);

                tempDrug.Totalprice = tempDrug.Price * tempDrug.Quan_cur; // 计算总价

                // 将返回数据加到表格数据源中
                newDrug.Replace(tempDrug);
            }

            return(true);
        }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
0
        private void sendCiOrdersToEmr(CiOrderDO[] ciOrderDOs, Boolean diag)
        {
            //lxy
            //OrderMrDto[] mrDtos = ciservice.GetOrderMrDtoFlushList(ent4BannerDTO.Id_ent, ent4BannerDTO.Code_entp, ciOrderDOs);
            //EmrEditorCiViewModel ciViewModel = new EmrEditorCiViewModel();
            //if (mrDtos == null)
            //    return;
            //string ciOrderXmlStr = ciViewModel.convertCZToXmlStr(mrDtos, CI_ORDER_XML_CFG_PATH);
            //Dictionary<string, object> cidiDic = new Dictionary<string, object>();
            //cidiDic.Add(CI_ORDER_ITEM, ciOrderXmlStr);

            if (ciOrderDOs == null)
            {
                return;
            }

            //判断手动/自动
            string idDep = this.Context.Dept.Id_dep;

            string idPsndoc    = this.Context.PsnInfo.Id_psndoc;
            string refreshMode = this.Context.GetParam <string>(idDep, ICiOrdNSysParamConst.SYS_PARAM_OpOrSysncro2MrHandleMode);
            Dictionary <string, object> cidiDic = new Dictionary <string, object>();
            List <String> lstIdors = new List <string>();

            ciOrderDOs.ToList <CiOrderDO>().ForEach(order => { lstIdors.Add(order.Id_or); });
            if (diag)
            {
                string cidiDOXmlStr = emrCiViewModel.convertZdToXmlStr(emrViewModel.GetDIDTO(ent4BannerDTO.Id_ent), CIDI_XML_CFG_PATH);

                cidiDic.Add(CIDI_ITEM, cidiDOXmlStr);
                if (refreshMode == "0")
                {
                    //new 2017-05-09  by yzh
                    FMap2 mrDtos = ciservice.GetOrderMrDtoFlushList2(ent4BannerDTO.Id_ent, ent4BannerDTO.Code_entp, lstIdors.ToArray(), idPsndoc, refreshMode);

                    if (mrDtos == null)
                    {
                        cidiDic.Add(CI_ORDER_ITEM, "");
                    }
                    else
                    {
                        Dictionary <string, object> cidiDicTemp = new Dictionary <string, object>();
                        foreach (string key in mrDtos.Keys)
                        {
                            string val = mrDtos[key] as string;
                            if (val == null)
                            {
                                cidiDicTemp.Add(key, "");
                            }
                            else
                            {
                                cidiDicTemp.Add(key, val);
                            }
                        }

                        cidiDic.Add(CI_ORDER_ITEM, cidiDicTemp);
                    }
                }
            }
            else
            {
                //new 2017-05-09  by yzh
                FMap2 mrDtos = ciservice.GetOrderMrDtoFlushList2(ent4BannerDTO.Id_ent, ent4BannerDTO.Code_entp, lstIdors.ToArray(), idPsndoc, refreshMode);

                if (mrDtos == null)
                {
                    cidiDic.Add(CI_ORDER_ITEM, "");
                }
                else
                {
                    Dictionary <string, object> cidiDicTemp = new Dictionary <string, object>();
                    foreach (string key in mrDtos.Keys)
                    {
                        string val = mrDtos[key] as string;
                        if (val == null)
                        {
                            cidiDicTemp.Add(key, "");
                        }
                        else
                        {
                            cidiDicTemp.Add(key, val);
                        }
                    }

                    cidiDic.Add(CI_ORDER_ITEM, cidiDicTemp);
                }
            }



            this.fireCiEmrSaveEvent(cidiDic);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 就诊历史中显示的医嘱列表
        /// </summary>
        /// <param name="id_en"></param>
        /// <param name="code_entp"></param>
        public void loadOderItems(string id_en, string code_entp)
        {
            if (string.IsNullOrEmpty(id_en) || string.IsNullOrEmpty(code_entp))
            {
                this.xapList.Clear();
                return;
            }

            CiOrderDO[] ciOrders = null;

            //if (code_entp.Equals(BdFcDictCodeConst.SD_CODE_ENTP_IP))// 住院
            //{
            //    string whereStr = string.Format("a0.id_en='{0}' and a0.code_entp='{1}' and a0.fg_pres_outp='N' ", id_en, code_entp);
            //    ciOrders = this.orderItemMService.find(whereStr, "a0.createdtime  " + orderStr, FBoolean.False);
            //}
            //else if(BdFcDictCodeConst.SD_CODE_ENTP_OP.Equals(code_entp) || BdFcDictCodeConst.SD_CODE_ENTP_ET.Equals(code_entp))
            //{
            //    // 医嘱map结构,包含两项,orderList 医嘱list集合,orderPriMap 医嘱id与价格的map集合
            //    FMap2 map = ciOrdQryService.getEnHistoryCiOrders(id_en, code_entp, orderStr);
            //    FArrayList2 orderList = map["orderList"] as FArrayList2;
            //    ciOrders = orderList.Cast<CiOrderDO>().ToArray<CiOrderDO>();

            //    // 医嘱对应的价格 map中key=id_or,vlaue = 价格
            //    PriMap = map["orderPriMap"] as FMap2;
            //    OrdStatusMap = map["orderStatusMap"] as FMap2;
            //}

            // 医嘱map结构,包含两项,orderList 医嘱list集合,orderPriMap 医嘱id与价格的map集合
            FMap2       map       = ciOrdQryService.getEnHistoryCiOrders(id_en, code_entp, orderStr);
            FArrayList2 orderList = map["orderList"] as FArrayList2;

            ciOrders = orderList.Cast <CiOrderDO>().ToArray <CiOrderDO>();

            // 医嘱对应的价格 map中key=id_or,vlaue = 价格
            PriMap       = map["orderPriMap"] as FMap2;
            OrdStatusMap = map["orderStatusMap"] as FMap2;

            foreach (CiOrderDO ciOrder in ciOrders)
            {
                ciOrder.Str_long = ciOrder.Fg_long.Value == true ? "长期" : "临时";
                if (ciOrder.Emp_stop_name == null || ciOrder.Emp_stop_name == "")
                {
                    //如果没有停止医生 则医嘱列表停止时间 不显示 王琪需求
                    ciOrder.Dt_end = null;
                }
                if (ciOrder.Fg_long != FBoolean.True)
                { // 临时医嘱没有停止人
                    ciOrder.Emp_stop_name = null;
                }
                if (!string.IsNullOrEmpty(ciOrder.Id_emp_sign) && !ciOrder.Id_emp_sign.Equals(ciOrder.Id_emp_or))
                {   // 签署人与开立人不是同一人是,显示为 签署人/开立人
                    ciOrder.Emp_sign_name = ciOrder.Emp_sign_name + "/" + ciOrder.Emp_phy_name;
                }
                else
                {
                    ciOrder.Emp_sign_name = ciOrder.Emp_phy_name;
                }
            }

            xapList = new XapDataList <CiOrderDO>(orderItemMService, ciOrders);

            //设定医嘱状态
            bool isOp = code_entp.Equals("00") ? true : false;

            logic.setOrderDisplayStatus(xapList, isOp);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 创建医疗单
        /// </summary>
        /// <param name="emsCreateParameter"></param>
        /// <param name="pos"></param>
        /// <returns></returns>
        //public override bool LoadMedSrv(EmsCreatedParameter emsCreateParameter, int pos)
        //{
        //    base.LoadMedSrv(emsCreateParameter, pos);
        //    MedSrvDO med = emsCreateParameter.getMedSrvDO();
        //    String id_mm = emsCreateParameter.getMmID();

        //    // 获取列表最后一个数据
        //    EmsOrDrug newDrug = null;

        //    EmsCrtDTO emsCrt = new EmsCrtDTO();
        //    emsCrt.Id_srv = med.Id_srv;
        //    emsCrt.Id_mm = id_mm;
        //    emsCrt.EmsMgrInfo = this.emsMgrDTO;
        //    emsCrt.EnContext = BaseEmsView.BaseEmsInfoContext["CiEnContextDTO"] as CiEnContextDTO;
        //    emsCrt.EmsDriver = ((int)this.uiEmsDTO.EmsType).ToString();

        //    // 临时用,验证结束需要调整到后台
        //    emsCrt.CustomInfo = emsCreateParameter.GetParameter() == null ? null : emsCreateParameter.GetParameter().ToString();
        //    EmsRstDTO rst = emsMainService.create(emsCrt);
        //    if (rst != null)
        //    {
        //        String utf8Str = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(rst.EmsDocument));
        //        EmsDrugItemDO emsDrugItem = new EmsDrugItemDO();
        //        emsDrugItem.deSerializeJson(utf8Str);

        //        FMap2 emsExtMap = rst.EmsExtension;

        //        this.id_dosages = emsExtMap["id_dosages"] as string;
        //        MedSrvDO medSrv = emsExtMap["MedSrvDO"] as MedSrvDO;
        //        OrWfDeptInfoDTO wf = emsExtMap["OrWfDeptInfoDTO"] as OrWfDeptInfoDTO;
        //        SkinTestRstDTO skinTestRst = emsExtMap["SkinTestRstDTO"] as SkinTestRstDTO;
        //        if (emsExtMap["isShowWarnInfo"] != null && (bool)emsExtMap["isShowWarnInfo"])
        //        {
        //            this.tipInfoMsgString = emsExtMap["specillDrugWarnInfo"] as string;
        //        }
        //        // 物品参照
        //        XapDataList<EmsOrDrug> emsOrDrugRef = new XapDataList<EmsOrDrug>();
        //        if (emsDrugItem.EmsOrDrugEx == null || emsDrugItem.EmsOrDrugEx.Count == 0) {
        //            this.errorMsgString = "服务"+emsDrugItem.Name_srv+"未绑定物品,请联系信息科!";
        //            return false;
        //        }
        //        foreach (EmsOrDrug drug in emsDrugItem.EmsOrDrugEx)
        //        {
        //            emsOrDrugRef.Add(drug);
        //        }
        //        emsDrugItem.EmsOrDrug = emsOrDrugRef;

        //        // 列表中显示的物品
        //        XapDataList<EmsOrDrug> emsOrDrugList = new XapDataList<EmsOrDrug>();
        //        FArrayList drugList_ex = emsDrugItem.EmsOrDrugListEx;
        //        foreach (EmsOrDrug drug in drugList_ex)
        //        {
        //            emsOrDrugList.Add(drug);
        //        }


        //        if (pos < 0)
        //        {
        //            this.uiEmsDTO.MedSrvDO = med;

        //            emsDrugItem.EmsOrDrugList = emsOrDrugList;
        //            // 当物品id查询不到对应物品时,不做赋值操作
        //            if (emsOrDrugList.Count > 0)
        //            {
        //                this.uiEmsDTO.Emsdrugs = emsDrugItem;
        //            }
        //            newDrug = this.uiEmsDTO.Emsdrugs.EmsOrDrugList.LastOrDefault();
        //        }
        //        else
        //        {
        //            newDrug = this.uiEmsDTO.Emsdrugs.EmsOrDrugList.ElementAt(pos);
        //        }

        //        // 设置当前选择项目
        //        SetSelectedObject(newDrug);

        //        if (emsOrDrugList.Count == 0)
        //        {
        //            this.errorMsgString = med.Name + "(" + id_mm + "), 没有关联物品或者物品数据错误!";
        //            this.logicEx.Clear<EmsOrDrug>(newDrug);
        //            return false;
        //        }

        //        // 获取从后台返回的用于医嘱列表显示的数据
        //        EmsOrDrug tempDrug = emsOrDrugList[0];

        //        //皮试判断逻辑
        //        string skinErrorInfo = AssToolEx.CheckSkinTestRst(tempDrug, skinTestRst, this.GetEnt4BannerDTO());
        //        if (!string.IsNullOrEmpty(skinErrorInfo))
        //        {
        //            this.errorMsgString = skinErrorInfo;
        //            this.logicEx.Clear<EmsOrDrug>(newDrug);
        //            return false;
        //        }

        //        // 加载第一条记录信息已经是全的了,不用执行后边的
        //        if (pos < 0)
        //        {
        //            return true;
        //        }

        //        if (!newDrug.IsUPDATED)
        //        {
        //            tempDrug.Status = DOStatus.NEW;
        //        }
        //        else
        //        { // 增加该逻辑分支   针对 已保存的 医嘱项目 进行服务项目的修改 -- 2016-11-21 by wangqz
        //            tempDrug.Status = DOStatus.UPDATED;
        //        }
        //        // 保留id_orsrv ,当对编辑项通过退格键删除后,在选择其他服务,Id_orsrv存在
        //        tempDrug.Id_orsrv = newDrug.Id_orsrv;

        //        // 新加的药品要与已有的保持同频次,同周期,同用法
        //        tempDrug.Id_route = this.uiEmsDTO.Emsdrugs.Id_route;
        //        tempDrug.Name_route = this.uiEmsDTO.Emsdrugs.Name_route;

        //        // 同频次
        //        tempDrug.Id_freq = this.uiEmsDTO.Emsdrugs.Id_freq;
        //        tempDrug.Name_freq = this.uiEmsDTO.Emsdrugs.Name_freq;
        //        tempDrug.Sd_frequnitct = this.uiEmsDTO.Emsdrugs.Sd_frequnitct;
        //        tempDrug.Freqct = this.uiEmsDTO.Emsdrugs.Freqct;

        //        // 如果只有一条记录,恢复到服务默认的频次,用法
        //        fillSameInfoWithMedSrvDO(tempDrug, medSrv);

        //        // 同周期
        //        tempDrug.Use_days = this.uiEmsDTO.Emsdrugs.Use_days;

        //        // 计算总次数
        //        int times_cur = CalQuantumUtil.GetInstance().getTotalTimes(tempDrug.Id_freq, (int)this.uiEmsDTO.Emsdrugs.Use_days);

        //        // 计算总量
        //        tempDrug.Quan_cur = CalQuantumUtil.GetInstance().getMMQuantum(tempDrug.Sd_opmutp, tempDrug.Quan_med, tempDrug.Factor_mb, tempDrug.Factor_cb, times_cur);

        //        // 计算总价
        //        tempDrug.Totalprice = tempDrug.Price * tempDrug.Quan_cur;

        //        // 将返回数据加到表格数据源中
        //        newDrug.Replace(tempDrug);
        //    }

        //    return true;
        //}
        public override bool LoadMedSrv(EmsCreatedParameter emsCreateParameter, int pos)
        {
            base.LoadMedSrv(emsCreateParameter, pos);
            MedSrvDO med   = emsCreateParameter.getMedSrvDO();
            String   id_mm = emsCreateParameter.getMmID();


            Dictionary <String, Object> ctmInfo = new Dictionary <string, object>();

            ctmInfo.Add("CustomInfo", emsCreateParameter.GetParameter() == null ? null : emsCreateParameter.GetParameter().ToString());
            EmsRstDTO[] rsts = CreateRemote(med.Id_srv, id_mm, ctmInfo);
            EmsRstDTO   rst  = rsts[0];

            if (rst != null)
            {
                // 获取列表最后一个数据
                EmsOrDrug newDrug = null;

                EmsDrugItemDO emsDrugItem = (rst.Document[0] as EmsDrugItemDO);
                //String utf8Str = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(rst.DocumentString));
                //EmsDrugItemDO emsDrugItem = new EmsDrugItemDO();
                //emsDrugItem.deSerializeJson(utf8Str);

                FMap2 emsExtMap = rst.Extension;

                this.id_dosages = emsExtMap["DosagesFilter"] as string;
                MedSrvDO        medSrv      = emsExtMap["MedSrvDO"] as MedSrvDO;
                OrWfDeptInfoDTO wf          = emsExtMap["OrWfDeptInfoDTO"] as OrWfDeptInfoDTO;
                SkinTestRstDTO  skinTestRst = emsExtMap["SkinTestRstDTO"] as SkinTestRstDTO;
                if (emsExtMap["IsShowWarnInfo"] != null && (bool)emsExtMap["IsShowWarnInfo"])
                {
                    this.tipInfoMsgString = emsExtMap["SpecilDrugWarnInfo"] as string;
                }
                // 物品参照
                if (emsDrugItem.EmsOrDrug == null)
                {
                    emsDrugItem.EmsOrDrug = new XapDataList <EmsOrDrug>();
                }
                foreach (EmsOrDrug drug in emsDrugItem.EmsOrDrugListEx)
                {
                    emsDrugItem.EmsOrDrug.Add(drug);
                }

                // 列表中显示的物品
                XapDataList <EmsOrDrug> emsOrDrugList = new XapDataList <EmsOrDrug>();

                foreach (EmsOrDrug drug in emsDrugItem.EmsOrDrugListEx)
                {
                    emsOrDrugList.Add(drug);
                }

                // 获取从后台返回的用于医嘱列表显示的数据
                EmsOrDrug tempDrug = emsOrDrugList[0];

                if (pos < 0)
                {
                    this.uiEmsDTO.MedSrvDO = med;

                    emsDrugItem.EmsOrDrugList = emsOrDrugList;
                    // 当物品id查询不到对应物品时,不做赋值操作
                    if (emsOrDrugList.Count > 0)
                    {
                        this.uiEmsDTO.Emsdrugs = emsDrugItem;
                    }
                    newDrug = this.uiEmsDTO.Emsdrugs.EmsOrDrugList.LastOrDefault();
                    this.uiEmsDTO.Emsdrugs.Id_dep   = tempDrug.Id_mp_dep;
                    this.uiEmsDTO.Emsdrugs.Name_dep = tempDrug.Name_mp_dep;
                }
                else
                {
                    newDrug = this.uiEmsDTO.Emsdrugs.EmsOrDrugList.ElementAt(pos);
                }

                // 设置当前选择项目
                SetSelectedObject(newDrug);


                //皮试判断逻辑
                string skinErrorInfo = AssToolEx.CheckSkinTestRst(tempDrug, skinTestRst, this.GetEnt4BannerDTO());
                if (skinErrorInfo != null)
                {
                    this.errorMsgString = skinErrorInfo;
                    this.logicEx.Clear <EmsOrDrug>(newDrug);
                    return(false);
                }

                // 加载第一条记录信息已经是全的了,不用执行后边的
                if (pos < 0)
                {
                    return(true);
                }

                if (!newDrug.IsUPDATED)
                {
                    tempDrug.Status = DOStatus.NEW;
                }
                else
                { // 增加该逻辑分支   针对 已保存的 医嘱项目 进行服务项目的修改 -- 2016-11-21 by wangqz
                    tempDrug.Status = DOStatus.UPDATED;
                }
                // 保留id_orsrv ,当对编辑项通过退格键删除后,在选择其他服务,Id_orsrv存在
                tempDrug.Id_orsrv = newDrug.Id_orsrv;

                // 新加的药品要与已有的保持同频次,同周期,同用法
                tempDrug.Id_route   = this.uiEmsDTO.Emsdrugs.Id_route;
                tempDrug.Name_route = this.uiEmsDTO.Emsdrugs.Name_route;

                // 同频次
                tempDrug.Id_freq       = this.uiEmsDTO.Emsdrugs.Id_freq;
                tempDrug.Name_freq     = this.uiEmsDTO.Emsdrugs.Name_freq;
                tempDrug.Sd_frequnitct = this.uiEmsDTO.Emsdrugs.Sd_frequnitct;
                tempDrug.Freqct        = this.uiEmsDTO.Emsdrugs.Freqct;

                // 如果只有一条记录,恢复到服务默认的频次,用法
                fillSameInfoWithMedSrvDO(tempDrug, medSrv);

                // 同周期
                tempDrug.Use_days = this.uiEmsDTO.Emsdrugs.Use_days;

                // 计算总次数
                int times_cur = CalQuantumUtil.GetInstance().getTotalTimes(tempDrug.Id_freq, (int)this.uiEmsDTO.Emsdrugs.Use_days);

                // 计算总量
                tempDrug.Quan_cur = CalQuantumUtil.GetInstance().getMMQuantum(tempDrug.Sd_opmutp, tempDrug.Quan_med, tempDrug.Factor_mb, tempDrug.Factor_cb, times_cur);

                // 计算总价
                tempDrug.Totalprice = tempDrug.Price * tempDrug.Quan_cur;

                // 将返回数据加到表格数据源中
                newDrug.Replace(tempDrug);
            }

            return(true);
        }
Ejemplo n.º 12
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);
        }