Пример #1
0
        /// <summary>
        /// 分析医嘱用药的合理情况
        /// </summary>
        /// <param name="ent4BannerDTO">banner数据</param>
        /// <param name="ciords">待校验用药合理性的医嘱</param>
        /// <param name="msg">验证结果的提示信息</param>
        /// <returns>验证状态 0 无问题,1 一般问题, 2 严重问题</returns>
        public override int AnalysisPresResult(CiEnContextDTO ctxDTO, CiOrderDO[] ciords, out string msg)
        {
            drugMonitor.BeginNewPres();
            msg = "";
            if (ciords == null || ciords.Length == 0)
            {
                return(DaTongConstant.RS_NOT_VERIFIED);
            }

            List <CiOrderDO> ciordList = new List <CiOrderDO>();
            List <string>    idOrList  = new List <string>();

            // 遍历医嘱,只需要校验药品的医嘱
            foreach (CiOrderDO ciorder in ciords)
            {
                if (ciorder.Sd_srvtp.StartsWith(BdSrvDictCodeConst.SD_SRVTP_DRUG)) // 药品的进行检查
                {
                    ciordList.Add(ciorder);
                    idOrList.Add(ciorder.Id_or);
                }
            }

            // 如果不存在药品,返回不需要验证
            if (ciordList.Count == 0)
            {
                return(DaTongConstant.RS_NOT_VERIFIED);
            }

            PresInfo presInfo = GetPresInfo(ctxDTO, idOrList);

            // 进行处方分析
            return(drugMonitor.AnalysisPres(presInfo, out msg));
        }
Пример #2
0
        /// <summary>
        /// 设置过敏史
        /// </summary>
        /// <returns></returns>
        private void SetAllergicHistory(ref PresInfo presInfo, PiPatAlDO[] pipatAls)
        {
            List <PresInfo.AllergicHistory> allergicHistory = new List <PresInfo.AllergicHistory>();
            // 过敏史记录数
            int pipatAlLength = pipatAls == null ? 0 : pipatAls.Length;
            // 获取需要循环的次数,构造大通使用的过敏史数据时,保证最少三条记录,不足设置空值
            int resultCnt = pipatAlLength > MINIMUM_RECORD_NUM ? pipatAlLength : MINIMUM_RECORD_NUM;

            for (int i = 0; i < resultCnt; i++)
            {
                PresInfo.AllergicHistory allergic = new PresInfo.AllergicHistory();
                if (pipatAlLength > i)
                {
                    allergic.Case_code = pipatAls[i].Mm_code;
                    allergic.Case_name = pipatAls[i].Mm_name;
                }
                else
                {
                    allergic.Case_code = "";
                    allergic.Case_name = "";
                }
                allergicHistory.Add(allergic);
            }

            presInfo.AllergicHistories = allergicHistory;
        }
Пример #3
0
        /// <summary>
        /// 获取处方
        /// </summary>
        /// <param name="ent4BannerDTO"></param>
        /// <param name="idOrs"></param>
        /// <returns></returns>
        private PresInfo GetPresInfo(CiEnContextDTO ctxDTO, List <string> idOrList)
        {
            Ent4BannerDTO ent4BannerDTO = ctxDTO.Ent4BannerDTO;

            // 获取本次就诊的已签署的药品医嘱以及ordIds 对应的医嘱
            OrdRationalDrugDTO[] rationalDrugs = iCiOrdQryService.getRationalDrugDTOs(ent4BannerDTO, idOrList.ToArray());

            PresInfo presInfo = new PresInfo();

            // 设置医生患者信息
            this.SetDoctorPresInfo(ctxDTO, ref presInfo);

            // 获取过敏史,生理状况
            OverviewAggDO overivewAgg = this.GetAllergicHistory(ctxDTO.Id_pat);

            // 设置过敏史
            this.SetAllergicHistory(ref presInfo, overivewAgg.getPiPatAlDO());

            // 设置诊断
            this.SetDiagnoses(ref presInfo, ctxDTO.Id_en);

            //设置生理状况
            this.SetPhysiological(ref presInfo, overivewAgg.getPiPatPhyDO());

            // 设置处方
            this.SetPrescription(ref presInfo, rationalDrugs, idOrList);

            return(presInfo);
        }
