Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BGPPOST

BGPPOST.m

Go to the documentation of this file.
BGPPOST ; IHS/CMI/LAB - NO DESCRIPTION PROVIDED 28 Jan 2005 1:34 PM ;
 ;;7.0;IHS CLINICAL REPORTING;;JAN 24, 2007
 ;
 ;
 ;SEND OUT BGP TAXONOMIES
 ; The following line prevents the "Disable Options..." and "Move
 ; Routines..." questions from being asked during the install.
 I $G(XPDENV)=1 S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
 F X="XPO1","XPZ1","XPZ2","XPI1" S XPDDIQ(X)=0
 ;I '$$INSTALLD("AUM*5.1*8") D SORRY(2)
 I '$$INSTALLD("ATX*5.1*8") D SORRY(2)
 I '$$INSTALLD("APCL*3.0*17") D SORRY(2)
 I '$$INSTALLD("AUPN*99.1*15") D SORRY(2)
 Q
 ;
PRE ;EP
 D PRE^BGPPOST1
 Q
POST ;EP - called from kids build
 S DA=$O(^BMXADO("B","BGP 06 HEDIS INDICATORS",0))
 I 'DA D
 . D ^XBFMK
 . S X="BGP 06 HEDIS INDICATORS"
 . S DIC="^BMXADO(",DIC(0)="L",DIADD=1,DLAYGO=90093.99
 . K DD,D0,DO
 . S DIC("DR")=".02///90375.01"
 . D FILE^DICN
 . I Y=-1 W !!,"Creating schema failed!! " Q
 . S Y=+Y
 . S ^BMXADO(Y,1,0)="^90093.991^1^1"
 . S ^BMXADO(Y,1,1,0)=".05^T^80^Indicator"
 . S ^BMXADO(Y,1,"B",.05,1)=""
 . S DA=Y,DIK="^BMXADO(" D IX1^DIK
 . Q
 S ATXFLG=1
 D ^BGP6AX ;taxonomies
 D ^BGP6BX ;taxonomies
 D ^BGP6EX
 D ^BGP6FX
 D ^BGP6HX
 D ^BGP6GX
 D ^BGP6JX
MT ;MOVE TEMPORARY TAXONOMIES TO ATXAX
 S ATXFLG=1
 S BGPX=0 F  S BGPX=$O(^BGPTAXTM(BGPX)) Q:BGPX'=+BGPX  D
 .S BGPN=$P(^BGPTAXTM(BGPX,0),U)
 .S BGPY=$O(^ATXAX("B",BGPN,0))
 .I BGPY S DA=BGPY,DIK="^ATXAX(" D ^DIK
 .S X=BGPN,DIC="^ATXAX(",DIC(0)="L",DIADD=1,DLAYGO=9002226 D ^DIC K DIC,DA,DIADD,DLAYGO,I
 .I Y=-1 W !!,"creating taxonomy failed....",BGPN Q
 .S BGPZ=+Y
 .M ^ATXAX(BGPZ)=^BGPTAXTM(BGPX)
 .S DA=BGPZ,DIK="^ATXAX(" D IX1^DIK
 .Q
 D PRVTAX^BGPPOST1
 D CLTAX^BGPPOST1
 D MHTAX^BGPPOST1
 D LAB^BGPPOST1
 D DRUGS^BGPPOST1
 K ATXFLG
 S X=0 F  S X=$O(^ATXAX(X)) Q:X'=+X  I $E($P($G(^ATXAX(X,0)),U,1),1,3)["BGP" S $P(^ATXAX(X,0),U,4)="n"
 S X=0 F  S X=$O(^ATXLAB(X)) Q:X'=+X  I $E($P($G(^ATXLAB(X,0)),U,1),1,3)["BGP" S $P(^ATXLAB(X,0),U,4)="n"
 D EN^XBVK("BGP")
 D SEC
 D SETTAX
 D SETTAXL
 D SETTAXF
 ;move ado schemas to bmx ado schema
 S BGPX=0 F  S BGPX=$O(^BGPBMX(BGPX)) Q:BGPX'=+BGPX  D
 .S BGPN=$P(^BGPBMX(BGPX,0),U)
 .Q:$D(^BMXADO("B",BGPN))  ;already in file
 .S G=0,X=0 F  S X=$O(^BMXADO(X)) Q:X'=+X!(G)  I $P(^BMXADO(X,0),U)=BGPN S G=1
 .Q:G
 .S X=BGPN,DIC="^BMXADO(",DIADD=1,DLAYGO=90093.99,DIC(0)="AEMQL" K DO,D0,DD D FILE^DICN
 .I Y=-1 W !!,"Failure to add BMX ADO Schema ",BGPN K DIADD,DLAYGO,DIC,DA Q
 .S BGPDA=+Y
 .K DIADD,DLAYGO,DIC,DA D ^XBFMK
 .M ^BMXADO(BGPDA)=^BGPBMX(BGPX)
 .S DA=BGPDA,DIK="^BMXADO(" D IX1^DIK K DA,DIK
 Q
 ;
