APCM24E3 ; IHS/CMI/LAB - IHS MU ;
;;1.0;IHS MU PERFORMANCE REPORTS;**5,6**;MAR 26, 2012;Build 65
;;;;;;Build 3
DDA ;EP - CALCULATE DRUG INTERACTION CHECK MEASURE
S F=$P(^APCM24OB(APCMIC,0),U,8)
;PER Chris Saddler check whole system for each provider
I APCMRPTT=1 D Q
.S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
..;S APCMEP=$$OCPARA()
..;CHECK MU DATE
..NEW Y,A S A="",Y=$P($G(^APCCCTRL(DUZ(2),"MU")),U,1) ;MU CLEAN DATE
..I Y="" S A="No" G DDA1
..I Y<APCMBDAT S A="Yes" G DDA1
..I Y'<APCMBDAT S A="No"
DDA1 ..;
..D S^APCM24E1(APCMRPT,APCMIC,A,APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.;S APCMEP=$$OCPARA()
.;CHECK MU DATE
.NEW Y,A S A="",Y=$P($G(^APCCCTRL(DUZ(2),"MU")),U,1) ;MU CLEAN DATE
.I Y="" S A="No" G DDA2
.I Y<APCMBDAT S A="Yes" G DDA2
.S A="No"
DDA2 .;
.D S^APCM24E1(APCMRPT,APCMIC,A,APCMP,APCMRPTT,APCMTIME,F) Q
Q
CDS ;EP - CALCULATE CDA MEASURE
S F=$P(^APCM24OB(APCMIC,0),U,8)
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.S I=$P(^APCM24OB(APCMIC,0),U,1)
.S F=$P(^APCM24OB(APCMIC,0),U,8)
.D S^APCM24E1(APCMRPT,APCMIC,APCMATTE(I,APCMP),APCMP,APCMRPTT,APCMTIME,F)
.Q:$P(^APCM24OB(APCMIC,0),U,1)="S2.010.EP.1"
.I $D(APCM100R(APCMP,APCMTIME)) S G=$P(^APCM24OB(APCMIC,0),U,11) D S^APCM24E1(APCMRPT,APCMIC,"<100",APCMP,APCMRPTT,APCMTIME,G,1)
I APCMRPTT=2 S APCMP=APCMFAC D
.S I=$P(^APCM24OB(APCMIC,0),U,1)
.S F=$P(^APCM24OB(APCMIC,0),U,8)
.D S^APCM24E1(APCMRPT,APCMIC,APCMATTE(I,APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
.;Q:$P(^APCM24OB(APCMIC,0),U,1)="S2.010.H.1"
.;I $D(APCM100R(APCMP,APCMTIME)) S G=$P(^APCM24OB(APCMIC,0),U,11) D S^APCM24E1(APCMRPT,APCMIC,"<100",APCMP,APCMRPTT,APCMTIME,G,1)
Q
EKC ;EP - CALCULATE EKC MEASURE
S F=$P(^APCM24OB(APCMIC,0),U,8)
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.D S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.013.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.D S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.012.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
Q
PS ;EP - CALCULATE PS MEASURE
S F=$P(^APCM24OB(APCMIC,0),U,8)
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.S A=$P(APCMATTE("S2.014.EP",APCMP),U,1),B=$P(APCMATTE("S2.014.EP",APCMP),U,2)
.S V="No"
.I A="Yes",B="Yes" S V="Yes"
.D S^APCM24E1(APCMRPT,APCMIC,V,APCMP,APCMRPTT,APCMTIME,F)
I APCMRPTT=2 S APCMP=APCMFAC D
.S A=$P(APCMATTE("S2.013.H",APCMP),U,1),B=$P(APCMATTE("S2.013.H",APCMP),U,2)
.S V="No"
.I A="Yes",B="Yes" S V="Yes"
.D S^APCM24E1(APCMRPT,APCMIC,V,APCMP,APCMRPTT,APCMTIME,F) Q
Q
CQM ;EP - CALCULATE CQM MEASURE
NEW APCMV
S F=$P(^APCM24OB(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("S2.015.EP",APCMP)="Yes" S APCMV="Yes"
.E S APCMV="No"
.D S^APCM24E1(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("S2.014.H",APCMP)="Yes" S APCMV="Yes"
.E S APCMV="No"
.D S^APCM24E1(APCMRPT,APCMIC,APCMV,APCMP,APCMRPTT,APCMTIME,F) Q
Q
DFC ;EP - CALCULATE DFC MEASURE
;always a yes
S F=$P(^APCM24OB(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(^APCM24OB(APCMIC,0),U,11) D S^APCM24E1(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(^APCM24OB(APCMIC,0),U,8) D S^APCM24E1(APCMRPT,APCMIC,"Yes",APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.S F=$P(^APCM24OB(APCMIC,0),U,8) D S^APCM24E1(APCMRPT,APCMIC,"Yes",APCMP,APCMRPTT,APCMTIME,F) Q
Q
PL ;EP - CALCULATE EKC MEASURE
S F=$P(^APCM24OB(APCMIC,0),U,8)
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.D S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.018.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.D S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.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("S2.024.EP",APCMP)="N/A" S F=$P(^APCM24OB(APCMIC,0),U,11) D Q
..D S^APCM24E1(APCMRPT,APCMIC,"NO REG",APCMP,APCMRPTT,APCMTIME,F,1)
.I $D(APCMIMME(APCMP,APCMTIME)) S F=$P(^APCM24OB(APCMIC,0),U,11) D Q
..D S^APCM24E1(APCMRPT,APCMIC,"NO IMM",APCMP,APCMRPTT,APCMTIME,F,1)
.S F=$P(^APCM24OB(APCMIC,0),U,8) D S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.024.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.I APCMATTE("S2.022.H",APCMP)="N/A" S F=$P(^APCM24OB(APCMIC,0),U,11) D
..D S^APCM24E1(APCMRPT,APCMIC,"NO REG",APCMP,APCMRPTT,APCMTIME,F,1)
.I $D(APCMIMME(APCMP,APCMTIME)) S F=$P(^APCM24OB(APCMIC,0),U,11) D
..D S^APCM24E1(APCMRPT,APCMIC,"NO IMM",APCMP,APCMRPTT,APCMTIME,F,1)
.S F=$P(^APCM24OB(APCMIC,0),U,8) D S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.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("S2.025.EP",APCMP)="N/A" S F=$P(^APCM24OB(APCMIC,0),U,11) D
..D S^APCM24E1(APCMRPT,APCMIC,"NO REG",APCMP,APCMRPTT,APCMTIME,F,1)
.S F=$P(^APCM24OB(APCMIC,0),U,8)
.D S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.025.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.I APCMATTE("S2.024.H",APCMP)="N/A" S F=$P(^APCM24OB(APCMIC,0),U,11) D
..D S^APCM24E1(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(^APCM24OB(APCMIC,0),U,8)
.D S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.024.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
Q
SR ;EP - SPEC REG
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.I APCMATTE("S2.030.EP",APCMP)="N/A" S F=$P(^APCM24OB(APCMIC,0),U,11) D
..D S^APCM24E1(APCMRPT,APCMIC,"NO REG",APCMP,APCMRPTT,APCMTIME,F,1)
.S F=$P(^APCM24OB(APCMIC,0),U,8)
.D S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.030.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.I APCMATTE("S2.024.H",APCMP)="N/A" S F=$P(^APCM24OB(APCMIC,0),U,11) D
..D S^APCM24E1(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(^APCM24OB(APCMIC,0),U,8)
.D S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.024.H",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
Q
SLR ;EP - CALCULATE CDA MEASURE
S F=$P(^APCM24OB(APCMIC,0),U,8)
I APCMRPTT=1 S APCMP=0 F S APCMP=$O(APCMPRV(APCMP)) Q:APCMP'=+APCMP D
.D S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.010.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F) Q
I APCMRPTT=2 S APCMP=APCMFAC D
.I APCMATTE("S2.023.H",APCMP)="N/A" S F=$P(^APCM24OB(APCMIC,0),U,11) D
..D S^APCM24E1(APCMRPT,APCMIC,"NO PLACE TO SEND esults to.",APCMP,APCMRPTT,APCMTIME,F,1)
.S F=$P(^APCM24OB(APCMIC,0),U,8)
.D S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.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
;;
APCM24E3 ; IHS/CMI/LAB - IHS MU ;
+1 ;;1.0;IHS MU PERFORMANCE REPORTS;**5,6**;MAR 26, 2012;Build 65
+2 ;;;;;;Build 3
DDA ;EP - CALCULATE DRUG INTERACTION CHECK MEASURE
+1 SET F=$PIECE(^APCM24OB(APCMIC,0),U,8)
+2 ;PER Chris Saddler check whole system for each provider
+3 IF APCMRPTT=1
Begin DoDot:1
+4 SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
Begin DoDot:2
+5 ;S APCMEP=$$OCPARA()
+6 ;CHECK MU DATE
+7 ;MU CLEAN DATE
NEW Y,A
SET A=""
SET Y=$PIECE($GET(^APCCCTRL(DUZ(2),"MU")),U,1)
+8 IF Y=""
SET A="No"
GOTO DDA1
+9 IF Y<APCMBDAT
SET A="Yes"
GOTO DDA1
+10 IF Y'<APCMBDAT
SET A="No"
DDA1 ;
+1 DO S^APCM24E1(APCMRPT,APCMIC,A,APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:2
End DoDot:1
QUIT
+2 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+3 ;S APCMEP=$$OCPARA()
+4 ;CHECK MU DATE
+5 ;MU CLEAN DATE
NEW Y,A
SET A=""
SET Y=$PIECE($GET(^APCCCTRL(DUZ(2),"MU")),U,1)
+6 IF Y=""
SET A="No"
GOTO DDA2
+7 IF Y<APCMBDAT
SET A="Yes"
GOTO DDA2
+8 SET A="No"
DDA2 ;
+1 DO S^APCM24E1(APCMRPT,APCMIC,A,APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+2 QUIT
CDS ;EP - CALCULATE CDA MEASURE
+1 SET F=$PIECE(^APCM24OB(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 SET I=$PIECE(^APCM24OB(APCMIC,0),U,1)
+4 SET F=$PIECE(^APCM24OB(APCMIC,0),U,8)
+5 DO S^APCM24E1(APCMRPT,APCMIC,APCMATTE(I,APCMP),APCMP,APCMRPTT,APCMTIME,F)
+6 IF $PIECE(^APCM24OB(APCMIC,0),U,1)="S2.010.EP.1"
QUIT
+7 IF $DATA(APCM100R(APCMP,APCMTIME))
SET G=$PIECE(^APCM24OB(APCMIC,0),U,11)
DO S^APCM24E1(APCMRPT,APCMIC,"<100",APCMP,APCMRPTT,APCMTIME,G,1)
End DoDot:1
+8 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+9 SET I=$PIECE(^APCM24OB(APCMIC,0),U,1)
+10 SET F=$PIECE(^APCM24OB(APCMIC,0),U,8)
+11 DO S^APCM24E1(APCMRPT,APCMIC,APCMATTE(I,APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
+12 ;Q:$P(^APCM24OB(APCMIC,0),U,1)="S2.010.H.1"
+13 ;I $D(APCM100R(APCMP,APCMTIME)) S G=$P(^APCM24OB(APCMIC,0),U,11) D S^APCM24E1(APCMRPT,APCMIC,"<100",APCMP,APCMRPTT,APCMTIME,G,1)
End DoDot:1
+14 QUIT
EKC ;EP - CALCULATE EKC MEASURE
+1 SET F=$PIECE(^APCM24OB(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^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.013.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+4 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+5 DO S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.012.H",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+6 QUIT
PS ;EP - CALCULATE PS MEASURE
+1 SET F=$PIECE(^APCM24OB(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 SET A=$PIECE(APCMATTE("S2.014.EP",APCMP),U,1)
SET B=$PIECE(APCMATTE("S2.014.EP",APCMP),U,2)
+4 SET V="No"
+5 IF A="Yes"
IF B="Yes"
SET V="Yes"
+6 DO S^APCM24E1(APCMRPT,APCMIC,V,APCMP,APCMRPTT,APCMTIME,F)
End DoDot:1
+7 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+8 SET A=$PIECE(APCMATTE("S2.013.H",APCMP),U,1)
SET B=$PIECE(APCMATTE("S2.013.H",APCMP),U,2)
+9 SET V="No"
+10 IF A="Yes"
IF B="Yes"
SET V="Yes"
+11 DO S^APCM24E1(APCMRPT,APCMIC,V,APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+12 QUIT
CQM ;EP - CALCULATE CQM MEASURE
+1 NEW APCMV
+2 SET F=$PIECE(^APCM24OB(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("S2.015.EP",APCMP)="Yes"
SET APCMV="Yes"
+6 IF '$TEST
SET APCMV="No"
+7 DO S^APCM24E1(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("S2.014.H",APCMP)="Yes"
SET APCMV="Yes"
+11 IF '$TEST
SET APCMV="No"
+12 DO S^APCM24E1(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(^APCM24OB(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(^APCM24OB(APCMIC,0),U,11)
DO S^APCM24E1(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(^APCM24OB(APCMIC,0),U,8)
DO S^APCM24E1(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(^APCM24OB(APCMIC,0),U,8)
DO S^APCM24E1(APCMRPT,APCMIC,"Yes",APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+8 QUIT
PL ;EP - CALCULATE EKC MEASURE
+1 SET F=$PIECE(^APCM24OB(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^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.018.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+4 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+5 DO S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.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("S2.024.EP",APCMP)="N/A"
SET F=$PIECE(^APCM24OB(APCMIC,0),U,11)
Begin DoDot:2
+3 DO S^APCM24E1(APCMRPT,APCMIC,"NO REG",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
QUIT
+4 IF $DATA(APCMIMME(APCMP,APCMTIME))
SET F=$PIECE(^APCM24OB(APCMIC,0),U,11)
Begin DoDot:2
+5 DO S^APCM24E1(APCMRPT,APCMIC,"NO IMM",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
QUIT
+6 SET F=$PIECE(^APCM24OB(APCMIC,0),U,8)
DO S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.024.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+7 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+8 IF APCMATTE("S2.022.H",APCMP)="N/A"
SET F=$PIECE(^APCM24OB(APCMIC,0),U,11)
Begin DoDot:2
+9 DO S^APCM24E1(APCMRPT,APCMIC,"NO REG",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
+10 IF $DATA(APCMIMME(APCMP,APCMTIME))
SET F=$PIECE(^APCM24OB(APCMIC,0),U,11)
Begin DoDot:2
+11 DO S^APCM24E1(APCMRPT,APCMIC,"NO IMM",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
+12 SET F=$PIECE(^APCM24OB(APCMIC,0),U,8)
DO S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.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("S2.025.EP",APCMP)="N/A"
SET F=$PIECE(^APCM24OB(APCMIC,0),U,11)
Begin DoDot:2
+3 DO S^APCM24E1(APCMRPT,APCMIC,"NO REG",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
+4 SET F=$PIECE(^APCM24OB(APCMIC,0),U,8)
+5 DO S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.025.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+6 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+7 IF APCMATTE("S2.024.H",APCMP)="N/A"
SET F=$PIECE(^APCM24OB(APCMIC,0),U,11)
Begin DoDot:2
+8 DO S^APCM24E1(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(^APCM24OB(APCMIC,0),U,8)
+10 DO S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.024.H",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+11 QUIT
SR ;EP - SPEC REG
+1 IF APCMRPTT=1
SET APCMP=0
FOR
SET APCMP=$ORDER(APCMPRV(APCMP))
IF APCMP'=+APCMP
QUIT
Begin DoDot:1
+2 IF APCMATTE("S2.030.EP",APCMP)="N/A"
SET F=$PIECE(^APCM24OB(APCMIC,0),U,11)
Begin DoDot:2
+3 DO S^APCM24E1(APCMRPT,APCMIC,"NO REG",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
+4 SET F=$PIECE(^APCM24OB(APCMIC,0),U,8)
+5 DO S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.030.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+6 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+7 IF APCMATTE("S2.024.H",APCMP)="N/A"
SET F=$PIECE(^APCM24OB(APCMIC,0),U,11)
Begin DoDot:2
+8 DO S^APCM24E1(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(^APCM24OB(APCMIC,0),U,8)
+10 DO S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.024.H",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+11 QUIT
SLR ;EP - CALCULATE CDA MEASURE
+1 SET F=$PIECE(^APCM24OB(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^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.010.EP",APCMP),APCMP,APCMRPTT,APCMTIME,F)
QUIT
End DoDot:1
+4 IF APCMRPTT=2
SET APCMP=APCMFAC
Begin DoDot:1
+5 IF APCMATTE("S2.023.H",APCMP)="N/A"
SET F=$PIECE(^APCM24OB(APCMIC,0),U,11)
Begin DoDot:2
+6 DO S^APCM24E1(APCMRPT,APCMIC,"NO PLACE TO SEND esults to.",APCMP,APCMRPTT,APCMTIME,F,1)
End DoDot:2
+7 SET F=$PIECE(^APCM24OB(APCMIC,0),U,8)
+8 DO S^APCM24E1(APCMRPT,APCMIC,APCMATTE("S2.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 ;;