Пример #4
0
        private PresInfo GetPresInfo(List <CiOrderDO> ordList)
        {
            UserDO user = this.Context.User;
            DeptDO dept = this.Context.Dept;

            PresInfo presInfo = new PresInfo();

            presInfo.Doctor_job_number = user.Code;      //医生工号
            presInfo.Pres_date         = new DateTime(); //处方日期
            presInfo.Doctor_name       = user.Name;      // 医生名
            //presInfo.Doctor_type =  医生级别
            presInfo.Department_code = dept.Code;        // 科室代码 ? 开立科室
            presInfo.Department_name = dept.Name;        // 科室名称
            //presInfo.Case_id = 病历卡号
            //presInfo.Inhos_code = 住院号
            //presInfo.Bed_no = 床号
            //presInfo.Patient_weight = 患者体重
            //presInfo.Patient_height = 患者身高
            presInfo.Patient_birth = DateTime.Parse(ent4BannerDTO.Dt_birth); //患者出生日期
            presInfo.Patient_name  = ent4BannerDTO.Name_pat;                 // 患者名称
            presInfo.Patient_sex   = ent4BannerDTO.Name_sex;                 // 患者性别
            //presInfo.Physiological_statms 生理状况
            //presInfo.Boacterioscopy_effect 菌检结果
            //presInfo.Bloodpressur 血压
            //presInfo.Liver_clean 肌酐清除率

            presInfo.AllergicHistories = this.GetAllergicHistory(); // 过敏史

            presInfo.Diagnoses = this.GetDiagnoses();               // 诊断

            presInfo.Prescriptions = this.GetPrescriptions();       // 获取处方

            return(null);
        }
Пример #5
0
        /// <summary>
        /// 处方分析并保存
        /// </summary>
        /// <returns></returns>
        private string AnalysisAndSavePres()
        {
            PresInfo presInfo       = GetPresInfo();
            string   analysisResult = drugMonitor.AnalysisPres(presInfo);

            return(analysisResult);
        }
Пример #6
0
        private PresInfo GetPresInfo()
        {
            PresInfo presInfo = new PresInfo();

            presInfo.Case_id = "1";
            this.GetDoctorPresInfo(ref presInfo);

            List <PresInfo.Prescription> prescriptions = new List <PresInfo.Prescription>();

            // 处方
            PresInfo.Prescription prescription = new PresInfo.Prescription();
            prescription.Pres_ID   = "10";
            prescription.Pres_type = PresTypeEnum.OUTPATIENT;
            prescription.Current   = true;
            prescriptions.Add(prescription);



            // 药品
            List <PresInfo.Medicine> medicineList = new List <PresInfo.Medicine>();

            PresInfo.Medicine medicine1 = new PresInfo.Medicine();
            PresInfo.Medicine medicine2 = new PresInfo.Medicine();
            //药品1
            medicine1.Medicine_suspension = false;    // 药物悬浮液
            medicine1.Medicine_judge      = true;     // 药品判断
            medicine1.Group_number        = null;     // 组号
            medicine1.General_name        = "美托洛尔";   // 通用名
            medicine1.License_number      = "201153"; //医院药品代码
            medicine1.Medicine_name       = "美托洛尔";   //商品名
            medicine1.Single_dose         = 5;        //  单次计量
            medicine1.Times            = "1";         //频次代码
            medicine1.Days             = 2;           //天数
            medicine1.Unit             = "mg";        //单位
            medicine1.Administer_drugs = "";          //用药途径
            // 药品2
            medicine2.Medicine_suspension = false;    // 药物悬浮液
            medicine2.Medicine_judge      = true;     // 药品判断
            medicine2.Group_number        = null;     // 组号
            medicine2.General_name        = "氨氯地平";   // 通用名
            medicine2.License_number      = "200192"; //医院药品代码
            medicine2.Medicine_name       = "氨氯地平";   //商品名
            medicine2.Single_dose         = 5;        //  单次计量
            medicine2.Times            = "1";         //频次代码
            medicine2.Days             = 2;           //天数
            medicine2.Unit             = "mg";        //单位
            medicine2.Administer_drugs = "";          //用药途径

            medicineList.Add(medicine1);
            medicineList.Add(medicine2);

            //prescription.Medicines = medicineList;

            presInfo.Prescriptions = prescriptions;

            return(presInfo);
        }