SETTAXF ;
 S X=0 F  S X=$O(^ATXLAB(X)) Q:X'=+X  D
 .Q:$P(^ATXLAB(X,0),U,9)]""
 .S $P(^ATXLAB(X,0),U,9)=60
 .Q
 Q
SETTAX ;
 Q:'$D(^DD(9002226,4101,0))  ;taxonomy patch not yet installed
 S BGPTFI="" F  S BGPTFI=$O(^BGPTAXV("B",BGPTFI)) Q:BGPTFI=""  D
 .S BGPTFIEN=$O(^BGPTAXV("B",BGPTFI,0))
 .I 'BGPTFIEN Q
 .Q:'$D(^BGPTAXV(BGPTFIEN))
 .Q:$P(^BGPTAXV(BGPTFIEN,0),U,2)="L"
 .S BGPTDA=$O(^ATXAX("B",BGPTFI,0))
 .Q:'BGPTDA  ;did not find taxonomy
 .S BGPE=$P(^BGPTAXV(BGPTFIEN,0),U,4)
 .I BGPE=0 S $P(^ATXAX(BGPTDA,0),U,22)=1
 .I BGPE=1 S $P(^ATXAX(BGPTDA,0),U,22)=0
 .S $P(^ATXAX(BGPTDA,0),U,4)="n"
 .;set packages in multiple
 .K DIC,DA,DR
 .S BGPPI=$O(^DIC(9.4,"C","BGP",0))
 .Q:BGPPI=""  ;NO PACKAGE
 .S X="`"_BGPPI,DIC="^ATXAX("_BGPTDA_",41,",DIC(0)="L",DIC("P")=$P(^DD(9002226,4101,0),U,2),DA(1)=BGPTDA
 .D ^DIC
 .I Y=-1 W !,"updating package multiple for ",BGPPP," entry ",$P(^ATXAX(BGPDA,0),U)," failed"
 .K DIC,DA,Y,X
 .Q
 S BGPTEXT="TAX" F BGPX=1:1 S BGPDATA=$P($T(@BGPTEXT+BGPX),";;",2) Q:BGPDATA=""  D
 .S BGPDA=$O(^ATXAX("B",$P(BGPDATA,"|"),0))
 .Q:BGPDA=""
 .S $P(^ATXAX(BGPDA,0),U,4)="n" W !,$P(BGPDATA,"|")  ;SET NO DELETE
 .S $P(^ATXAX(BGPDA,0),U,22)=$P(BGPDATA,"|",2) ;set read only
 .;set packages in multiple
 .K DIC,DA,DR
 .S BGPP=$P(BGPDATA,"|",3)
 .F BGPN=1:1 S BGPPP=$P(BGPP,"*",BGPN) Q:BGPPP=""  D
 ..S BGPPI=$O(^DIC(9.4,"C",BGPPP,0))
 ..Q:BGPPI=""  ;NO PACKAGE
 ..S X="`"_BGPPI,DIC="^ATXAX("_BGPDA_",41,",DIC(0)="L",DIC("P")=$P(^DD(9002226,4101,0),U,2),DA(1)=BGPDA
 ..D ^DIC
 ..I Y=-1 W !,"updating package multiple for ",BGPPP," entry ",$P(^ATXAX(BGPDA,0),U)," failed"
 ..K DIC,DA,Y,X
 .Q
 Q
