APCM14E3 ; IHS/CMI/LAB - IHS MU ;
;;1.0;IHS MU PERFORMANCE REPORTS;**5,6**;MAR 26, 2012;Build 65
;;;;;;Build 3
EPRES ;EP - CALCULATE EPRESCRIBING
;for each provider or for the facility count all prescriptions that meet criteria and if it is not written it meets numerator
K ^TMP($J,"PATSRX")
K APCMRXS
D TOTRX
NEW APCMP,N,F
S (APCMD1,APCMN1)=0
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.I $D(APCM100R(APCMP,APCMTIME)) S F=$P(^APCM14OB(APCMIC,0),U,11) D G D
..D S^APCM14E1(APCMRPT,APCMIC,"Provider is excluded from this measure as he/she had < 100 prescriptions issued during the EHR reporting period.",APCMP,APCMRPTT,APCMTIME,F,1)
.I $G(APCMADDQ("ANS",APCMIC,24,APCMP))="No",$G(APCMADDQ("ANS",APCMIC,25,APCMP))="No" S F=$P(^APCM14OB(APCMIC,0),U,11) D
..D S^APCM14E1(APCMRPT,APCMIC,"Provider may be eligible for an exclusion on this measure as they not have an onsite pharmacy and do not have a pharmacy within 10 miles accepting electronic prescriptions.",APCMP,APCMRPTT,APCMTIME,F,1)
D .;set denominator value into field
.S F=$P(^APCM14OB(APCMIC,0),U,8) ;denom field for this measure
.S N=$P($G(APCMRXS(APCMP)),U,1) ;returns # of prescriptions^# not written by nature of order
.D S^APCM14E1(APCMRPT,APCMIC,N,APCMP,APCMRPTT,APCMTIME,F)
.;now set patient list for this provider
.S P=0 F S P=$O(^TMP($J,"PATSRX",APCMP,P)) Q:P'=+P D
..;Q:'$P(^TMP($J,"PATSRX",APCMP,P),U,1)
..I $P(^TMP($J,"PATSRX",APCMP,P),U,1)=$P(^TMP($J,"PATSRX",APCMP,P),U,2) S APCMVALU="# Prescriptions: "_$P(^TMP($J,"PATSRX",APCMP,P),U,1)_"|||"_" # transmitted electronically: "_+$P(^TMP($J,"PATSRX",APCMP,P),U,2)_"|||1" D Q
...S DFN=P D SETLIST^APCM14E1 Q
..S S="",APCMVALU="Not transmitted electronically: "
..F S S=$O(^TMP($J,"PATSRX",APCMP,P,"SCRIPTS",S)) Q:S="" D
...I '$D(^TMP($J,"PATSRX",APCMP,P,"ELEC",S)) D
....S APCMVALU=APCMVALU_S_";"
..S DFN=P,APCMVALU="# of Prescriptions: "_$P(^TMP($J,"PATSRX",APCMP,P),U,1)_" # transmitted electronically: "_+$P(^TMP($J,"PATSRX",APCMP,P),U,2)_"|||"_APCMVALU,$P(APCMVALU,"|||",3)=0 D SETLIST^APCM14E1
.;numerator?
.S F=$P(^APCM14OB(APCMIC,0),U,9)
.S N=$P($G(APCMRXS(APCMP)),U,2)
.D S^APCM14E1(APCMRPT,APCMIC,N,APCMP,APCMRPTT,APCMTIME,F)
K ^TMP($J,"PATSRX")
Q
TOTRX ;EP - did patient have a RX in file 52 with an issue date
;between BD and ED
;SET ARRAY APCMRXS to APCMRXS(prov ien)=denom^numer
NEW ID,C,Y,X,D,S,N,A,B,R,PAT,G
S C=0,N=0
S ID=$$FMADD^XLFDT(APCMBDAT,-1)
F S ID=$O(^PSRX("AC",ID)) Q:ID'=+ID!(ID>APCMEDAT) D
.S X=0 F S X=$O(^PSRX("AC",ID,X)) Q:X'=+X D
..S R=$P($G(^PSRX(X,0)),U,4)
..Q:'R
..;I '$D(APCMPRV(R)) Q ;not a provider of interest
..I '$D(APCMRXS(R)) S APCMRXS(R)=""
..Q:$$GET1^DIQ(52,X,9999999.28)="YES" ;MUST NOT BE A DISCHARGE MED
..Q:$P($G(^PSRX(X,"STA")),"^")=13
..S D=$P(^PSRX(X,0),U,6)
..S S=$P($G(^PSDRUG(D,0)),U,3)
..Q:S[5
..Q:S[4
..Q:S[3
..Q:S[2
..Q:S[1
..S S=$P($G(^PSRX(X,3)),U,7)
..Q:$$UP^XLFSTR(S)["ADMINISTERED IN CLINIC"
..S PAT=$P(^PSRX(X,0),U,2)
..;quit if demo patient
..Q:$$DEMO^APCLUTL(PAT,$G(APCMDEMO))
..S $P(APCMRXS(R),U,1)=$P(APCMRXS(R),U,1)+1,$P(^TMP($J,"PATSRX",R,PAT),U,1)=$P($G(^TMP($J,"PATSRX",R,PAT)),U,1)+1,^TMP($J,"PATSRX",R,PAT,"SCRIPTS",$P(^PSRX(X,0),U,1))=""
..;
..;now check to see if it has a nature of order not equal to 1-written
..S G=0
..I $E($P(^PSRX(X,0),U,1))?1N D
...S O=$P($G(^PSRX(X,"OR1")),U,2) ;order number
...Q:O=""
...S B=$P($G(^OR(100,O,0)),U,6)
...Q:B=""
...S A=0,G=0 F S A=$O(^OR(100,O,8,A)) Q:A'=+A!(G) D
....S B=$P($G(^OR(100,O,8,A,0)),U,12)
....Q:B=1
....Q:B=""
....S G=1
...S $P(APCMRXS(R),U,2)=$P(APCMRXS(R),U,2)+G,$P(^TMP($J,"PATSRX",R,PAT),U,2)=$P($G(^TMP($J,"PATSRX",R,PAT)),U,2)+G I G S ^TMP($J,"PATSRX",R,PAT,"ELEC",$P(^PSRX(X,0),U,1))="" ;S N=N+G
..S B=0 I $E($P(^PSRX(X,0),U,1))="X" D
...S A=0 F S A=$O(^PSRX(X,"A",A)) Q:A'=+A!(B) D
....I $P(^PSRX(X,"A",A,0),U,5)["E-Prescribe" S B=1
....I $P(^PSRX(X,"A",A,0),U,5)["eRx" S B=1
...S $P(APCMRXS(R),U,2)=$P(APCMRXS(R),U,2)+B,$P(^TMP($J,"PATSRX",R,PAT),U,2)=$P($G(^TMP($J,"PATSRX",R,PAT)),U,2)+B I B S ^TMP($J,"PATSRX",R,PAT,"ELEC",$P(^PSRX(X,0),U,1))=""
Q
DDA ;EP - CALCULATE DRUG INTERACTION CHECK MEASURE
S F=$P(^APCM14OB(APCMIC,0),U,8)
;PER Chris Saddler check whole system for each provider
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.002.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.002.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
Q
CDS ;EP - CALCULATE CDA MEASURE
S F=$P(^APCM14OB(APCMIC,0),U,8)
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.010.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.009.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
Q
EKC ;EP - CALCULATE EKC MEASURE
S F=$P(^APCM14OB(APCMIC,0),U,8)
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.013.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.012.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
Q
PS ;EP - CALCULATE PS MEASURE
S F=$P(^APCM14OB(APCMIC,0),U,8)
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.014.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.013.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
Q
CQM ;EP - CALCULATE CQM MEASURE
NEW APCMV
S F=$P(^APCM14OB(APCMIC,0),U,8)
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.S APCMEP=$$INSTALLD("BGP*11.0*2")
.I APCMEP="Yes",APCMATTE("S1.015.EP",APCMP)="Yes" S APCMV="Yes"
.E S APCMV="No"
.D S^APCM14E1(APCMRPT,APCMIC,APCMV,APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.S APCMEP=$$INSTALLD("BGP*11.0*3")
.I APCMEP="Yes",APCMATTE("S1.014.H",APCMP)="Yes" S APCMV="Yes"
.E S APCMV="No"
.D S^APCM14E1(APCMRPT,APCMIC,APCMV,APCMP,APCMRPTT,APCMTIME,F) Q
Q
DFC ;EP - CALCULATE DFC MEASURE
;always a yes
S F=$P(^APCM14OB(APCMIC,0),U,8)
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.I $D(APCM100R(APCMP,APCMTIME)) S F=$P(^APCM14OB(APCMIC,0),U,11) D S^APCM14E1(APCMRPT,APCMIC,"Provider is excluded from this measure as he/she had < 100 prescriptions issued during the EHR reporting period.",APCMP,APCMRPTT,APCMTIME,F,1)
.S F=$P(^APCM14OB(APCMIC,0),U,8) D S^APCM14E1(APCMRPT,APCMIC,"Yes",APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.S F=$P(^APCM14OB(APCMIC,0),U,8) D S^APCM14E1(APCMRPT,APCMIC,"Yes",APCMP,APCMRPTT,APCMTIME,F) Q
Q
PL ;EP - CALCULATE EKC MEASURE
S F=$P(^APCM14OB(APCMIC,0),U,8)
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.018.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.018.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
Q
IR ;EP - CALCULATE IMM REG OBJECTIVE
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.I APCMATTE("S1.024.EP",APCMP)="N/A" S F=$P(^APCM14OB(APCMIC,0),U,11) D Q
..D S^APCM14E1(APCMRPT,APCMIC,"Provider is excluded from this measure as he/she has no registry to send immunizations to.",APCMP,APCMRPTT,APCMTIME,F,1)
.I $D(APCMIMME(APCMP,APCMTIME)) S F=$P(^APCM14OB(APCMIC,0),U,11) D Q
..D S^APCM14E1(APCMRPT,APCMIC,"Provider is excluded from this measure as he/she had no visits with an immunization administered during the EHR reporting period.",APCMP,APCMRPTT,APCMTIME,F,1)
.S F=$P(^APCM14OB(APCMIC,0),U,8) D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.024.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.I APCMATTE("S1.022.H",APCMP)="N/A" S F=$P(^APCM14OB(APCMIC,0),U,11) D
..D S^APCM14E1(APCMRPT,APCMIC,"Facility is excluded from this measure as it has no registry to send immunizatons to.",APCMP,APCMRPTT,APCMTIME,F,1)
.I $D(APCMIMME(APCMP,APCMTIME)) S F=$P(^APCM14OB(APCMIC,0),U,11) D
..D S^APCM14E1(APCMRPT,APCMIC,"Facility is excluded from this measure it had no visits with an immunization administered during the EHR reporting period.",APCMP,APCMRPTT,APCMTIME,F,1)
.S F=$P(^APCM14OB(APCMIC,0),U,8) D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.022.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
Q
SS ;EP - SYNDROMIC SURV
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.I APCMATTE("S1.025.EP",APCMP)="N/A" S F=$P(^APCM14OB(APCMIC,0),U,11) D
..D S^APCM14E1(APCMRPT,APCMIC,"Provider is excluded from this measure as he/she has no registry to send syndromic surveillance data to.",APCMP,APCMRPTT,APCMTIME,F,1)
.S F=$P(^APCM14OB(APCMIC,0),U,8)
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.025.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.I APCMATTE("S1.024.H",APCMP)="N/A" S F=$P(^APCM14OB(APCMIC,0),U,11) D
..D S^APCM14E1(APCMRPT,APCMIC,"Hospital/CAH is excluded from this measure as it has no registry to send syndromic surveillance data to.",APCMP,APCMRPTT,APCMTIME,F,1)
.S F=$P(^APCM14OB(APCMIC,0),U,8)
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.024.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
Q
SLR ;EP - CALCULATE CDA MEASURE
S F=$P(^APCM14OB(APCMIC,0),U,8)
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.010.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.I APCMATTE("S1.023.H",APCMP)="N/A" S F=$P(^APCM14OB(APCMIC,0),U,11) D
..D S^APCM14E1(APCMRPT,APCMIC,"Hospital/CAH is excluded from this measure as it has no Public Health Agency to send lab results to.",APCMP,APCMRPTT,APCMTIME,F,1)
.S F=$P(^APCM14OB(APCMIC,0),U,8)
.D S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.023.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
Q
INSTALLD(APCMSTAL) ;EP - Determine if patch APCMSTAL was installed, where
; APCLSTAL is the name of the INSTALL. E.g "AG*6.0*11".
;
NEW APCMY,DIC,X,Y
S X=$P(APCMSTAL,"*",1)
S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
D IX^DIC
I Y<1 Q 0
S DIC=DIC_+Y_",22,",X=$P(APCMSTAL,"*",2)
D ^DIC
I Y<1 Q 0
S DIC=DIC_+Y_",""PAH"",",X=$P(APCMSTAL,"*",3)
D ^DIC
S APCMY=Y
Q $S(APCMY<1:"No",1:"Yes")
OCPARA() ;EP
NEW VALUE,X,Y,Z,ORK
S VALUE=""
S (X,Y,Z)=""
;first check ORK SYSTEM ENABLE/DISABLE to see that it is Enabled
S X=$$GET^XPAR("SYS","ORK SYSTEM ENABLE/DISABLE")
I X'="E" Q "No^ORK SYSTEM ENABLE/DISABLE NOT ENABLED FOR SYSTEM" ;SYSTEM IS NOT CONFIGURED SO MEASURE NOT MET
;check for "DIV"
S X=$$GET^XPAR("DIV","ORK SYSTEM ENABLE/DISABLE")
I X="D" Q "No^ORK SYSTEM ENABLE/DISABLE SET TO DISABLED FOR DIVISION"
;now check system for ORK EDITABLE BY USER for the 9 items
F Z=1:1:9 S Y=$T(PAR9+Z) S O=$P(Y,";;",2) S X=$$GET^XPAR("SYS","ORK EDITABLE BY USER",O,"E") I X'="NO" S VALUE=VALUE_"ORK EDITABLE BY USER NOT SET TO NO FOR SYSTEM FOR "_O_" ;"
;now check division for ORK EDITABLE BY USER for the 9 items, it can't say "Y"
F Z=1:1:9 S Y=$T(PAR9+Z) S O=$P(Y,";;",2) S X=$$GET^XPAR("DIV","ORK EDITABLE BY USER",O,"E") I X="YES" S VALUE=VALUE_"ORK EDITABLE BY USER SET TO YES FOR DIVISION FOR "_O_" ;"
;now check ORK PROCESSING FLAG for system for the 9 items
F Z=1:1:9 S Y=$T(PAR9+Z) S O=$P(Y,";;",2) S X=$$GET^XPAR("SYS","ORK PROCESSING FLAG",O) I X'="E" S VALUE=VALUE_"ORK PROCESSING FLAG NOT ENABLED FOR SYSTEM FOR "_O_" ;"
;now loop through the parameter file for ORK processing flag, look for an instance of one of the 9, make sure it is set to NO
PAR1 ;
S Y=$O(^XTV(8989.51,"B","ORK PROCESSING FLAG",0))
I 'Y S VALUE=VALUE_"MISSING ORK PROCESSING FLAG PARAMETER" G PAR2
S X=0 F S X=$O(^XTV(8989.5,X)) Q:X'=+X D
.Q:'$D(^XTV(8989.5,X,0))
.Q:$P(^XTV(8989.5,X,0),U,2)'=Y ;not ork PROCESSING FLAG
.Q:$P(^XTV(8989.5,X,0),U)["DIC(9.4" ;not an entity we want ;IHS/OIT/CLS 02/08/2014
.;Q:'$$INST($P(^XTV(8989.5,X,0),U,3)) ;not an instance we want
.Q:'$$INST($$VAL^XBDIQ1(100.8,$P(^XTV(8989.5,X,0),U,3),.01)) ;IHS/OIT/CLS 02/08/2014 per Lori
.;I $E($P($G(^XTV(8989.5,X,1)),U,1))'="E" S VALUE=VALUE_"ORK PROCESSING FLAG NOT ENABLED FOR "_$P(^XTV(8989.5,X,0),U,3)_" FOR "_$$VAL^XBDIQ1(8989.5,X,.01)_"; "
.I $E($P($G(^XTV(8989.5,X,1)),U,1))'="E" S VALUE=VALUE_"ORK PROCESSING FLAG NOT ENABLED FOR "_($$VAL^XBDIQ1(100.8,$P(^XTV(8989.5,X,0),U,3),.01))_" FOR "_$$VAL^XBDIQ1(8989.5,X,.01)_"; " ;IHS/OIT/CLS 02/08/2014 per Lori
.Q
PAR2 ;
I VALUE]"" Q "No^"_VALUE
Q "Yes"
INST(I) ;
I $G(I)="" Q 0
I I="ESTIMATED CREATININE CLEARANCE" Q 1
I I="ALLERGY-DRUG INTERACTION" Q 1
I I="ALLERGY-CONTRAST MEDIA INTERACTION" Q 1
I I="CRITICAL DRUG INTERACTION" Q 1
I I="RENAL FUNCTIONS OVER AGE 65" Q 1
I I="GLUCOPHAGE-CONTRAST MEDIA" Q 1
I I="GLUCOPHAGE-LAB RESULTS" Q 1
I I="DANGEROUS MEDS FOR PT > 64" Q 1
I I="NO ALLERGY ASSESSMENT" Q 1
I I="ALLERGY UNASSESSIBLE" Q 1
Q 0
PAR9 ;;
;;ESTIMATED CREATININE CLEARANCE
;;ALLERGY-DRUG INTERACTION
;;ALLERGY-CONTRAST MEDIA INTERACTION
;;CRITICAL DRUG INTERACTION
;;RENAL FUNCTIONS OVER AGE 65
;;GLUCOPHAGE-CONTRAST MEDIA
;;GLUCOPHAGE-LAB RESULTS
;;DANGEROUS MEDS FOR PT > 64
;;NO ALLERGY ASSESSMENT
;;ALLERGY UNASSESSIBLE
;;
APCM14E3 ; IHS/CMI/LAB - IHS MU ;
+1 ;;1.0;IHS MU PERFORMANCE REPORTS;**5,6**;MAR 26, 2012;Build 65
+2 ;;;;;;Build 3
EPRES ;EP - CALCULATE EPRESCRIBING
+1 ;for each provider or for the facility count all prescriptions that meet criteria and if it is not written it meets numerator
+2 KILL ^TMP($JOB,"PATSRX")
+3 KILL APCMRXS
+4 DO TOTRX
+5 NEW APCMP,N,F
+6 SET (APCMD1,APCMN1)=0
+7 IF APCMRPTT=1
SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
Begin DoDot:1
+8 IF $DATA(APCM100R(APCMP,APCMTIME))
SET F=$PIECE(^APCM14OB(APCMIC,0),U,11)
Begin DoDot:2
+9 DO S^APCM14E1(APCMRPT,APCMIC,"Provider is excluded from this measure as he/she had < 100 prescriptions issued during the EHR reporting period.",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
GOTO D
+10 IF $GET(APCMADDQ("ANS",APCMIC,24,APCMP))="No"
IF $GET(APCMADDQ("ANS",APCMIC,25,APCMP))="No"
SET F=$PIECE(^APCM14OB(APCMIC,0),U,11)
Begin DoDot:2
+11 DO S^APCM14E1(APCMRPT,APCMIC,"Provider may be eligible for an exclusion on this measure as they not have an onsite pharmacy and do not have a pharmacy within 10 miles accepting electronic prescriptions.",APCMP,APCMRPTT,A
PCMTIME,F,1)
End DoDot:2
D ;set denominator value into field
+1 ;denom field for this measure
SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
+2 ;returns # of prescriptions^# not written by nature of order
SET N=$PIECE($GET(APCMRXS(APCMP)),U,1)
+3 DO S^APCM14E1(APCMRPT,APCMIC,N,APCMP,APCMRPTT,APCMTIME,F)
+4 ;now set patient list for this provider
+5 SET P=0
FOR
SET P=$ORDER(^TMP($JOB,"PATSRX",APCMP,P))
IF P'=+P
QUIT
Begin DoDot:2
+6 ;Q:'$P(^TMP($J,"PATSRX",APCMP,P),U,1)
+7 IF $PIECE(^TMP($JOB,"PATSRX",APCMP,P),U,1)=$PIECE(^TMP($JOB,"PATSRX",APCMP,P),U,2)
SET APCMVALU="# Prescriptions: "_$PIECE(^TMP($JOB,"PATSRX",APCMP,P),U,1)_"|||"_" # transmitted electronically: "_+$PIECE(^TMP($JOB,"PATSRX",APCMP,P),U,2)_"|||1"
Begin DoDot:3
+8 SET DFN=P
DO SETLIST^APCM14E1
QUIT
End DoDot:3
QUIT
+9 SET S=""
SET APCMVALU="Not transmitted electronically: "
+10 FOR
SET S=$ORDER(^TMP($JOB,"PATSRX",APCMP,P,"SCRIPTS",S))
IF S=""
QUIT
Begin DoDot:3
+11 IF '$DATA(^TMP($JOB,"PATSRX",APCMP,P,"ELEC",S))
Begin DoDot:4
+12 SET APCMVALU=APCMVALU_S_";"
End DoDot:4
End DoDot:3
+13 SET DFN=P
SET APCMVALU="# of Prescriptions: "_$PIECE(^TMP($JOB,"PATSRX",APCMP,P),U,1)_" # transmitted electronically: "_+$PIECE(^TMP($JOB,"PATSRX",APCMP,P),U,2)_"|||"_APCMVALU
SET $PIECE(APCMVALU,"|||",3)=0
DO SETLIST^APCM14E1
End DoDot:2
+14 ;numerator?
+15 SET F=$PIECE(^APCM14OB(APCMIC,0),U,9)
+16 SET N=$PIECE($GET(APCMRXS(APCMP)),U,2)
+17 DO S^APCM14E1(APCMRPT,APCMIC,N,APCMP,APCMRPTT,APCMTIME,F)
End DoDot:1
+18 KILL ^TMP($JOB,"PATSRX")
+19 QUIT
TOTRX ;EP - did patient have a RX in file 52 with an issue date
+1 ;between BD and ED
+2 ;SET ARRAY APCMRXS to APCMRXS(prov ien)=denom^numer
+3 NEW ID,C,Y,X,D,S,N,A,B,R,PAT,G
+4 SET C=0
SET N=0
+5 SET ID=$$FMADD^XLFDT(APCMBDAT,-1)
+6 FOR
SET ID=$ORDER(^PSRX("AC",ID))
IF ID'=+ID!(ID>APCMEDAT)
QUIT
Begin DoDot:1
+7 SET X=0
FOR
SET X=$ORDER(^PSRX("AC",ID,X))
IF X'=+X
QUIT
Begin DoDot:2
+8 SET R=$PIECE($GET(^PSRX(X,0)),U,4)
+9 IF 'R
QUIT
+10 ;I '$D(APCMPRV(R)) Q ;not a provider of interest
+11 IF '$DATA(APCMRXS(R))
SET APCMRXS(R)=""
+12 ;MUST NOT BE A DISCHARGE MED
IF $$GET1^DIQ(52,X,9999999.28)="YES"
QUIT
+13 IF $PIECE($GET(^PSRX(X,"STA")),"^")=13
QUIT
+14 SET D=$PIECE(^PSRX(X,0),U,6)
+15 SET S=$PIECE($GET(^PSDRUG(D,0)),U,3)
+16 IF S[5
QUIT
+17 IF S[4
QUIT
+18 IF S[3
QUIT
+19 IF S[2
QUIT
+20 IF S[1
QUIT
+21 SET S=$PIECE($GET(^PSRX(X,3)),U,7)
+22 IF $$UP^XLFSTR(S)["ADMINISTERED IN CLINIC"
QUIT
+23 SET PAT=$PIECE(^PSRX(X,0),U,2)
+24 ;quit if demo patient
+25 IF $$DEMO^APCLUTL(PAT,$GET(APCMDEMO))
QUIT
+26 SET $PIECE(APCMRXS(R),U,1)=$PIECE(APCMRXS(R),U,1)+1
SET $PIECE(^TMP($JOB,"PATSRX",R,PAT),U,1)=$PIECE($GET(^TMP($JOB,"PATSRX",R,PAT)),U,1)+1
SET ^TMP($JOB,"PATSRX",R,PAT,"SCRIPTS",$PIECE(^PSRX(X,0),U,1))=""
+27 ;
+28 ;now check to see if it has a nature of order not equal to 1-written
+29 SET G=0
+30 IF $EXTRACT($PIECE(^PSRX(X,0),U,1))?1N
Begin DoDot:3
+31 ;order number
SET O=$PIECE($GET(^PSRX(X,"OR1")),U,2)
+32 IF O=""
QUIT
+33 SET B=$PIECE($GET(^OR(100,O,0)),U,6)
+34 IF B=""
QUIT
+35 SET A=0
SET G=0
FOR
SET A=$ORDER(^OR(100,O,8,A))
IF A'=+A!(G)
QUIT
Begin DoDot:4
+36 SET B=$PIECE($GET(^OR(100,O,8,A,0)),U,12)
+37 IF B=1
QUIT
+38 IF B=""
QUIT
+39 SET G=1
End DoDot:4
+40 ;S N=N+G
SET $PIECE(APCMRXS(R),U,2)=$PIECE(APCMRXS(R),U,2)+G
SET $PIECE(^TMP($JOB,"PATSRX",R,PAT),U,2)=$PIECE($GET(^TMP($JOB,"PATSRX",R,PAT)),U,2)+G
IF G
SET ^TMP($JOB,"PATSRX",R,PAT,"ELEC",$PIECE(^PSRX(X,0),U,1))=""
End DoDot:3
+41 SET B=0
IF $EXTRACT($PIECE(^PSRX(X,0),U,1))="X"
Begin DoDot:3
+42 SET A=0
FOR
SET A=$ORDER(^PSRX(X,"A",A))
IF A'=+A!(B)
QUIT
Begin DoDot:4
+43 IF $PIECE(^PSRX(X,"A",A,0),U,5)["E-Prescribe"
SET B=1
+44 IF $PIECE(^PSRX(X,"A",A,0),U,5)["eRx"
SET B=1
End DoDot:4
+45 SET $PIECE(APCMRXS(R),U,2)=$PIECE(APCMRXS(R),U,2)+B
SET $PIECE(^TMP($JOB,"PATSRX",R,PAT),U,2)=$PIECE($GET(^TMP($JOB,"PATSRX",R,PAT)),U,2)+B
IF B
SET ^TMP($JOB,"PATSRX",R,PAT,"ELEC",$PIECE(^PSRX(X,0),U,1))=""
End DoDot:3
End DoDot:2
End DoDot:1
+46 QUIT
DDA ;EP - CALCULATE DRUG INTERACTION CHECK MEASURE
+1 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
+2 ;PER Chris Saddler check whole system for each provider
+3 IF APCMRPTT=1
SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
Begin DoDot:1
+4 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.002.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+5 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+6 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.002.H",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+7 QUIT
CDS ;EP - CALCULATE CDA MEASURE
+1 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
+2 IF APCMRPTT=1
SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
Begin DoDot:1
+3 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.010.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+4 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+5 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.009.H",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+6 QUIT
EKC ;EP - CALCULATE EKC MEASURE
+1 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
+2 IF APCMRPTT=1
SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
Begin DoDot:1
+3 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.013.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+4 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+5 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.012.H",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+6 QUIT
PS ;EP - CALCULATE PS MEASURE
+1 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
+2 IF APCMRPTT=1
SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
Begin DoDot:1
+3 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.014.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+4 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+5 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.013.H",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+6 QUIT
CQM ;EP - CALCULATE CQM MEASURE
+1 NEW APCMV
+2 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
+3 IF APCMRPTT=1
SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
Begin DoDot:1
+4 SET APCMEP=$$INSTALLD("BGP*11.0*2")
+5 IF APCMEP="Yes"
IF APCMATTE("S1.015.EP",APCMP)="Yes"
SET APCMV="Yes"
+6 IF '$TEST
SET APCMV="No"
+7 DO S^APCM14E1(APCMRPT,APCMIC,APCMV,APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+8 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+9 SET APCMEP=$$INSTALLD("BGP*11.0*3")
+10 IF APCMEP="Yes"
IF APCMATTE("S1.014.H",APCMP)="Yes"
SET APCMV="Yes"
+11 IF '$TEST
SET APCMV="No"
+12 DO S^APCM14E1(APCMRPT,APCMIC,APCMV,APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+13 QUIT
DFC ;EP - CALCULATE DFC MEASURE
+1 ;always a yes
+2 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
+3 IF APCMRPTT=1
SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
Begin DoDot:1
+4 IF $DATA(APCM100R(APCMP,APCMTIME))
SET F=$PIECE(^APCM14OB(APCMIC,0),U,11)
DO S^APCM14E1(APCMRPT,APCMIC,"Provider is excluded from this measure as he/she had < 100 prescriptions issued during the EHR reporting period.",APCMP,APCMRPTT,APCMTIME,F,1)
+5 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
DO S^APCM14E1(APCMRPT,APCMIC,"Yes",APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+6 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+7 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
DO S^APCM14E1(APCMRPT,APCMIC,"Yes",APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+8 QUIT
PL ;EP - CALCULATE EKC MEASURE
+1 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
+2 IF APCMRPTT=1
SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
Begin DoDot:1
+3 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.018.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+4 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+5 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.018.H",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+6 QUIT
IR ;EP - CALCULATE IMM REG OBJECTIVE
+1 IF APCMRPTT=1
SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
Begin DoDot:1
+2 IF APCMATTE("S1.024.EP",APCMP)="N/A"
SET F=$PIECE(^APCM14OB(APCMIC,0),U,11)
Begin DoDot:2
+3 DO S^APCM14E1(APCMRPT,APCMIC,"Provider is excluded from this measure as he/she has no registry to send immunizations to.",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
QUIT
+4 IF $DATA(APCMIMME(APCMP,APCMTIME))
SET F=$PIECE(^APCM14OB(APCMIC,0),U,11)
Begin DoDot:2
+5 DO S^APCM14E1(APCMRPT,APCMIC,"Provider is excluded from this measure as he/she had no visits with an immunization administered during the EHR reporting period.",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
QUIT
+6 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.024.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+7 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+8 IF APCMATTE("S1.022.H",APCMP)="N/A"
SET F=$PIECE(^APCM14OB(APCMIC,0),U,11)
Begin DoDot:2
+9 DO S^APCM14E1(APCMRPT,APCMIC,"Facility is excluded from this measure as it has no registry to send immunizatons to.",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
+10 IF $DATA(APCMIMME(APCMP,APCMTIME))
SET F=$PIECE(^APCM14OB(APCMIC,0),U,11)
Begin DoDot:2
+11 DO S^APCM14E1(APCMRPT,APCMIC,"Facility is excluded from this measure it had no visits with an immunization administered during the EHR reporting period.",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
+12 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.022.H",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+13 QUIT
SS ;EP - SYNDROMIC SURV
+1 IF APCMRPTT=1
SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
Begin DoDot:1
+2 IF APCMATTE("S1.025.EP",APCMP)="N/A"
SET F=$PIECE(^APCM14OB(APCMIC,0),U,11)
Begin DoDot:2
+3 DO S^APCM14E1(APCMRPT,APCMIC,"Provider is excluded from this measure as he/she has no registry to send syndromic surveillance data to.",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
+4 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
+5 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.025.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+6 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+7 IF APCMATTE("S1.024.H",APCMP)="N/A"
SET F=$PIECE(^APCM14OB(APCMIC,0),U,11)
Begin DoDot:2
+8 DO S^APCM14E1(APCMRPT,APCMIC,"Hospital/CAH is excluded from this measure as it has no registry to send syndromic surveillance data to.",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
+9 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
+10 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.024.H",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+11 QUIT
SLR ;EP - CALCULATE CDA MEASURE
+1 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
+2 IF APCMRPTT=1
SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
Begin DoDot:1
+3 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.010.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+4 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+5 IF APCMATTE("S1.023.H",APCMP)="N/A"
SET F=$PIECE(^APCM14OB(APCMIC,0),U,11)
Begin DoDot:2
+6 DO S^APCM14E1(APCMRPT,APCMIC,"Hospital/CAH is excluded from this measure as it has no Public Health Agency to send lab results to.",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
+7 SET F=$PIECE(^APCM14OB(APCMIC,0),U,8)
+8 DO S^APCM14E1(APCMRPT,APCMIC,APCMATTE("S1.023.H",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+9 QUIT
INSTALLD(APCMSTAL) ;EP - Determine if patch APCMSTAL was installed, where
+1 ; APCLSTAL is the name of the INSTALL. E.g "AG*6.0*11".
+2 ;
+3 NEW APCMY,DIC,X,Y
+4 SET X=$PIECE(APCMSTAL,"*",1)
+5 SET DIC="^DIC(9.4,"
SET DIC(0)="FM"
SET D="C"
+6 DO IX^DIC
+7 IF Y<1
QUIT 0
+8 SET DIC=DIC_+Y_",22,"
SET X=$PIECE(APCMSTAL,"*",2)
+9 DO ^DIC
+10 IF Y<1
QUIT 0
+11 SET DIC=DIC_+Y_",""PAH"","
SET X=$PIECE(APCMSTAL,"*",3)
+12 DO ^DIC
+13 SET APCMY=Y
+14 QUIT $SELECT(APCMY<1:"No",1:"Yes")
OCPARA() ;EP
+1 NEW VALUE,X,Y,Z,ORK
+2 SET VALUE=""
+3 SET (X,Y,Z)=""
+4 ;first check ORK SYSTEM ENABLE/DISABLE to see that it is Enabled
+5 SET X=$$GET^XPAR("SYS","ORK SYSTEM ENABLE/DISABLE")
+6 ;SYSTEM IS NOT CONFIGURED SO MEASURE NOT MET
IF X'="E"
QUIT "No^ORK SYSTEM ENABLE/DISABLE NOT ENABLED FOR SYSTEM"
+7 ;check for "DIV"
+8 SET X=$$GET^XPAR("DIV","ORK SYSTEM ENABLE/DISABLE")
+9 IF X="D"
QUIT "No^ORK SYSTEM ENABLE/DISABLE SET TO DISABLED FOR DIVISION"
+10 ;now check system for ORK EDITABLE BY USER for the 9 items
+11 FOR Z=1:1:9
SET Y=$TEXT(PAR9+Z)
SET O=$PIECE(Y,";;",2)
SET X=$$GET^XPAR("SYS","ORK EDITABLE BY USER",O,"E")
IF X'="NO"
SET VALUE=VALUE_"ORK EDITABLE BY USER NOT SET TO NO FOR SYSTEM FOR "_O_" ;"
+12 ;now check division for ORK EDITABLE BY USER for the 9 items, it can't say "Y"
+13 FOR Z=1:1:9
SET Y=$TEXT(PAR9+Z)
SET O=$PIECE(Y,";;",2)
SET X=$$GET^XPAR("DIV","ORK EDITABLE BY USER",O,"E")
IF X="YES"
SET VALUE=VALUE_"ORK EDITABLE BY USER SET TO YES FOR DIVISION FOR "_O_" ;"
+14 ;now check ORK PROCESSING FLAG for system for the 9 items
+15 FOR Z=1:1:9
SET Y=$TEXT(PAR9+Z)
SET O=$PIECE(Y,";;",2)
SET X=$$GET^XPAR("SYS","ORK PROCESSING FLAG",O)
IF X'="E"
SET VALUE=VALUE_"ORK PROCESSING FLAG NOT ENABLED FOR SYSTEM FOR "_O_" ;"
+16 ;now loop through the parameter file for ORK processing flag, look for an instance of one of the 9, make sure it is set to NO
PAR1 ;
+1 SET Y=$ORDER(^XTV(8989.51,"B","ORK PROCESSING FLAG",0))
+2 IF 'Y
SET VALUE=VALUE_"MISSING ORK PROCESSING FLAG PARAMETER"
GOTO PAR2
+3 SET X=0
FOR
SET X=$ORDER(^XTV(8989.5,X))
IF X'=+X
QUIT
Begin DoDot:1
+4 IF '$DATA(^XTV(8989.5,X,0))
QUIT
+5 ;not ork PROCESSING FLAG
IF $PIECE(^XTV(8989.5,X,0),U,2)'=Y
QUIT
+6 ;not an entity we want ;IHS/OIT/CLS 02/08/2014
IF $PIECE(^XTV(8989.5,X,0),U)["DIC(9.4"
QUIT
+7 ;Q:'$$INST($P(^XTV(8989.5,X,0),U,3)) ;not an instance we want
+8 ;IHS/OIT/CLS 02/08/2014 per Lori
IF '$$INST($$VAL^XBDIQ1(100.8,$PIECE(^XTV(8989.5,X,0),U,3),.01))
QUIT
+9 ;I $E($P($G(^XTV(8989.5,X,1)),U,1))'="E" S VALUE=VALUE_"ORK PROCESSING FLAG NOT ENABLED FOR "_$P(^XTV(8989.5,X,0),U,3)_" FOR "_$$VAL^XBDIQ1(8989.5,X,.01)_"; "
+10 ;IHS/OIT/CLS 02/08/2014 per Lori
IF $EXTRACT($PIECE($GET(^XTV(8989.5,X,1)),U,1))'="E"
SET VALUE=VALUE_"ORK PROCESSING FLAG NOT ENABLED FOR "_($$VAL^XBDIQ1(100.8,$PIECE(^XTV(8989.5,X,0),U,3),.01))_" FOR "_$$VAL^XBDIQ1(8989.5,X,.01)_"; "
+11 QUIT
End DoDot:1
PAR2 ;
+1 IF VALUE]""
QUIT "No^"_VALUE
+2 QUIT "Yes"
INST(I) ;
+1 IF $GET(I)=""
QUIT 0
+2 IF I="ESTIMATED CREATININE CLEARANCE"
QUIT 1
+3 IF I="ALLERGY-DRUG INTERACTION"
QUIT 1
+4 IF I="ALLERGY-CONTRAST MEDIA INTERACTION"
QUIT 1
+5 IF I="CRITICAL DRUG INTERACTION"
QUIT 1
+6 IF I="RENAL FUNCTIONS OVER AGE 65"
QUIT 1
+7 IF I="GLUCOPHAGE-CONTRAST MEDIA"
QUIT 1
+8 IF I="GLUCOPHAGE-LAB RESULTS"
QUIT 1
+9 IF I="DANGEROUS MEDS FOR PT > 64"
QUIT 1
+10 IF I="NO ALLERGY ASSESSMENT"
QUIT 1
+11 IF I="ALLERGY UNASSESSIBLE"
QUIT 1
+12 QUIT 0
PAR9 ;;
+1 ;;ESTIMATED CREATININE CLEARANCE
+2 ;;ALLERGY-DRUG INTERACTION
+3 ;;ALLERGY-CONTRAST MEDIA INTERACTION
+4 ;;CRITICAL DRUG INTERACTION
+5 ;;RENAL FUNCTIONS OVER AGE 65
+6 ;;GLUCOPHAGE-CONTRAST MEDIA
+7 ;;GLUCOPHAGE-LAB RESULTS
+8 ;;DANGEROUS MEDS FOR PT > 64
+9 ;;NO ALLERGY ASSESSMENT
+10 ;;ALLERGY UNASSESSIBLE
+11 ;;