Пример #7
0
        /// <summary>
        /// 获取处方用药的分析结果
        /// </summary>
        /// <returns></returns>
        private string GetAnalysisPresResult(List <CiOrderDO> ordList)
        {
            if (this.ent4BannerDTO == null)
            {
                return("");
            }

            PresInfo presInfo       = GetPresInfo(ordList);
            string   analysisResult = drugMonitor.AnalysisPres(presInfo);

            return(analysisResult);
        }
Пример #8
0
        /// <summary>
        ///  设置生理状况
        /// </summary>
        /// <param name="presInfo"></param>
        private void SetPhysiological(ref PresInfo presInfo, PiPatPhyDO[] piPatPys)
        {
            int           piPatPysLength = piPatPys == null ? 0 : piPatPys.Length;
            List <string> didefCodeList  = new List <string>();

            for (int i = 0; i < MINIMUM_RECORD_NUM; i++)
            {
                if (i < piPatPysLength)
                {
                    didefCodeList.Add(piPatPys[i].Name_phyind);
                }
                else
                {
                    didefCodeList.Add("");
                }
            }
            presInfo.Diagnoses.AddRange(didefCodeList);
        }
Пример #9
0
        /// <summary>
        /// 设置处方信息
        /// </summary>
        /// <param name="presInfo"></param>
        private void SetPrescription(ref PresInfo presInfo, OrdRationalDrugDTO[] rationalDrugs, List <string> idOrList)
        {
            List <PresInfo.Prescription> prescriptions = new List <PresInfo.Prescription>();

            foreach (OrdRationalDrugDTO rationalDto in rationalDrugs)
            {
                // 处方
                PresInfo.Prescription prescription = new PresInfo.Prescription();
                prescriptions.Add(prescription);

                prescription.Pres_ID   = rationalDto.Id_or;
                prescription.Pres_type = PresTypeEnum.OUTPATIENT;
                // 如果是当期签署的医嘱,则设置为当前医嘱,已签署过的医嘱设置为非当前医嘱
                prescription.Current = rationalDto.Fg_sign == FBoolean.True ? false : true;

                // 药品
                PresInfo.Medicine medicine = new PresInfo.Medicine();

                medicine.Medicine_suspension = false;                            // 药物悬浮液 TODO 判断逻辑
                medicine.Medicine_judge      = true;                             // 药品判断 TODO 判断逻辑

                medicine.Group_number   = null;                                  // 组号
                medicine.General_name   = this.ReplaceStr(rationalDto.Name_srv); // 通用名
                medicine.License_number = rationalDto.Code_mm;                   //医院药品代码
                medicine.Medicine_name  = this.ReplaceStr(rationalDto.Name_mm);  //商品名
                medicine.Single_dose    = Double.Parse(rationalDto.Quan_medu);   //  单次计量
                medicine.Times          = rationalDto.Freq_code;                 //频次代码
                if (!string.IsNullOrEmpty(rationalDto.Days_or))
                {
                    medicine.Days = Int16.Parse(rationalDto.Days_or); //天数
                }

                medicine.Unit             = rationalDto.Medu_name;  //单位
                medicine.Administer_drugs = rationalDto.Route_code; //用药途径

                prescription.Medicine = medicine;
                //prescriptions.Add(prescription);
            }

            presInfo.Prescriptions = prescriptions;
        }
Пример #10
0
        /// <summary>
        /// 设置处方中诊断
        /// </summary>
        /// <returns></returns>
        private void SetDiagnoses(ref PresInfo presInfo, string idEn)
        {
            List <string> didefCodeList = new List <string>();

            CiDiagItemDO[] cidiagItems = getCiDiagItems(idEn, "1");
            int            itemLength  = cidiagItems.Length;
            // 保证诊断最少有三个,如果诊断数不足三个,加空诊断补足
            int resultCnt = itemLength > MINIMUM_RECORD_NUM ? itemLength : MINIMUM_RECORD_NUM;

            for (int i = 0; i < resultCnt; i++)
            {
                if (i < itemLength)
                {
                    didefCodeList.Add(cidiagItems[i].Id_didef_code);
                }
                else
                {
                    didefCodeList.Add("");
                }
            }
            presInfo.Diagnoses = didefCodeList;
        }
