コード例 #1
0
ファイル: MDSCreater.cs プロジェクト: Jeriffe/Demo.HL7Message
        public MDSCheckInputParm CreateMDSRequest(PatientDemoEnquiry patientEnquiry,
                                                  AlertProfileResult alertProfileRes,
                                                  GetDrugMdsPropertyHqResponse getDrugMdsPropertyHqRes,
                                                  GetPreparationResponse getPreparationRes,
                                                  ref string drugName
                                                  )
        {
            var patientCache = FullCacheHK.PataientCache[patientEnquiry.CaseList[0].Number.Trim().ToUpper()];

            var mdsInput = new MDSCheckInputParm
            {
                PatientInfo = CreateMDSPatientInfo(patientEnquiry),

                UserInfo = CreateMDSUserInfo(patientEnquiry),

                PatientAllergyProfile = CreateMDSAllergy(alertProfileRes),

                PatientAdrProfile = CreateMDSAdr(alertProfileRes),

                CurrentRxDrugProfile = CreateMDSRxDrugProfileIfSkipMDS(getDrugMdsPropertyHqRes, getPreparationRes, patientEnquiry.CaseList[0].HospitalCode),

                CheckDscm    = false,
                CheckDrcm    = false,
                CheckDlcm    = false,
                CheckSteroid = false,
                CheckDiscon  = false,
                CheckHepaB   = false,
                HasPregnancy = false,
                CheckDdim    = false,

                HasG6pdDeficiency  = true,
                CheckDdcm          = true,
                CheckDam           = true,
                CheckAdr           = true,
                CallerSourceSystem = "PMS",
            };

            //show at msg title: CAUTION for + uppercase[drugDdimDisplayName from 2.5.1]
            drugName = mdsInput.CurrentRxDrugProfile.DrugDdimDisplayName.ToUpper();

            return(mdsInput);
        }