SETTAXL ;
 Q:'$D(^DD(9002228,4101,0))  ;taxonomy patch not yet installed
 S BGPTEXT="LABTAX" F BGPX=1:1 S BGPDATA=$P($T(@BGPTEXT+BGPX),";;",2) Q:BGPDATA=""  D
 .S BGPDA=$O(^ATXLAB("B",$P(BGPDATA,"|"),0))
 .Q:BGPDA=""
 .S $P(^ATXLAB(BGPDA,0),U,4)="n" W !,$P(BGPDATA,"|")  ;SET NO DELETE
 .S $P(^ATXLAB(BGPDA,0),U,22)=$P(BGPDATA,"|",2) ;set read only
 .;set packages in multiple
 .K DIC,DA,DR
 .S BGPP=$P(BGPDATA,"|",3)
 .F BGPN=1:1 S BGPPP=$P(BGPP,"*",BGPN) Q:BGPPP=""  D
 ..S BGPPI=$O(^DIC(9.4,"C",BGPPP,0))
 ..Q:BGPPI=""  ;NO PACKAGE
 ..S X="`"_BGPPI,DIC="^ATXLAB("_BGPDA_",41,",DIC(0)="L",DIC("P")=$P(^DD(9002228,4101,0),U,2),DA(1)=BGPDA
 ..D ^DIC
 ..I Y=-1 W !,"updating package multiple for ",BGPPP," entry ",$P(^ATXLAB(BGPDA,0),U)," failed"
 ..K DIC,DA,Y,X
 .Q
 Q
INSTALLD(BGPSTAL) ;EP - Determine if patch BGPSTAL was installed, where
 ; BGPSTAL is the name of the INSTALL.  E.g "AG*6.0*11".
 ;
 NEW BGPY,DIC,X,Y
 S X=$P(BGPSTAL,"*",1)
 S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
 D IX^DIC
 I Y<1 D IMES Q 0
 S DIC=DIC_+Y_",22,",X=$P(BGPSTAL,"*",2)
 D ^DIC
 I Y<1 D IMES Q 0
 S DIC=DIC_+Y_",""PAH"",",X=$P(BGPSTAL,"*",3)
 D ^DIC
 S BGPY=Y
 D IMES
 Q $S(BGPY<1:0,1:1)