Пример #11
0
        /// <summary>
        /// 获取过敏史集合
        /// </summary>
        /// <returns></returns>
        //private List<PresInfo.AllergicHistory> GetAllergicHistory()
        //{

        //    List<PresInfo.AllergicHistory> allergicHistory = new List<PresInfo.AllergicHistory>();
        //    PresInfo.AllergicHistory allergic = new PresInfo.AllergicHistory();

        //    allergicHistory.Add(allergic);
        //    return allergicHistory;
        //}

        /// <summary>
        /// 设置处方分析中医生、患者相关属性
        /// </summary>
        /// <param name="presInfo"></param>
        private void SetDoctorPresInfo(CiEnContextDTO ctxDTO, ref PresInfo presInfo)
        {
            Ent4BannerDTO ent4BannerDTO = ctxDTO.Ent4BannerDTO;
            //UserDO user = this.context.User;
            PsnInfo psnInfo = ctxDTO.PsnInfo;
            DeptDO  dept    = ctxDTO.Dept;

            presInfo.Doctor_job_number = psnInfo.Code;                                                 //医生工号 TODO 医生工号?
            presInfo.Pres_date         = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); //处方日期 TODO 取当前日期是否可行
            presInfo.Doctor_name       = psnInfo.Name;                                                 // 医生名
            //presInfo.Doctor_type =  医生级别
            presInfo.Department_code = ent4BannerDTO.Id_dep_phy;                                       // 科室代码 ? 开立科室 本次就诊科室
            presInfo.Department_name = ent4BannerDTO.Name_dep_phy;                                     // 科室名称
            // 患者基本信息PI_PAT .CHIS条码号barcode_chis ;住院-- 住院号,患者基本信息PI_PAT .住院病案编号code_amr_ip
            presInfo.Case_id        = ent4BannerDTO.Code_amr_ip;                                       //病历卡号 TODO 确定属性内后在设置
            presInfo.Inhos_code     = ent4BannerDTO.Code_ent;                                          //门诊就诊号
            presInfo.Bed_no         = ent4BannerDTO.Name_bed;                                          //床号 门诊床号可以为空,实际大通不支持空值
            presInfo.Patient_weight = "";                                                              //患者体重
            presInfo.Patient_height = "";                                                              //患者身高
            if (!string.IsNullOrEmpty(ent4BannerDTO.Dt_birth))
            {
                try
                {
                    presInfo.Patient_birth = DateTime.Parse(ent4BannerDTO.Dt_birth); //患者出生日期
                }
                catch (Exception e)
                {
                    LogManager.GetLogger().ErrorEx("合理用药获取患者生日失败,生日值【" + ent4BannerDTO.Dt_birth + "】");
                }
            }
            presInfo.Patient_name          = ent4BannerDTO.Name_pat; // 患者名称
            presInfo.Patient_sex           = ent4BannerDTO.Name_sex; // 患者性别
            presInfo.Physiological_statms  = "";                     //生理状况
            presInfo.Boacterioscopy_effect = "";                     // 菌检结果
            presInfo.Bloodpressure         = "";                     // 血压
            presInfo.Liver_clean           = "";                     // 肌酐清除率
        }
Пример #12
0
        private void GetDoctorPresInfo(ref PresInfo presInfo)
        {
            UserDO user = this.Context.User;
            DeptDO dept = this.Context.Dept;

            presInfo.Doctor_job_number = user.Code;      //医生工号
            presInfo.Pres_date         = new DateTime(); //处方日期
            presInfo.Doctor_name       = user.Name;      // 医生名
            //presInfo.Doctor_type =  医生级别
            presInfo.Department_code = dept.Code;        // 科室代码 ? 开立科室
            presInfo.Department_name = dept.Name;        // 科室名称
            presInfo.Case_id         = "blkh0001";       //病历卡号
            //presInfo.Inhos_code = 住院号
            //presInfo.Bed_no = 床号
            presInfo.Patient_weight = "100Kg";                                //患者体重
            presInfo.Patient_height = "170cm";                                //患者身高
            presInfo.Patient_birth  = DateTime.Parse(ent4BannerDTO.Dt_birth); //患者出生日期
            presInfo.Patient_name   = ent4BannerDTO.Name_pat;                 // 患者名称
            presInfo.Patient_sex    = ent4BannerDTO.Name_sex;                 // 患者性别
            //presInfo.Physiological_statms 生理状况
            //presInfo.Boacterioscopy_effect 菌检结果
            //presInfo.Bloodpressur 血压
            //presInfo.Liver_clean 肌酐清除率
        }