コード例 #2
0
ファイル: MDSCreater.cs プロジェクト: Jeriffe/Demo.HL7Message
        /// <summary>
        /// if moeCheckFlag =="N" && GroupMoeCheckFlag =="N", skip MDS check
        /// </summary>
        /// <param name="getDrugMdsPropertyHqRes"></param>
        /// <param name="getPreparationRes"></param>
        /// <param name="mdsInput"></param>
        /// <returns></returns>
        private CurrentRxDrugProfile CreateMDSRxDrugProfileIfSkipMDS(GetDrugMdsPropertyHqResponse getDrugMdsPropertyHqRes, GetPreparationResponse getPreparationRes, string hospitalCode)
        {
            var currentRxDrugProfile = new CurrentRxDrugProfile
            {
                IsCapdItem = "false",
                //Initialize in the comming
                GcnSeqNo = 0,
                RDfGenId = 0,
                RGenId   = 0,
                Type     = "",

                TrueDisplayName = getPreparationRes.Return.TrueDisplayname,
                //Initialize in the comming
                DrugDisplayName      = getPreparationRes.Return.TrueDisplayname + " " + getPreparationRes.Return.SaltProperty,
                DrugDdimDisplayName  = "",
                DrugErrorDisplayName = "",

                ArrayPos = "0",
                IndRow   = "0",
                OrdNo    = "0",
                HospCode = hospitalCode,
                Delete   = "false",

                Salt     = getDrugMdsPropertyHqRes.Return[0].DrugProperty.SaltProperty,
                Strength = getPreparationRes.Return.Strength,
                FormCode = getDrugMdsPropertyHqRes.Return[0].DrugProperty.FormCode,
                ItemCode = getDrugMdsPropertyHqRes.Return[0].ItemCode,

                SpecRestrict        = "",
                SpecInstruct        = "",
                PharSpec            = "",
                DataUpdate          = "N",
                DdimDosRelatedCheck = "N",
            };

            /*GcnSeqNo
             * if  (moeCheckFlag from 2.4.1.2) = “Y”
             *       if (gcnSeqno from 2.4.1.2) > 0, then gcnSeqno from 2.4.1.2
             *       else “0”
             * else if (GroupMoeCheckFlag from 2.4.1.2) = “Y”
             *   if (groupGcnSeqno from2.4.1.2) > 0, then groupGcnSeqno from2.4.1.2
             *   else “0”
             * else skip MDS checking
             *
             *
             * RDfGenId
             * if  (moeCheckFlag from 2.4.1.2) = “Y”
             *  if (routeformGeneric from 2.4.1.2) > 0, then routeformGeneric from 2.4.1.2
             *  else “0”
             * else if (GroupMoeCheckFlag from 2.4.1.2) = “Y”
             *  if (groupRouteformGeneric from2.4.1.2) > 0, then groupRouteformGeneric from2.4.1.2
             *  else “0”
             * else skip MDS checking
             *
             * RGenId
             * if  (moeCheckFlag from 2.4.1.2) = “Y”
             *    if (routedGeneric from 2.4.1.2) > 0, then routedGeneric from 2.4.1.2
             *    else “0”
             * else if (GroupMoeCheckFlag from 2.4.1.2) = “Y”
             *    if (groupRoutedGeneric from2.4.1.2) > 0, then groupRoutedGeneric from2.4.1.2
             *    else “0”
             * else skip MDS checking
             */
            var drugMds      = getDrugMdsPropertyHqRes.Return[0].DrugMds;
            var drugProperty = getDrugMdsPropertyHqRes.Return[0].DrugProperty;

            if (drugMds.MoeCheckFlag == "Y")
            {
                currentRxDrugProfile.GcnSeqNo = drugMds.GcnSeqno > 0 ? drugMds.GcnSeqno : 0;
                currentRxDrugProfile.RGenId   = drugMds.RoutedGeneric > 0 ? drugMds.RoutedGeneric : 0;
                currentRxDrugProfile.RDfGenId = drugMds.RouteformGeneric > 0 ? drugMds.RouteformGeneric : 0;
            }
            else if (drugMds.GroupMoeCheckFlag == "Y")
            {
                currentRxDrugProfile.GcnSeqNo = drugMds.GroupGcnSeqno > 0 ? drugMds.GroupGcnSeqno : 0;
                currentRxDrugProfile.RGenId   = drugMds.GroupRoutedGeneric > 0 ? drugMds.GroupRoutedGeneric : 0;
                currentRxDrugProfile.RDfGenId = drugMds.GroupRouteformGeneric > 0 ? drugMds.GroupRouteformGeneric : 0;
            }

            /*Type
             * if (gcnSeqNum > 0), then "S"
             * else if (gcnSeqNum <= 0 && (rdfgenId > 0 || rgenId > 0)), then "R"
             * else "X"
             */
            if (currentRxDrugProfile.GcnSeqNo > 0)
            {
                currentRxDrugProfile.Type = "S";
            }
            else if (currentRxDrugProfile.RDfGenId > 0 || currentRxDrugProfile.RGenId > 0)
            {
                currentRxDrugProfile.Type = "R";
            }
            else
            {
                currentRxDrugProfile.Type = "X";
            }

            /*DrugDdimDisplayName
             * drugDisplayName +
             * if (Drug moeDesc from 2.4.2.2) is BLANK, then BLANK
             * else “ “ + lowercase(Drug moeDesc from 2.4.2.2)
             */
            currentRxDrugProfile.DrugDdimDisplayName = drugProperty.Displayname;
            if (!string.IsNullOrEmpty(getPreparationRes.Return.MoeDesc))
            {
                currentRxDrugProfile.DrugDdimDisplayName += " " + getPreparationRes.Return.MoeDesc.ToLower();
            }

            /*DrugErrorDisplayName
             * drugDdimDisplayName +
             * 1.	if(Drug strength from 2.4.2.2) is BLANK, then BLANK
             * else “ “ + lowercase(Drug strength from 2.4.2.2)
             * 2.	if(Drug volumeValue from 2.4.2.2) not > 0, then BLANK
             * else “ “ + (Drug volumeValue from 2.4.2.2) in format "#######.####" + lowercase(Drug  volumeUnit from 2.4.2.2)
             */
            currentRxDrugProfile.DrugErrorDisplayName =
                GetDrugErrorDisplayName(currentRxDrugProfile.DrugDdimDisplayName,
                                        getPreparationRes.Return.Strength,
                                        getPreparationRes.Return.VolumeValue,
                                        getPreparationRes.Return.VolumeUnit);


            return(currentRxDrugProfile);
        }