IMES ;
 D MES^XPDUTL($$CJ^XLFSTR("Patch """_BGPSTAL_""" is"_$S(Y<1:" *NOT*",1:"")_" installed.",IOM))
 Q
SORRY(X) ;
 KILL DIFQ
 I X=3 S XPDQUIT=2 Q
 S XPDQUIT=X
 W *7,!,$$CJ^XLFSTR("Sorry....FIX IT!",IOM)
 Q
LABTAX ;
 ;;BGP CD4 TAX|0|BGP
 ;;BGP CHLAMYDIA TESTS TAX|0|BGP
 ;;BGP GPRA ESTIMATED GFR TAX|0|BGP
 ;;BGP GPRA FOB TESTS|0|BGP
 ;;BGP HIV TEST TAX|0|BGP
 ;;BGP HIV VIRAL LOAD TAX|0|BGP
 ;;BGP PAP SMEAR TAX|0|BGP
 ;;DM AUDIT A/C RATIO TAX|0|APCL*BDM*BGP
 ;;DM AUDIT CHOLESTEROL TAX|0|APCL*BDM*BGP
 ;;DM AUDIT CREATININE TAX|0|APCL*BDM*BGP
 ;;DM AUDIT HDL TAX|0|APCL*BDM*BGP
 ;;DM AUDIT HGB A1C TAX|0|APCL*BDM*BGP
 ;;DM AUDIT LDL CHOLESTEROL TAX|0|APCL*BDM*BGP
 ;;DM AUDIT LIPID PROFILE TAX|0|APCL*BDM*BGP
 ;;DM AUDIT MICROALBUMINURIA TAX|0|APCL*BDM*BGP
 ;;DM AUDIT TRIGLYCERIDE TAX|0|APCL*BDM*BGP
 ;;DM AUDIT URINE PROTEIN TAX|0|APCL*BDM*BGP
 ;;DM AUDIT FASTING GLUCOSE TESTS|0|APCL*BDM*BGP
 ;;BGP CMS ABG TESTS|0|BGP
 ;;BGP CBC TESTS|0|BGP
 ;;DM AUDIT URINALYSIS TAX|0|BGP*APCL*BDM
 ;;DM AUDIT ALT TAX|0|BGP
 ;;DM AUDIT AST TAX|0|BGP*APCL*BDM
 ;;BGP GROUP A STREP TESTS|0|BGP
 ;;BGP LIVER FUNCTION TESTS|0|BGP
 ;;BGP URINE GLUCOSE|0|BGP
 ;;BGP POTASSIUM TESTS|0|BGP
 ;;BGP CMS BLOOD CULTURE|0|BGP
 ;;
TAX ; 
 ;;SURVEILLANCE DIABETES|1|BGP
 ;;SURVEILLANCE HYPERTENSION|1|BGP
 ;;BGP ALCOHOL DXS|1|BGP
 ;;BGP ASTHMA DXS|1|BGP
 ;;BGP BE CPTS|1|BGP
 ;;BGP CD4 LOINC CODES|1|BGP
 ;;BGP CHLAMYDIA CPTS|1|BGP
 ;;BGP CHLAMYDIA LOINC CODES|1|BGP
 ;;BGP COLO CPTS|1|BGP
 ;;BGP COLORECTAL CANCER DXS|1|BGP
 ;;BGP CPT FLU|1|BGP
 ;;BGP CPT HIV TESTS|1|BGP
 ;;BGP CPT MAMMOGRAM|1|BGP
 ;;BGP CPT MAMMOGRAM HEDIS|1|BGP
 ;;BGP CPT PAP|1|BGP
 ;;BGP CREATININE CPTS|1|BGP
 ;;BGP CREATININE LOINC CODES|1|BGP
 ;;BGP DEPRESSIVE DISORDERS|1|BGP
 ;;BGP DIPHTHERIA EVIDENCE|1|BGP
 ;;BGP DV DXS|1|BGP
 ;;BGP FOBT LOINC CODES|1|BGP
 ;;BGP GPRA EX EDUC TOPICS|1|BGP
 ;;BGP GPRA PREGNANCY DIAGNOSES|1|BGP
 ;;BGP GPRA SMOKING DXS|1|BGP
 ;;BGP HDL LOINC CODES|1|BGP
 ;;BGP HGBA1C LOINC CODES|1|BGP
 ;;BGP HIB EVIDENCE|1|BGP
 ;;BGP HIV TEST LOINC CODES|1|BGP
 ;;BGP HIV/AIDS DXS|1|BGP
 ;;BGP HYPERTENSION DXS|1|BGP
 ;;BGP HYPOTENSION DXS|1|BGP
 ;;BGP HYSTERECTOMY CPTS|1|BGP
 ;;BGP ISCHEMIC HEART DXS|1|BGP
 ;;BGP LDL LOINC CODES|1|BGP
 ;;BGP LIPID PROFILE LOINC CODES|1|BGP
 ;;BGP UNI MASTECTOMY PROCEDURES|1|BGP
 ;;BGP MEASLES EVIDENCE|1|BGP
 ;;BGP MICROALBUM LOINC CODES|1|BGP
 ;;BGP MISCARRIAGE/ABORTION DXS|1|BGP
 ;;BGP MMR CONTRAINDICATIONS|1|BGP
 ;;BGP MUMPS EVIDENCE|1|BGP
 ;;BGP NEPHROPATHY CPTS|1|BGP
 ;;BGP NEPHROPATHY DXS|1|BGP
 ;;BGP NEPHROPATHY PROCEDURES|1|BGP
 ;;BGP OPV CONTRAINDICATIONS|1|BGP
 ;;BGP OPV EVID DISEASE|1|BGP
 ;;BGP PAP LOINC CODES|1|BGP
 ;;BGP PERUTSSIS EVIDENCE|1|BGP
 ;;BGP PCR LOINC CODES|1|BGP
 ;;BGP PRIMARY CARE CLINICS|1|BGP
 ;;BGP PRIMARY PROVIDER DISC|1|BGP
 ;;BGP RECTAL PROCEDURE CODES|1|BGP
 ;;BGP RUBELLA EVIDENCE|1|BGP
 ;;BGP SIG CPTS|1|BGP
 ;;BGP TOTAL CHOLESTEROL LOINC|1|BGP
 ;;BGP TRIGLYCERIDE LOINC CODES|1|BGP
 ;;BGP URINE PROTEIN LOINC CODES|1|BGP
 ;;BGP VARICELLA CONTRA|1|BGP
 ;;BGP VARICELLA EVIDENCE|1|BGP
 ;;BGP VIRAL LOAD LOINC CODES|1|BGP
 ;;BGP CMS AMI DXS|1|BGP
 ;;BGP AMI DXS (HEDIS)|1|BGP
 ;;BGP AMI IND 30
 ;;BGP CMS PNEUMONIA DXS|1|BGP
 ;;BGP CMS SEPTI/RESP FAIL DXS|1|BGP
 ;;BGP CMS HEART FAILURE DXS|1|BGP
 ;;BGP CMS LVSD DXS|1|BGP
 ;;BGP CMS EJECTION FRACTION CPTS|1|BGP
 ;;BGP CMS EJECTION FRACTION PROC|1|BGP
 ;;BGP CMS CIRCULATORY SHOCK DXS|1|BGP
 ;;BGP CMS 2/3 HEART BLOCK DXS|1|BGP
 ;;BGP CMS BRADYCARDIA DXS|1|BGP
 ;;BGP ASA ALLERGY 995.0-995.3|1|BGP
 ;;BGP CMS ABG CPTS|1|BGP
 ;;BGP CMS AORTIC STENOSIS DXS|1|BGP
 ;;BGP CMS WARFARIN MEDS|0|BGP
 ;;DM AUDIT ASPIRIN DRUGS|0|BGP
 ;;DM AUDIT ANTI-PLATELET DRUGS|0|BGP
 ;;BGP CMS ANTIBIOTIC MEDS|0|BGP
 ;;BGP CMS BETA BLOCKER MEDS|0|BGP
 ;;BGP CMS ACEI MEDS|0|BGP
 ;;BGP CMS ARB MEDS|0|BGP
 ;;BGP CMS ANTI-PLATELET CLASS|1|BGP
 ;;BGP CMS ACEI MEDS CLASS|1|BGP
 ;;BGP CMS BETA BLOCKER CLASS|1|BGP
 ;;BGP CMS ARB MEDS CLASS|1|BGP
 ;;BGP CMS ANTIBIOTIC MEDS CLASS|1|BGP
 ;;BGP CMS BETA BLOCKER NDC|0|BGP
 ;;BGP HEDIS OSTEOPOROSIS NDC|0|BGP
 ;;BGP HEDIS OSTEOPOROSIS DRUGS|0|BGP
 ;;BGP HEDIS ANTIDEPRESSANT MEDS|0|BGP
 ;;BGP HEDIS ANTIDEPRESSANT NDC|1|BGP
 ;;BGP MOOD DISORDERS|1|BGP
 ;;BGP MAJOR DEPRESSIVE DISORDERS|1|BGP
 ;;BGP MAJOR DEPRESSION PRIOR|1|BGP
 ;;BGP ACUTE MENTAL HEALTH|1|BGP
 ;;BGP SUBSTANCE ABUSE|1|BGP
 ;;BGP POISONINGS SUBSTANCE ABUSE|1|BGP
 ;;BGP PRESCRIBING PROVIDER CLASS|1|BGP
 ;;BGP MENTAL HEALTH PROV CLASS|1|BGP
 ;;BGP OPT MH VISIT POVS|1|BGP
 ;;BGP OPT MH VISIT CPTS MH|1|BGP
 ;;BGP MH OPT VISIT CPT NMH 1|1|BGP
 ;;BGP MH OPT VISIT CPT NMH 3|1|BGP
 ;;BGP OSTEOPOROSIS DXS|1|BGP
 ;;BGP OSTEO SCREEN CPTS|1|BGP
 ;;BGP MAJOR DEPRESSION (ADM)|1|BGP
 ;;BGP ASTHMA CONTROLLER NDC|1|BGP
 ;;BGP ASTHMA CONTROLLERS|0|BGP
 ;;BGP ASTHMA INHALED STEROID NDC|1|BGP
 ;;BGP ASTHMA INHALED STEROIDS|0|BGP
 ;;BGP ASTHMA LEUKOTRIENE NDC|1|BGP
 ;;BGP ASTHMA LEUKOTRIENE|0|BGP
 ;;BGP BMD PROCEDURES|1|BGP
 ;;BGP BMD CPTS|1|BGP
 ;;BGP CABG CPTS|1|BGP
 ;;BGP CABG PROCS|1|BGP
 ;;BGP COPD DXS|1|BGP
 ;;BGP COPD DXS BB CONT|1|BGP
 ;;BGP EMPHYSEMA DXS|1|BGP
 ;;BGP ESRD DXS|1|BGP
 ;;BGP FRACTURE CPTS|1|BGP
 ;;BGP FRACTURE DXS|1|BGP
 ;;BGP FRACTURE PROCEDURES|1|BGP
 ;;BGP HEDIS RETINAL SCREENING|1|BGP
 ;;BGP HEDIS RETINAL SCRN PROCS|1|BGP
 ;;BGP HEP EVIDENCE|1|BGP
 ;;BGP MASTECTOMY PROCEDURES|1|BGP
 ;;BGP PTCA CPTS|1|BGP
 ;;BGP PTCA PROCS|1|BGP
 ;;BGP SINUS BRADYCARDIA DXS|1|BGP
 ;;DM AUDIT FASTING GLUC LOINC|1|BGP
 ;;BGP OSTEOARTHRITIS DXS|1|BGP
 ;;BGP RA OA NSAID MEDS|0|BGP
 ;;BGP RA OA NSAID NDC|1|BGP
 ;;BGP OA GLUCOCORTICOIDS MEDS|0|BGP
 ;;BGP OA GLUCOCORTICOIDS CLASS|1|BGP
 ;;BGP CBC CPT|1|BGP
 ;;BGP CBC LOINC|1|BGP
 ;;DM AUDIT URINALYSIS LOINC|1|BGP*APCL*BDM
 ;;BGP ALT LOINC|1|BGP
 ;;BGP ALT CPT|1|BGP
 ;;BGP AST CPT|1|BGP
 ;;BGP AST LOINC|1|BGP
 ;;BGP BMD DXS|1|BGP
 ;;BGP IVD DXS|1|BGP
 ;;BGP TOBACCO DXS|1|BGP
 ;;BGP TOTAL CHOLECTOMY CPTS|1|BGP
 ;;BGP TOTAL CHOLECTOMY PROCS|1|BGP
 ;;BGP HYSTERECTOMY PROCEDURES|1|BGP
 ;;BGP PHARYNGITIS DXS|1|BGP
 ;;BGP HEDIS ANTIBIOTICS NDC|1|BGP
 ;;BGP HEDIS ANTIBIOTICS MEDS|0|BGP
 ;;BGP GROUP A STREP CPT|1|BGP
 ;;BGP GROUP A STREP LOINC|1|BGP
 ;;BGP HEDIS ASTHMA LEUK MEDS|0|BGP
 ;;BGP HEDIS ASTHMA LEUK NDC|1|BGP
 ;;BGP CD4 CPTS|1|BGP
 ;;BGP URI DXS|1|BGP
 ;;BGP HEDIS ASTHMA MEDS|0|BGP
 ;;BGP HEDIS ASTHMA NDC|1|BGP
 ;;BGP HEDIS PRIMARY ASTHMA MEDS|0|BGP
 ;;BGP HEDIS PRIMARY ASTHMA NDC|1|BGP
 ;;BGP HEDIS ASTHMA INHALED MEDS|0|BGP
 ;;BGP HEDIS ASTHMA INHALED NDC|1|BGP
 ;;BGP LIVER FUNCTION LOINC|1|BGP
 ;;BGP HEDIS BETA BLOCKER MEDS|0|BGP
 ;;BGP HEDIS BETA BLOCKER NDC|1|BGP
 ;;BGP RA IM GOLD MEDS|0|BGP
 ;;BGP RA IM GOLD NDC|1|BGP
 ;;BGP RA ORAL GOLD MEDS|0|BGP
 ;;BGP RA AZATHIOPRINE MEDS|0|BGP
 ;;BGP RA AZATHIOPRINE NDC|1|BGP
 ;;BGP RA LEFLUNOMIDE MEDS|0|BGP
 ;;BGP RA LEFLUNOMIDE NDC|1|BGP
 ;;BGP RA METHOTREXATE MEDS|0|BGP
 ;;BGP RA METHOTREXATE NDC|1|BGP
 ;;BGP RA CYCLOSPORINE MEDS|0|BGP
 ;;BGP RA CYCLOSPORINE NDC|1|BGP
 ;;BGP RA MYCOPHENOLATE MEDS|0|BGP
 ;;BGP RA MYCOPHENOLATE NDC|1|BGP
 ;;BGP RA PENICILLAMINE MEDS|0|BGP
 ;;BGP RA PENICILLAMINE NDC|1|BGP
 ;;BGP RA SULFASALAZINE MEDS|0|BGP
 ;;BGP RA SULFASALAZINE NDC|1|BGP
 ;;BGP ESRD CPTS|1|BGP
 ;;BGP URINE GLUCOSE LOINC|1|BGP
 ;;BGP POTASSIUM LOINC|1|BGP
 ;;BGP ST ELEVATION DX|1|BGP
 ;;BGP LBBB ON ECG CPT|1|BGP
 ;;BGP LBBB ON ECG PROC|1|BGP
 ;;BGP THROMBOLYTIC AGENT CLASS|1|BGP
 ;;BGP CMS THROMBOLYTIC MEDS|0|BGP
 ;;BGP LVAD/HEART TRANSPLANT PROC|1|BGP
 ;;BGP CMS ABG LOINC|1|BGP
 ;;BGP BLOOD CULTURE LOINC|1|BGP
 ;;
CLINICS ;
 ;;01
 ;;06
 ;;13
 ;;20
 ;;24
 ;;28
 ;;
PRVS ;
 ;;00
 ;;11
 ;;16
 ;;17
 ;;18
 ;;21
 ;;25
 ;;33
 ;;41
 ;;44
 ;;45
 ;;49
 ;;64
 ;;68
 ;;69
 ;;70
 ;;71
 ;;72
 ;;73
 ;;74
 ;;75
 ;;76
 ;;77
 ;;78
 ;;79
 ;;80
 ;;81
 ;;82
 ;;83
 ;;84
 ;;85
 ;;86
 ;;A1
 ;;
PREPROV ;;
 ;;00
 ;;08
 ;;11
 ;;16
 ;;17
 ;;18
 ;;21
 ;;24
 ;;25
 ;;30
 ;;33
 ;;41
 ;;44
 ;;45
 ;;47
 ;;49
 ;;64
 ;;67
 ;;68
 ;;70
 ;;71
 ;;72
 ;;73
 ;;74
 ;;75
 ;;76
 ;;77
 ;;78
 ;;79
 ;;80
 ;;81
 ;;82
 ;;83
 ;;85
 ;;86
 ;;A1
 ;;A9
 ;;B1
 ;;B2
 ;;B3
 ;;B4
 ;;B5
 ;;B6
 ;;
SEC ;set security on selected dd's
LP ;EP - loop through file entries
 F I=1:1 D  Q:BGPTXT["end"
 .S BGPTXT=$T(TXT+I)
 .Q:BGPTXT["end"
 .F J=2:1:4 S BGP(J)=$P(BGPTXT,";;",J)
 .S BGP(3)=""""_BGP(3)_""""
 .S BGPREF="^DIC("_BGP(2)_",0,"_BGP(3)_")"
 .S @BGPREF=BGP(4)
 Q
TXT ;file entries start here
 ;;90244.01;;AUDIT;;@
 ;;90244.01;;DD;;@
 ;;90244.01;;DEL;;@
 ;;90244.01;;LAYGO;;@
 ;;90244.01;;RD;;M
 ;;90244.01;;WR;;@
 ;;90244.02;;AUDIT;;@
 ;;90244.02;;DD;;@
 ;;90244.02;;DEL;;@
 ;;90244.02;;LAYGO;;@
 ;;90244.02;;RD;;M
 ;;90244.02;;WR;;@
 ;;90371.04;;AUDIT;;@
 ;;90371.04;;DD;;@
 ;;90371.04;;DEL;;@
 ;;90371.04;;LAYGO;;M
 ;;90371.04;;RD;;M
 ;;90371.04;;WR;;M
 ;;90372.03;;AUDIT;;@
 ;;90372.03;;DD;;@
 ;;90372.03;;DEL;;M
 ;;90372.03;;LAYGO;;M
 ;;90372.03;;RD;;M
 ;;90372.03;;WR;;M
 ;;90372.05;;AUDIT;;@
 ;;90372.05;;DD;;@
 ;;90372.05;;DEL;;M
 ;;90372.05;;LAYGO;;M
 ;;90372.05;;RD;;M
 ;;90372.05;;WR;;M
 ;;end
 Q