APCM2AER ;IHS/CMI/LAB - IHS MU REPORT;
;;1.0;MU PERFORMANCE REPORTS;**7,8**;MAR 26, 2012;Build 22
;
;
CALC(N,O) ;ENTRY POINT
NEW Z
S Z=N-O,Z=$FN(Z,"+,",1)
Q Z
;
SB(X) ;EP - Strip
NEW %
X ^DD("FUNC",$O(^DD("FUNC","B","STRIPBLANKS",0)),1)
Q X
;
C(X,X2,X3) ;
S X3=""
I X'?.N Q $$LBLK^APCLUTL(X,7)
D COMMA^%DTC
S X=$$STRIP^XLFSTR(X," ")
Q $$LBLK^APCLUTL(X,7)
;
CTR(X,Y) ;EP - Center X in a field Y wide.
Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
;----------
EOP ;EP - End of page.
Q:$E(IOST)'="C"
Q:$D(ZTQUEUED)!'(IOT="TRM")!$D(IO("S"))
NEW DIR
K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
S DIR(0)="E" D ^DIR
Q
;----------
USR() ;EP - Return name .
Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
;
SETN ;EP - set numerator fields
S APCMCYN=$$V(1,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT) ;SPDX
Q:$P(^APCM25OB(M,0),U,6)="A" ;no % on attestation measures
S APCMCYP=$S(APCMCYD:((APCMCYN/APCMCYD)*100),1:"")
Q
;
V(T,R,N,P,PROV,K,RT) ;EP ;SPDX
NEW X,Y,Z,I,J
I RT=1 S I=PROV_";VA(200,"
I RT=2 S I=PROV_";AUTTLOC("
I T=1 D Q X
.S J=$O(^APCMM25C(R,11,"B",I,0))
.I 'J S X=0 Q
.S X=$P($G(^APCMM25C(R,11,J,N)),U,P)
Q ""
SUM ;EP - summary sheet
K APCMTOT
K APCMPROV
S APCMGPG=0
S APCMQUIT=""
S X=0 F S X=$O(APCMPRV(X)) Q:X'=+X S APCMPROV($P(^VA(200,X,0),U),X)=""
S APCMPNAM="" F S APCMPNAM=$O(APCMPROV(APCMPNAM)) Q:APCMPNAM=""!(APCMQUIT) D
.S APCMPROV=0 F S APCMPROV=$O(APCMPROV(APCMPNAM,APCMPROV)) Q:APCMPROV=""!(APCMQUIT) D SUM1,W^APCM2AEH(" ",0,0,APCMPTYP) D
..D W^APCM2AEH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP)
..D W^APCM2AEH("+ Indicates Yes/No Attestation Measure. The Yes or No displayed in the",0,1,APCMPTYP)
..D W^APCM2AEH(" Current Rate Column is based on user input when generating the report.",0,1,APCMPTYP)
..;D W^APCM2AEH("@ Secure Messaging 2016 and 2017 logic requires additional development",0,1,APCMPTYP)
..;D W^APCM2AEH(" and will be released in a future patch; zeros will display in the interim.",0,1,APCMPTYP)
Q
;
SUM1 ;
K APCMINDO
S X=0 F S X=$O(APCMIND(X)) Q:X'=+X D
.S C="A"
.S O=$P(^APCM25OB(X,0),U,10)
.I O="" Q ;not on summary sheet
.S APCMINDO(C,O,X)=""
S APCMCM="" I APCMPTYP="P" D SUMH
I APCMPTYP="D" D
.D W^APCM2AEH("Indian Health Service RPMS Suite (BCER) v2.0",0,2,APCMPTYP)
.S X="MODIFIED STAGE 2 "_$S(APCMRPTT=1:"EP ",1:"HOSPITAL ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY" D W^APCM2AEH(X,0,1,APCMPTYP)
.S X="Summary Report for "_APCMPNAM D W^APCM2AEH(X,0,2,APCMPTYP)
.S X="Performance Measure^Target^Current Rate^Num^Den^Excl Met^Alt Met" D W^APCM2AEH(X,0,2,APCMPTYP)
S APCMCM="" F S APCMCM=$O(APCMINDO(APCMCM)) Q:APCMCM=""!(APCMQUIT) D
.I APCMCM="M" D ; W^APCM2AEH("MENU SET MEASURES",0,2,APCMPTYP)
..I APCMPTYP="P" D SUMH
..I APCMPTYP="D" D
.S APCMMO=0 F S APCMMO=$O(APCMINDO(APCMCM,APCMMO)) Q:APCMMO=""!(APCMQUIT) D
..S APCMIC=0 F S APCMIC=$O(APCMINDO(APCMCM,APCMMO,APCMIC)) Q:APCMIC=""!(APCMQUIT) D SUM2
D W^APCM2AEH(" ",0,1,APCMPTYP)
Q
SUM2 ;
I APCMPTYP="P",APCMGPG=0 D SUMH Q:APCMQUIT
I APCMPTYP="P",$Y>(APCMIOSL-4) D SUMH Q:APCMQUIT
;WRITE EACH MEASURE
W ;
I $E(APCMPER,1,3)=316 D W^APCM2AE6 Q
I $P(^APCM25OB(APCMIC,0),U,1)="S2.014.EP" D PHI Q ;protect
I $P(^APCM25OB(APCMIC,0),U,1)="S2.010.EP" D CDS Q
I $P(^APCM25OB(APCMIC,0),U,1)="S2.001.EP" D CPOEM Q
I $P(^APCM25OB(APCMIC,0),U,1)="S2.001.1EP" D CPOEL Q
I $P(^APCM25OB(APCMIC,0),U,1)="S2.001.2EP" D CPOER Q
I $P(^APCM25OB(APCMIC,0),U,1)="S2.003.EP" D EPRES Q
I $P(^APCM25OB(APCMIC,0),U,1)="S2.023.EP" D SC Q
I $P(^APCM25OB(APCMIC,0),U,1)="S2.021.EP" D PTED Q
I $P(^APCM25OB(APCMIC,0),U,1)="S2.022.EP" D MEDREC^APCM2AEA Q
I $P(^APCM25OB(APCMIC,0),U,1)="S2.020.EP" D PEA^APCM2AEA Q
I $P(^APCM25OB(APCMIC,0),U,1)="S2.026.EP" D SEM^APCM2AEA Q
I $P(^APCM25OB(APCMIC,0),U,1)="S2.024.EP" D IMM^APCM2AEA Q
I $P(^APCM25OB(APCMIC,0),U,1)="S2.025.EP" D SYN^APCM2AEA Q
I $P(^APCM25OB(APCMIC,0),U,1)="S2.030.EP" D SR^APCM2AEA Q
;
Q
SUMH ;
G:'APCMGPG SUMH1
K DIR I $E(IOST)="C",IO=IO(0),'$D(ZTQUEUED) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCMQUIT=1 Q
;
SUMH1 ;
I APCMPTYP="P" W:$D(IOF) @IOF S APCMGPG=APCMGPG+1
I APCMPTYP="P" S X=$P(^VA(200,DUZ,0),U,2),$E(X,35)=$$FMTE^XLFDT(DT),$E(X,70)="Page "_APCMGPG D W^APCM2AEH(X,0,1,APCMPTYP)
D W^APCM2AEH("Indian Health Service RPMS Suite (BCER) v2.0",1,2,APCMPTYP)
I $G(APCMPROV),APCMRPTT=1 S X="Provider Name: "_$$SN^APCM2AEH($P(^VA(200,APCMPROV,0),U,1)) D W^APCM2AEH(X,1,1,APCMPTYP)
I APCMRPTT=2 S X="Method: "_$S(APCMMETH="E":"All Emergency Department",1:"Observation") D W^APCM2AEH(X,1,1,APCMPTYP)
I $G(APCMPROV),APCMRPTT=2 S X="Facility: "_$P(^DIC(4,APCMPROV,0),U,1) D W^APCM2AEH(X,1,1,APCMPTYP)
S X="Report Period: "_$$FMTE^XLFDT(APCMBD)_" to "_$$FMTE^XLFDT(APCMED) D W^APCM2AEH(X,1,1,APCMPTYP)
S X=$$REPEAT^XLFSTR("-",80) D W^APCM2AEH(X,0,1,APCMPTYP)
D W^APCM2AEH("MODIFIED STAGE 2 "_$S(APCMRPTT=1:"EP ",1:"EH ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY",1,1,APCMPTYP)
S X=$$REPEAT^XLFSTR("-",80) D W^APCM2AEH(X,0,1,APCMPTYP)
S X="",$E(X,44)="Current",$E(X,72)="Excl",$E(X,77)="Alt" D W^APCM2AEH(X,0,1,APCMPTYP)
S X="",X="Performance Measures",$E(X,35)="Target",$E(X,44)="Rate",$E(X,56)="Num",$E(X,66)="Den",$E(X,72)="Met",$E(X,77)="Met" D W^APCM2AEH(X,0,1,APCMPTYP)
D W^APCM2AEH($$REPEAT^XLFSTR("-",80),0,1,APCMPTYP)
Q
SETND ;
S APCMDF=$P(^APCM25OB(M,0),U,8)
S APCMNP=$P(^DD(9001304.0311,APCMDF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
S APCMCYD=$$V(1,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT)
I $P(^APCM25OB(M,0),U,6)="A" S (APCMPRN,APCMCYN)="" Q
S APCMNF=$P(^APCM25OB(M,0),U,9) ;numerator field
S APCMNP=$P(^DD(9001304.0311,APCMNF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
D SETN
Q
PHI ;
I APCMPTYP="P" D Q
.D W^APCM2AEH(" 1. Protect e-Health Info+",0,2,APCMPTYP)
.;TARGET
.S T=$S($E(APCMPER,1,3)=315:1,$E(APCMPER,1,3)=316:2,$E(APCMPER,1,3)=317:3,1:1)
.D W^APCM2AEH($P($G(^APCM25OB(APCMIC,12)),U,T),0,0,APCMPTYP,,35)
.;RATE
.S M=APCMIC
.D SETND
.D WRATE
.;NUM/DEN
.D WNUMDEN
.;EXCL
.D W^APCM2AEH("N/A",0,0,APCMPTYP,,71)
.;ALT EXCL
.D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
I APCMPTYP="D" D
.S APCMX=$P(^APCM25OB(APCMIC,0),U,14)_$S($P(^APCM25OB(APCMIC,0),U,6)="A":"+",1:"")
.;TARGET
.S T=$S($E(APCMPER,1,3)=315:1,$E(APCMPER,1,3)=316:2,$E(APCMPER,1,3)=317:3,1:1)
.S $P(APCMX,U,2)=$P($G(^APCM25OB(APCMIC,12)),U,T)
.;RATE
.S M=APCMIC
.D SETND
.D WRATE
.;NUM/DEN
.D WNUMDEN
.;EXCL
.S $P(APCMX,U,6)="N/A"
.S $P(APCMX,U,7)="N/A"
.D W^APCM25EH(APCMX,0,2,APCMPTYP,1)
Q
CDS ;
I APCMPTYP="P" D Q
.D W^APCM2AEH(" 2. Clin Decision Support+",0,2,APCMPTYP)
.F X=1,2 D
..S M=$O(^APCM25OB("B","S2.010.EP.1",0))
..I X=1 D W^APCM2AEH(" Imp 1 CDS 2015+",0,1,APCMPTYP)
..I X=2 D W^APCM2AEH(" Imp 5 CDS 2016+",0,1,APCMPTYP)
..;TARGET
..S T=$S($E(APCMPER,1,3)=315:1,$E(APCMPER,1,3)=316:2,$E(APCMPER,1,3)=317:3,1:1)
..D W^APCM2AEH($P($G(^APCM25OB(M,12)),U,T),0,0,APCMPTYP,,35)
..;RATE
..D SETND
..D WRATE
..;NUM/DEN
..D WNUMDEN
..;EXCL
..D W^APCM2AEH("N/A",0,0,APCMPTYP,,71)
..;ALT EXCL
..D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
.D W^APCM2AEH(" Drug Interaction Check+",0,1,APCMPTYP)
.;TARGET
.S M=$O(^APCM25OB("B","S2.010.EP.2",0))
.S T=$S($E(APCMPER,1,3)=315:1,$E(APCMPER,1,3)=316:2,$E(APCMPER,1,3)=317:3,1:1)
.D W^APCM2AEH($P($G(^APCM25OB(M,12)),U,T),0,0,APCMPTYP,,35)
.;RATE
.D SETND
.D WRATE
.;NUM/DEN
.D WNUMDEN
.;EXCL
.D WEXCL
.;ALT EXCL
.D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
I APCMPTYP="D" D
.S APCMX="Clin Decision Support+" D W^APCM25EH(APCMX,0,2,APCMPTYP,1)
.F X=1,2 D
..S M=$O(^APCM25OB("B","S2.010.EP.1",0))
..I X=1 S APCMX=" Imp 1 CDS 2015+"
..I X=2 S APCMX=" Imp 5 CDS 2016+"
..;TARGET
..S T=$S($E(APCMPER,1,3)=315:1,$E(APCMPER,1,3)=316:2,$E(APCMPER,1,3)=317:3,1:1)
..S $P(APCMX,U,2)=$P($G(^APCM25OB(M,12)),U,T)
..;RATE
..D SETND
..D WRATE
..;NUM/DEN
..D WNUMDEN
..;EXCL
..S $P(APCMX,U,6)="N/A"
..S $P(APCMX,U,7)="N/A"
..D W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
.S APCMX=" Drug Interaction Check+"
.;TARGET
.S M=$O(^APCM25OB("B","S2.010.EP.2",0))
.S T=$S($E(APCMPER,1,3)=315:1,$E(APCMPER,1,3)=316:2,$E(APCMPER,1,3)=317:3,1:1)
.S $P(APCMX,U,2)=$P($G(^APCM25OB(M,12)),U,T)
.;RATE
.D SETND
.D WRATE
.;NUM/DEN
.D WNUMDEN
.;EXCL
.D WEXCL
.;ALT EXCL
.S $P(APCMX,U,7)="N/A"
.D W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
Q
CPOEM ;
I APCMPTYP="P" D
.F X=1,2 D
..S M=APCMIC
..I X=1 D W^APCM2AEH(" 3. CPOE Medications 2015",0,2,APCMPTYP)
..I X=2 D W^APCM2AEH(" CPOE Medications 2016",0,1,APCMPTYP)
..;TARGET
..S T=$S(X=1:">30%",1:">60%")
..D W^APCM2AEH(T,0,0,APCMPTYP,,35)
..;RATE
..D SETND
..D WRATE
..;NUM/DEN
..D WNUMDEN
..;EXCL
..D WEXCL
..;ALT EXCL
..D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
I APCMPTYP="D" D
.F X=1,2 D
..S M=APCMIC
..I X=1 S APCMX="CPOE Medications 2015"
..I X=2 S APCMX=" CPOE Medications 2016"
..;TARGET
..S T=$S(X=1:">30%",1:">60%")
..S $P(APCMX,U,2)=T
..;RATE
..D SETND
..D WRATE
..;NUM/DEN
..D WNUMDEN
..;EXCL
..D WEXCL
..;ALT EXCL
..S $P(APCMX,U,7)="N/A"
..I X=2 D W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
..I X=1 D W^APCM2AEH(APCMX,0,2,APCMPTYP,1)
Q
CPOEL ;
I APCMPTYP="P" D
.S M=APCMIC
.D W^APCM2AEH(" CPOE Laboratory",0,1,APCMPTYP)
.;TARGET
.S T=">30%"
.D W^APCM2AEH(T,0,0,APCMPTYP,,35)
.;RATE
.D SETND
.D WRATE
.;NUM/DEN
.D WNUMDEN
.;EXCL
.D WEXCL
.;ALT EXCL
.S I=$P(^APCM25OB(APCMIC,0),U,1)
.D W^APCM2AEH($G(APCMATTE(I,APCMPROV)),0,0,APCMPTYP,,77)
I APCMPTYP="D" D
.S M=APCMIC
.S APCMX=" CPOE Laboratory"
.;TARGET
.S T=">30%"
.S $P(APCMX,U,2)=T
.;RATE
.D SETND
.D WRATE
.;NUM/DEN
.D WNUMDEN
.;EXCL
.D WEXCL
.;ALT EXCL
.S I=$P(^APCM25OB(APCMIC,0),U,1)
.S $P(APCMX,U,7)=$G(APCMATTE(I,APCMPROV))
.D W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
Q
CPOER ;
I APCMPTYP="P" D
.S M=APCMIC
.D W^APCM2AEH(" CPOE Radiology",0,1,APCMPTYP)
.;TARGET
.S T=">30%"
.D W^APCM2AEH(T,0,0,APCMPTYP,,35)
.;RATE
.D SETND
.D WRATE
.;NUM/DEN
.D WNUMDEN
.;EXCL
.D WEXCL
.;ALT EXCL
.S I=$P(^APCM25OB(APCMIC,0),U,1)
.D W^APCM2AEH($G(APCMATTE(I,APCMPROV)),0,0,APCMPTYP,,77)
I APCMPTYP="D" D
.S M=APCMIC
.S APCMX=" CPOE Radiology"
.;TARGET
.S T=">30%"
.S $P(APCMX,U,2)=T
.;RATE
.D SETND
.D WRATE
.;NUM/DEN
.D WNUMDEN
.;EXCL
.D WEXCL
.;ALT EXCL
.S I=$P(^APCM25OB(APCMIC,0),U,1)
.S $P(APCMX,U,7)=$G(APCMATTE(I,APCMPROV))
.D W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
Q
EPRES ;
I APCMPTYP="P" D
.F X=1,2 D
..S M=APCMIC
..I X=1 D W^APCM2AEH(" 4. e-Prescribe (e-Rx) 2015",0,2,APCMPTYP)
..I X=2 D W^APCM2AEH(" e-Prescribe (e-Rx) 2016",0,1,APCMPTYP)
..;TARGET
..S T=$S(X=1:">40%",1:">50%")
..D W^APCM2AEH(T,0,0,APCMPTYP,,35)
..;RATE
..D SETND
..D WRATE
..;NUM/DEN
..D WNUMDEN
..;EXCL
..D WEXCL
..;ALT EXCL
..D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
I APCMPTYP="D" D
.F X=1,2 D
..S M=APCMIC
..I X=1 S APCMX="e-Prescribe (e-Rx) 2015"
..I X=2 S APCMX="e-Prescribe (e-Rx) 2016"
..;TARGET
..S T=$S(X=1:">40%",1:">50%")
..S $P(APCMX,U,2)=T
..;RATE
..D SETND
..D WRATE
..;NUM/DEN
..D WNUMDEN
..;EXCL
..D WEXCL
..;ALT EXCL
..S $P(APCMX,U,7)="N/A"
..D W^APCM2AEH(APCMX,0,$S(X=1:2,1:1),APCMPTYP,1)
Q
SC ;summary of care
I APCMPTYP="P" D
.F X=1,2 D
..S M=APCMIC
..I X=1 D W^APCM2AEH(" 5. Sum of Care (HIE) 2015",0,2,APCMPTYP)
..I X=2 D W^APCM2AEH(" Sum of Care (HIE) 2016",0,1,APCMPTYP)
..;TARGET
..S T=">10%"
..D W^APCM2AEH(T,0,0,APCMPTYP,,35)
..;RATE
..D SETND
..D WRATE
..;NUM/DEN
..D WNUMDEN
..;EXCL
..D WEXCL
..;ALT EXCL
..S I=$P(^APCM25OB(APCMIC,0),U,1)
..I X=1 D W^APCM2AEH($P($G(APCMATTE(I,APCMPROV)),U,2),0,0,APCMPTYP,,77)
..I X=2 D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
I APCMPTYP="D" D
.F X=1,2 D
..S M=APCMIC
..I X=1 S APCMX="Sum of Care (HIE) 2015"
..I X=2 S APCMX="Sum of Care (HIE) 2016"
..;TARGET
..S T=">10%"
..S $P(APCMX,U,2)=T
..;RATE
..D SETND
..D WRATE
..;NUM/DEN
..D WNUMDEN
..;EXCL
..D WEXCL
..;ALT EXCL
..S I=$P(^APCM25OB(APCMIC,0),U,1)
..I X=1 S $P(APCMX,U,7)=$G(APCMATTE(I,APCMPROV))
..I X=2 S $P(APCMX,U,7)="N/A"
..I X=2 D W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
..I X=1 D W^APCM2AEH(APCMX,0,2,APCMPTYP,1)
Q
PTED ;
I APCMPTYP="P" D
.F X=1,2 D
..S M=APCMIC
..I X=1 D W^APCM2AEH(" 6. Patient Education 2015",0,2,APCMPTYP)
..I X=2 D W^APCM2AEH(" Patient Education 2016",0,1,APCMPTYP)
..;TARGET
..S T=">10%"
..D W^APCM2AEH(T,0,0,APCMPTYP,,35)
..;RATE
..D SETND
..D WRATE
..;NUM/DEN
..D WNUMDEN
..;EXCL
..D WEXCL
..;ALT EXCL
..S I=$P(^APCM25OB(APCMIC,0),U,1)
..I X=1 D W^APCM2AEH($G(APCMATTE(I,APCMPROV)),0,0,APCMPTYP,,77)
..I X=2 D W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
I APCMPTYP="D" D
.F X=1,2 D
..S M=APCMIC
..I X=1 S APCMX="Patient Education 2015"
..I X=2 S APCMX="Patient Education 2016"
..;TARGET
..S T=">10%"
..S $P(APCMX,U,2)=T
..;RATE
..D SETND
..D WRATE
..;NUM/DEN
..D WNUMDEN
..;EXCL
..D WEXCL
..;ALT EXCL
..S I=$P(^APCM25OB(APCMIC,0),U,1)
..I X=1 S $P(APCMX,U,7)=$G(APCMATTE(I,APCMPROV))
..I X=2 S $P(APCMX,U,7)="N/A"
..I X=2 D W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
..I X=1 D W^APCM2AEH(APCMX,0,2,APCMPTYP,1)
Q
WEXCL ;
S APCMEF=$P(^APCM25OB(M,0),U,11)
I APCMEF]"" D
.S APCMNP=$P(^DD(9001304.0311,APCMEF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
.S APCMEV=$$V(1,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT)
.I APCMPTYP="P" D W^APCM25EH($S(APCMEV="N/A":"N/A",APCMEV]"":"Yes",1:"No"),0,0,APCMPTYP,,71)
.I APCMPTYP="D" S $P(APCMX,U,6)=$S(APCMEV="N/A":"N/A",APCMEV]"":"Yes",1:"No")
I APCMEF="" D
.I APCMPTYP="P" D W^APCM25EH("N/A",0,0,APCMPTYP,,71)
.S $P(APCMX,U,6)="N/A"
Q
WRATE ;
I APCMPTYP="P" D Q
.I $P(^APCM25OB(M,0),U,6)="A" D W^APCM2AEH($S(APCMCYD]"":$$LBLK^APCLUTL(APCMCYD,8),1:$$LBLK^APCLUTL("N/A",8)),0,0,APCMPTYP,,40)
.I $P(^APCM25OB(M,0),U,6)'="A" D W^APCM2AEH($J(APCMCYP,8,2)_"%",0,0,APCMPTYP,,40)
I $P(^APCM25OB(M,0),U,6)="A" S $P(APCMX,U,3)=$S(APCMCYD]"":APCMCYD,1:"N/A")
I $P(^APCM25OB(M,0),U,6)'="A" S $P(APCMX,U,3)=$S($P(^APCM25OB(M,0),U,6)="A":"N/A",1:$J(APCMCYP,8,2)_"%")
Q
WNUMDEN ;
I APCMPTYP="P" D Q
.D W^APCM2AEH($S($P(^APCM25OB(M,0),U,6)="A":" N/A",APCMCYN'?.N:" N/A",1:$$C(APCMCYN,0,9)),0,0,APCMPTYP,,51)
.D W^APCM2AEH($S($P(^APCM25OB(M,0),U,6)="A":" N/A",APCMCYD'?.N:" N/A",1:$$C(APCMCYD,0,9)),0,0,APCMPTYP,,61)
S $P(APCMX,U,4)=$S($P(^APCM25OB(M,0),U,6)="A":"N/A",1:+APCMCYN)
S $P(APCMX,U,5)=$S($P(^APCM25OB(M,0),U,6)="A":"N/A",1:+APCMCYD)
Q
APCM2AER ;IHS/CMI/LAB - IHS MU REPORT;
+1 ;;1.0;MU PERFORMANCE REPORTS;**7,8**;MAR 26, 2012;Build 22
+2 ;
+3 ;
CALC(N,O) ;ENTRY POINT
+1 NEW Z
+2 SET Z=N-O
SET Z=$FNUMBER(Z,"+,",1)
+3 QUIT Z
+4 ;
SB(X) ;EP - Strip
+1 NEW %
+2 XECUTE ^DD("FUNC",$ORDER(^DD("FUNC","B","STRIPBLANKS",0)),1)
+3 QUIT X
+4 ;
C(X,X2,X3) ;
+1 SET X3=""
+2 IF X'?.N
QUIT $$LBLK^APCLUTL(X,7)
+3 DO COMMA^%DTC
+4 SET X=$$STRIP^XLFSTR(X," ")
+5 QUIT $$LBLK^APCLUTL(X,7)
+6 ;
CTR(X,Y) ;EP - Center X in a field Y wide.
+1 QUIT $JUSTIFY("",$SELECT($DATA(Y):Y,1:IOM)-$LENGTH(X)\2)_X
+2 ;----------
EOP ;EP - End of page.
+1 IF $EXTRACT(IOST)'="C"
QUIT
+2 IF $DATA(ZTQUEUED)!'(IOT="TRM")!$DATA(IO("S"))
QUIT
+3 NEW DIR
+4 KILL DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
+5 SET DIR(0)="E"
DO ^DIR
+6 QUIT
+7 ;----------
USR() ;EP - Return name .
+1 QUIT $SELECT($GET(DUZ):$SELECT($DATA(^VA(200,DUZ,0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
+2 ;
SETN ;EP - set numerator fields
+1 ;SPDX
SET APCMCYN=$$V(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+2 ;no % on attestation measures
IF $PIECE(^APCM25OB(M,0),U,6)="A"
QUIT
+3 SET APCMCYP=$SELECT(APCMCYD:((APCMCYN/APCMCYD)*100),1:"")
+4 QUIT
+5 ;
V(T,R,N,P,PROV,K,RT) ;EP ;SPDX
+1 NEW X,Y,Z,I,J
+2 IF RT=1
SET I=PROV_";VA(200,"
+3 IF RT=2
SET I=PROV_";AUTTLOC("
+4 IF T=1
Begin DoDot:1
+5 SET J=$ORDER(^APCMM25C(R,11,"B",I,0))
+6 IF 'J
SET X=0
QUIT
+7 SET X=$PIECE($GET(^APCMM25C(R,11,J,N)),U,P)
End DoDot:1
QUIT X
+8 QUIT ""
SUM ;EP - summary sheet
+1 KILL APCMTOT
+2 KILL APCMPROV
+3 SET APCMGPG=0
+4 SET APCMQUIT=""
+5 SET X=0
FOR
SET X=$ORDER(APCMPRV(X))
IF X'=+X
QUIT
SET APCMPROV($PIECE(^VA(200,X,0),U),X)=""
+6 SET APCMPNAM=""
FOR
SET APCMPNAM=$ORDER(APCMPROV(APCMPNAM))
IF APCMPNAM=""!(APCMQUIT)
QUIT
Begin DoDot:1
+7 SET APCMPROV=0
FOR
SET APCMPROV=$ORDER(APCMPROV(APCMPNAM,APCMPROV))
IF APCMPROV=""!(APCMQUIT)
QUIT
DO SUM1
DO W^APCM2AEH(" ",0,0,APCMPTYP)
Begin DoDot:2
+8 DO W^APCM2AEH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP)
+9 DO W^APCM2AEH("+ Indicates Yes/No Attestation Measure. The Yes or No displayed in the",0,1,APCMPTYP)
+10 DO W^APCM2AEH(" Current Rate Column is based on user input when generating the report.",0,1,APCMPTYP)
+11 ;D W^APCM2AEH("@ Secure Messaging 2016 and 2017 logic requires additional development",0,1,APCMPTYP)
+12 ;D W^APCM2AEH(" and will be released in a future patch; zeros will display in the interim.",0,1,APCMPTYP)
End DoDot:2
End DoDot:1
+13 QUIT
+14 ;
SUM1 ;
+1 KILL APCMINDO
+2 SET X=0
FOR
SET X=$ORDER(APCMIND(X))
IF X'=+X
QUIT
Begin DoDot:1
+3 SET C="A"
+4 SET O=$PIECE(^APCM25OB(X,0),U,10)
+5 ;not on summary sheet
IF O=""
QUIT
+6 SET APCMINDO(C,O,X)=""
End DoDot:1
+7 SET APCMCM=""
IF APCMPTYP="P"
DO SUMH
+8 IF APCMPTYP="D"
Begin DoDot:1
+9 DO W^APCM2AEH("Indian Health Service RPMS Suite (BCER) v2.0",0,2,APCMPTYP)
+10 SET X="MODIFIED STAGE 2 "_$SELECT(APCMRPTT=1:"EP ",1:"HOSPITAL ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY"
DO W^APCM2AEH(X,0,1,APCMPTYP)
+11 SET X="Summary Report for "_APCMPNAM
DO W^APCM2AEH(X,0,2,APCMPTYP)
+12 SET X="Performance Measure^Target^Current Rate^Num^Den^Excl Met^Alt Met"
DO W^APCM2AEH(X,0,2,APCMPTYP)
End DoDot:1
+13 SET APCMCM=""
FOR
SET APCMCM=$ORDER(APCMINDO(APCMCM))
IF APCMCM=""!(APCMQUIT)
QUIT
Begin DoDot:1
+14 ; W^APCM2AEH("MENU SET MEASURES",0,2,APCMPTYP)
IF APCMCM="M"
Begin DoDot:2
+15 IF APCMPTYP="P"
DO SUMH
+16 IF APCMPTYP="D"
Begin DoDot:3
End DoDot:3
End DoDot:2
+17 SET APCMMO=0
FOR
SET APCMMO=$ORDER(APCMINDO(APCMCM,APCMMO))
IF APCMMO=""!(APCMQUIT)
QUIT
Begin DoDot:2
+18 SET APCMIC=0
FOR
SET APCMIC=$ORDER(APCMINDO(APCMCM,APCMMO,APCMIC))
IF APCMIC=""!(APCMQUIT)
QUIT
DO SUM2
End DoDot:2
End DoDot:1
+19 DO W^APCM2AEH(" ",0,1,APCMPTYP)
+20 QUIT
SUM2 ;
+1 IF APCMPTYP="P"
IF APCMGPG=0
DO SUMH
IF APCMQUIT
QUIT
+2 IF APCMPTYP="P"
IF $Y>(APCMIOSL-4)
DO SUMH
IF APCMQUIT
QUIT
+3 ;WRITE EACH MEASURE
W ;
+1 IF $EXTRACT(APCMPER,1,3)=316
DO W^APCM2AE6
QUIT
+2 ;protect
IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.014.EP"
DO PHI
QUIT
+3 IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.010.EP"
DO CDS
QUIT
+4 IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.001.EP"
DO CPOEM
QUIT
+5 IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.001.1EP"
DO CPOEL
QUIT
+6 IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.001.2EP"
DO CPOER
QUIT
+7 IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.003.EP"
DO EPRES
QUIT
+8 IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.023.EP"
DO SC
QUIT
+9 IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.021.EP"
DO PTED
QUIT
+10 IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.022.EP"
DO MEDREC^APCM2AEA
QUIT
+11 IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.020.EP"
DO PEA^APCM2AEA
QUIT
+12 IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.026.EP"
DO SEM^APCM2AEA
QUIT
+13 IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.024.EP"
DO IMM^APCM2AEA
QUIT
+14 IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.025.EP"
DO SYN^APCM2AEA
QUIT
+15 IF $PIECE(^APCM25OB(APCMIC,0),U,1)="S2.030.EP"
DO SR^APCM2AEA
QUIT
+16 ;
+17 QUIT
SUMH ;
+1 IF 'APCMGPG
GOTO SUMH1
+2 KILL DIR
IF $EXTRACT(IOST)="C"
IF IO=IO(0)
IF '$DATA(ZTQUEUED)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET APCMQUIT=1
QUIT
+3 ;
SUMH1 ;
+1 IF APCMPTYP="P"
IF $DATA(IOF)
WRITE @IOF
SET APCMGPG=APCMGPG+1
+2 IF APCMPTYP="P"
SET X=$PIECE(^VA(200,DUZ,0),U,2)
SET $EXTRACT(X,35)=$$FMTE^XLFDT(DT)
SET $EXTRACT(X,70)="Page "_APCMGPG
DO W^APCM2AEH(X,0,1,APCMPTYP)
+3 DO W^APCM2AEH("Indian Health Service RPMS Suite (BCER) v2.0",1,2,APCMPTYP)
+4 IF $GET(APCMPROV)
IF APCMRPTT=1
SET X="Provider Name: "_$$SN^APCM2AEH($PIECE(^VA(200,APCMPROV,0),U,1))
DO W^APCM2AEH(X,1,1,APCMPTYP)
+5 IF APCMRPTT=2
SET X="Method: "_$SELECT(APCMMETH="E":"All Emergency Department",1:"Observation")
DO W^APCM2AEH(X,1,1,APCMPTYP)
+6 IF $GET(APCMPROV)
IF APCMRPTT=2
SET X="Facility: "_$PIECE(^DIC(4,APCMPROV,0),U,1)
DO W^APCM2AEH(X,1,1,APCMPTYP)
+7 SET X="Report Period: "_$$FMTE^XLFDT(APCMBD)_" to "_$$FMTE^XLFDT(APCMED)
DO W^APCM2AEH(X,1,1,APCMPTYP)
+8 SET X=$$REPEAT^XLFSTR("-",80)
DO W^APCM2AEH(X,0,1,APCMPTYP)
+9 DO W^APCM2AEH("MODIFIED STAGE 2 "_$SELECT(APCMRPTT=1:"EP ",1:"EH ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY",1,1,APCMPTYP)
+10 SET X=$$REPEAT^XLFSTR("-",80)
DO W^APCM2AEH(X,0,1,APCMPTYP)
+11 SET X=""
SET $EXTRACT(X,44)="Current"
SET $EXTRACT(X,72)="Excl"
SET $EXTRACT(X,77)="Alt"
DO W^APCM2AEH(X,0,1,APCMPTYP)
+12 SET X=""
SET X="Performance Measures"
SET $EXTRACT(X,35)="Target"
SET $EXTRACT(X,44)="Rate"
SET $EXTRACT(X,56)="Num"
SET $EXTRACT(X,66)="Den"
SET $EXTRACT(X,72)="Met"
SET $EXTRACT(X,77)="Met"
DO W^APCM2AEH(X,0,1,APCMPTYP)
+13 DO W^APCM2AEH($$REPEAT^XLFSTR("-",80),0,1,APCMPTYP)
+14 QUIT
SETND ;
+1 SET APCMDF=$PIECE(^APCM25OB(M,0),U,8)
+2 SET APCMNP=$PIECE(^DD(9001304.0311,APCMDF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+3 SET APCMCYD=$$V(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+4 IF $PIECE(^APCM25OB(M,0),U,6)="A"
SET (APCMPRN,APCMCYN)=""
QUIT
+5 ;numerator field
SET APCMNF=$PIECE(^APCM25OB(M,0),U,9)
+6 SET APCMNP=$PIECE(^DD(9001304.0311,APCMNF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+7 DO SETN
+8 QUIT
PHI ;
+1 IF APCMPTYP="P"
Begin DoDot:1
+2 DO W^APCM2AEH(" 1. Protect e-Health Info+",0,2,APCMPTYP)
+3 ;TARGET
+4 SET T=$SELECT($EXTRACT(APCMPER,1,3)=315:1,$EXTRACT(APCMPER,1,3)=316:2,$EXTRACT(APCMPER,1,3)=317:3,1:1)
+5 DO W^APCM2AEH($PIECE($GET(^APCM25OB(APCMIC,12)),U,T),0,0,APCMPTYP,,35)
+6 ;RATE
+7 SET M=APCMIC
+8 DO SETND
+9 DO WRATE
+10 ;NUM/DEN
+11 DO WNUMDEN
+12 ;EXCL
+13 DO W^APCM2AEH("N/A",0,0,APCMPTYP,,71)
+14 ;ALT EXCL
+15 DO W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
End DoDot:1
QUIT
+16 IF APCMPTYP="D"
Begin DoDot:1
+17 SET APCMX=$PIECE(^APCM25OB(APCMIC,0),U,14)_$SELECT($PIECE(^APCM25OB(APCMIC,0),U,6)="A":"+",1:"")
+18 ;TARGET
+19 SET T=$SELECT($EXTRACT(APCMPER,1,3)=315:1,$EXTRACT(APCMPER,1,3)=316:2,$EXTRACT(APCMPER,1,3)=317:3,1:1)
+20 SET $PIECE(APCMX,U,2)=$PIECE($GET(^APCM25OB(APCMIC,12)),U,T)
+21 ;RATE
+22 SET M=APCMIC
+23 DO SETND
+24 DO WRATE
+25 ;NUM/DEN
+26 DO WNUMDEN
+27 ;EXCL
+28 SET $PIECE(APCMX,U,6)="N/A"
+29 SET $PIECE(APCMX,U,7)="N/A"
+30 DO W^APCM25EH(APCMX,0,2,APCMPTYP,1)
End DoDot:1
+31 QUIT
CDS ;
+1 IF APCMPTYP="P"
Begin DoDot:1
+2 DO W^APCM2AEH(" 2. Clin Decision Support+",0,2,APCMPTYP)
+3 FOR X=1,2
Begin DoDot:2
+4 SET M=$ORDER(^APCM25OB("B","S2.010.EP.1",0))
+5 IF X=1
DO W^APCM2AEH(" Imp 1 CDS 2015+",0,1,APCMPTYP)
+6 IF X=2
DO W^APCM2AEH(" Imp 5 CDS 2016+",0,1,APCMPTYP)
+7 ;TARGET
+8 SET T=$SELECT($EXTRACT(APCMPER,1,3)=315:1,$EXTRACT(APCMPER,1,3)=316:2,$EXTRACT(APCMPER,1,3)=317:3,1:1)
+9 DO W^APCM2AEH($PIECE($GET(^APCM25OB(M,12)),U,T),0,0,APCMPTYP,,35)
+10 ;RATE
+11 DO SETND
+12 DO WRATE
+13 ;NUM/DEN
+14 DO WNUMDEN
+15 ;EXCL
+16 DO W^APCM2AEH("N/A",0,0,APCMPTYP,,71)
+17 ;ALT EXCL
+18 DO W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
End DoDot:2
+19 DO W^APCM2AEH(" Drug Interaction Check+",0,1,APCMPTYP)
+20 ;TARGET
+21 SET M=$ORDER(^APCM25OB("B","S2.010.EP.2",0))
+22 SET T=$SELECT($EXTRACT(APCMPER,1,3)=315:1,$EXTRACT(APCMPER,1,3)=316:2,$EXTRACT(APCMPER,1,3)=317:3,1:1)
+23 DO W^APCM2AEH($PIECE($GET(^APCM25OB(M,12)),U,T),0,0,APCMPTYP,,35)
+24 ;RATE
+25 DO SETND
+26 DO WRATE
+27 ;NUM/DEN
+28 DO WNUMDEN
+29 ;EXCL
+30 DO WEXCL
+31 ;ALT EXCL
+32 DO W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
End DoDot:1
QUIT
+33 IF APCMPTYP="D"
Begin DoDot:1
+34 SET APCMX="Clin Decision Support+"
DO W^APCM25EH(APCMX,0,2,APCMPTYP,1)
+35 FOR X=1,2
Begin DoDot:2
+36 SET M=$ORDER(^APCM25OB("B","S2.010.EP.1",0))
+37 IF X=1
SET APCMX=" Imp 1 CDS 2015+"
+38 IF X=2
SET APCMX=" Imp 5 CDS 2016+"
+39 ;TARGET
+40 SET T=$SELECT($EXTRACT(APCMPER,1,3)=315:1,$EXTRACT(APCMPER,1,3)=316:2,$EXTRACT(APCMPER,1,3)=317:3,1:1)
+41 SET $PIECE(APCMX,U,2)=$PIECE($GET(^APCM25OB(M,12)),U,T)
+42 ;RATE
+43 DO SETND
+44 DO WRATE
+45 ;NUM/DEN
+46 DO WNUMDEN
+47 ;EXCL
+48 SET $PIECE(APCMX,U,6)="N/A"
+49 SET $PIECE(APCMX,U,7)="N/A"
+50 DO W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
End DoDot:2
+51 SET APCMX=" Drug Interaction Check+"
+52 ;TARGET
+53 SET M=$ORDER(^APCM25OB("B","S2.010.EP.2",0))
+54 SET T=$SELECT($EXTRACT(APCMPER,1,3)=315:1,$EXTRACT(APCMPER,1,3)=316:2,$EXTRACT(APCMPER,1,3)=317:3,1:1)
+55 SET $PIECE(APCMX,U,2)=$PIECE($GET(^APCM25OB(M,12)),U,T)
+56 ;RATE
+57 DO SETND
+58 DO WRATE
+59 ;NUM/DEN
+60 DO WNUMDEN
+61 ;EXCL
+62 DO WEXCL
+63 ;ALT EXCL
+64 SET $PIECE(APCMX,U,7)="N/A"
+65 DO W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
End DoDot:1
+66 QUIT
CPOEM ;
+1 IF APCMPTYP="P"
Begin DoDot:1
+2 FOR X=1,2
Begin DoDot:2
+3 SET M=APCMIC
+4 IF X=1
DO W^APCM2AEH(" 3. CPOE Medications 2015",0,2,APCMPTYP)
+5 IF X=2
DO W^APCM2AEH(" CPOE Medications 2016",0,1,APCMPTYP)
+6 ;TARGET
+7 SET T=$SELECT(X=1:">30%",1:">60%")
+8 DO W^APCM2AEH(T,0,0,APCMPTYP,,35)
+9 ;RATE
+10 DO SETND
+11 DO WRATE
+12 ;NUM/DEN
+13 DO WNUMDEN
+14 ;EXCL
+15 DO WEXCL
+16 ;ALT EXCL
+17 DO W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
End DoDot:2
End DoDot:1
+18 IF APCMPTYP="D"
Begin DoDot:1
+19 FOR X=1,2
Begin DoDot:2
+20 SET M=APCMIC
+21 IF X=1
SET APCMX="CPOE Medications 2015"
+22 IF X=2
SET APCMX=" CPOE Medications 2016"
+23 ;TARGET
+24 SET T=$SELECT(X=1:">30%",1:">60%")
+25 SET $PIECE(APCMX,U,2)=T
+26 ;RATE
+27 DO SETND
+28 DO WRATE
+29 ;NUM/DEN
+30 DO WNUMDEN
+31 ;EXCL
+32 DO WEXCL
+33 ;ALT EXCL
+34 SET $PIECE(APCMX,U,7)="N/A"
+35 IF X=2
DO W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
+36 IF X=1
DO W^APCM2AEH(APCMX,0,2,APCMPTYP,1)
End DoDot:2
End DoDot:1
+37 QUIT
CPOEL ;
+1 IF APCMPTYP="P"
Begin DoDot:1
+2 SET M=APCMIC
+3 DO W^APCM2AEH(" CPOE Laboratory",0,1,APCMPTYP)
+4 ;TARGET
+5 SET T=">30%"
+6 DO W^APCM2AEH(T,0,0,APCMPTYP,,35)
+7 ;RATE
+8 DO SETND
+9 DO WRATE
+10 ;NUM/DEN
+11 DO WNUMDEN
+12 ;EXCL
+13 DO WEXCL
+14 ;ALT EXCL
+15 SET I=$PIECE(^APCM25OB(APCMIC,0),U,1)
+16 DO W^APCM2AEH($GET(APCMATTE(I,APCMPROV)),0,0,APCMPTYP,,77)
End DoDot:1
+17 IF APCMPTYP="D"
Begin DoDot:1
+18 SET M=APCMIC
+19 SET APCMX=" CPOE Laboratory"
+20 ;TARGET
+21 SET T=">30%"
+22 SET $PIECE(APCMX,U,2)=T
+23 ;RATE
+24 DO SETND
+25 DO WRATE
+26 ;NUM/DEN
+27 DO WNUMDEN
+28 ;EXCL
+29 DO WEXCL
+30 ;ALT EXCL
+31 SET I=$PIECE(^APCM25OB(APCMIC,0),U,1)
+32 SET $PIECE(APCMX,U,7)=$GET(APCMATTE(I,APCMPROV))
+33 DO W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
End DoDot:1
+34 QUIT
CPOER ;
+1 IF APCMPTYP="P"
Begin DoDot:1
+2 SET M=APCMIC
+3 DO W^APCM2AEH(" CPOE Radiology",0,1,APCMPTYP)
+4 ;TARGET
+5 SET T=">30%"
+6 DO W^APCM2AEH(T,0,0,APCMPTYP,,35)
+7 ;RATE
+8 DO SETND
+9 DO WRATE
+10 ;NUM/DEN
+11 DO WNUMDEN
+12 ;EXCL
+13 DO WEXCL
+14 ;ALT EXCL
+15 SET I=$PIECE(^APCM25OB(APCMIC,0),U,1)
+16 DO W^APCM2AEH($GET(APCMATTE(I,APCMPROV)),0,0,APCMPTYP,,77)
End DoDot:1
+17 IF APCMPTYP="D"
Begin DoDot:1
+18 SET M=APCMIC
+19 SET APCMX=" CPOE Radiology"
+20 ;TARGET
+21 SET T=">30%"
+22 SET $PIECE(APCMX,U,2)=T
+23 ;RATE
+24 DO SETND
+25 DO WRATE
+26 ;NUM/DEN
+27 DO WNUMDEN
+28 ;EXCL
+29 DO WEXCL
+30 ;ALT EXCL
+31 SET I=$PIECE(^APCM25OB(APCMIC,0),U,1)
+32 SET $PIECE(APCMX,U,7)=$GET(APCMATTE(I,APCMPROV))
+33 DO W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
End DoDot:1
+34 QUIT
EPRES ;
+1 IF APCMPTYP="P"
Begin DoDot:1
+2 FOR X=1,2
Begin DoDot:2
+3 SET M=APCMIC
+4 IF X=1
DO W^APCM2AEH(" 4. e-Prescribe (e-Rx) 2015",0,2,APCMPTYP)
+5 IF X=2
DO W^APCM2AEH(" e-Prescribe (e-Rx) 2016",0,1,APCMPTYP)
+6 ;TARGET
+7 SET T=$SELECT(X=1:">40%",1:">50%")
+8 DO W^APCM2AEH(T,0,0,APCMPTYP,,35)
+9 ;RATE
+10 DO SETND
+11 DO WRATE
+12 ;NUM/DEN
+13 DO WNUMDEN
+14 ;EXCL
+15 DO WEXCL
+16 ;ALT EXCL
+17 DO W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
End DoDot:2
End DoDot:1
+18 IF APCMPTYP="D"
Begin DoDot:1
+19 FOR X=1,2
Begin DoDot:2
+20 SET M=APCMIC
+21 IF X=1
SET APCMX="e-Prescribe (e-Rx) 2015"
+22 IF X=2
SET APCMX="e-Prescribe (e-Rx) 2016"
+23 ;TARGET
+24 SET T=$SELECT(X=1:">40%",1:">50%")
+25 SET $PIECE(APCMX,U,2)=T
+26 ;RATE
+27 DO SETND
+28 DO WRATE
+29 ;NUM/DEN
+30 DO WNUMDEN
+31 ;EXCL
+32 DO WEXCL
+33 ;ALT EXCL
+34 SET $PIECE(APCMX,U,7)="N/A"
+35 DO W^APCM2AEH(APCMX,0,$SELECT(X=1:2,1:1),APCMPTYP,1)
End DoDot:2
End DoDot:1
+36 QUIT
SC ;summary of care
+1 IF APCMPTYP="P"
Begin DoDot:1
+2 FOR X=1,2
Begin DoDot:2
+3 SET M=APCMIC
+4 IF X=1
DO W^APCM2AEH(" 5. Sum of Care (HIE) 2015",0,2,APCMPTYP)
+5 IF X=2
DO W^APCM2AEH(" Sum of Care (HIE) 2016",0,1,APCMPTYP)
+6 ;TARGET
+7 SET T=">10%"
+8 DO W^APCM2AEH(T,0,0,APCMPTYP,,35)
+9 ;RATE
+10 DO SETND
+11 DO WRATE
+12 ;NUM/DEN
+13 DO WNUMDEN
+14 ;EXCL
+15 DO WEXCL
+16 ;ALT EXCL
+17 SET I=$PIECE(^APCM25OB(APCMIC,0),U,1)
+18 IF X=1
DO W^APCM2AEH($PIECE($GET(APCMATTE(I,APCMPROV)),U,2),0,0,APCMPTYP,,77)
+19 IF X=2
DO W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
End DoDot:2
End DoDot:1
+20 IF APCMPTYP="D"
Begin DoDot:1
+21 FOR X=1,2
Begin DoDot:2
+22 SET M=APCMIC
+23 IF X=1
SET APCMX="Sum of Care (HIE) 2015"
+24 IF X=2
SET APCMX="Sum of Care (HIE) 2016"
+25 ;TARGET
+26 SET T=">10%"
+27 SET $PIECE(APCMX,U,2)=T
+28 ;RATE
+29 DO SETND
+30 DO WRATE
+31 ;NUM/DEN
+32 DO WNUMDEN
+33 ;EXCL
+34 DO WEXCL
+35 ;ALT EXCL
+36 SET I=$PIECE(^APCM25OB(APCMIC,0),U,1)
+37 IF X=1
SET $PIECE(APCMX,U,7)=$GET(APCMATTE(I,APCMPROV))
+38 IF X=2
SET $PIECE(APCMX,U,7)="N/A"
+39 IF X=2
DO W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
+40 IF X=1
DO W^APCM2AEH(APCMX,0,2,APCMPTYP,1)
End DoDot:2
End DoDot:1
+41 QUIT
PTED ;
+1 IF APCMPTYP="P"
Begin DoDot:1
+2 FOR X=1,2
Begin DoDot:2
+3 SET M=APCMIC
+4 IF X=1
DO W^APCM2AEH(" 6. Patient Education 2015",0,2,APCMPTYP)
+5 IF X=2
DO W^APCM2AEH(" Patient Education 2016",0,1,APCMPTYP)
+6 ;TARGET
+7 SET T=">10%"
+8 DO W^APCM2AEH(T,0,0,APCMPTYP,,35)
+9 ;RATE
+10 DO SETND
+11 DO WRATE
+12 ;NUM/DEN
+13 DO WNUMDEN
+14 ;EXCL
+15 DO WEXCL
+16 ;ALT EXCL
+17 SET I=$PIECE(^APCM25OB(APCMIC,0),U,1)
+18 IF X=1
DO W^APCM2AEH($GET(APCMATTE(I,APCMPROV)),0,0,APCMPTYP,,77)
+19 IF X=2
DO W^APCM2AEH("N/A",0,0,APCMPTYP,,77)
End DoDot:2
End DoDot:1
+20 IF APCMPTYP="D"
Begin DoDot:1
+21 FOR X=1,2
Begin DoDot:2
+22 SET M=APCMIC
+23 IF X=1
SET APCMX="Patient Education 2015"
+24 IF X=2
SET APCMX="Patient Education 2016"
+25 ;TARGET
+26 SET T=">10%"
+27 SET $PIECE(APCMX,U,2)=T
+28 ;RATE
+29 DO SETND
+30 DO WRATE
+31 ;NUM/DEN
+32 DO WNUMDEN
+33 ;EXCL
+34 DO WEXCL
+35 ;ALT EXCL
+36 SET I=$PIECE(^APCM25OB(APCMIC,0),U,1)
+37 IF X=1
SET $PIECE(APCMX,U,7)=$GET(APCMATTE(I,APCMPROV))
+38 IF X=2
SET $PIECE(APCMX,U,7)="N/A"
+39 IF X=2
DO W^APCM2AEH(APCMX,0,1,APCMPTYP,1)
+40 IF X=1
DO W^APCM2AEH(APCMX,0,2,APCMPTYP,1)
End DoDot:2
End DoDot:1
+41 QUIT
WEXCL ;
+1 SET APCMEF=$PIECE(^APCM25OB(M,0),U,11)
+2 IF APCMEF]""
Begin DoDot:1
+3 SET APCMNP=$PIECE(^DD(9001304.0311,APCMEF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+4 SET APCMEV=$$V(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+5 IF APCMPTYP="P"
DO W^APCM25EH($SELECT(APCMEV="N/A":"N/A",APCMEV]"":"Yes",1:"No"),0,0,APCMPTYP,,71)
+6 IF APCMPTYP="D"
SET $PIECE(APCMX,U,6)=$SELECT(APCMEV="N/A":"N/A",APCMEV]"":"Yes",1:"No")
End DoDot:1
+7 IF APCMEF=""
Begin DoDot:1
+8 IF APCMPTYP="P"
DO W^APCM25EH("N/A",0,0,APCMPTYP,,71)
+9 SET $PIECE(APCMX,U,6)="N/A"
End DoDot:1
+10 QUIT
WRATE ;
+1 IF APCMPTYP="P"
Begin DoDot:1
+2 IF $PIECE(^APCM25OB(M,0),U,6)="A"
DO W^APCM2AEH($SELECT(APCMCYD]"":$$LBLK^APCLUTL(APCMCYD,8),1:$$LBLK^APCLUTL("N/A",8)),0,0,APCMPTYP,,40)
+3 IF $PIECE(^APCM25OB(M,0),U,6)'="A"
DO W^APCM2AEH($JUSTIFY(APCMCYP,8,2)_"%",0,0,APCMPTYP,,40)
End DoDot:1
QUIT
+4 IF $PIECE(^APCM25OB(M,0),U,6)="A"
SET $PIECE(APCMX,U,3)=$SELECT(APCMCYD]"":APCMCYD,1:"N/A")
+5 IF $PIECE(^APCM25OB(M,0),U,6)'="A"
SET $PIECE(APCMX,U,3)=$SELECT($PIECE(^APCM25OB(M,0),U,6)="A":"N/A",1:$JUSTIFY(APCMCYP,8,2)_"%")
+6 QUIT
WNUMDEN ;
+1 IF APCMPTYP="P"
Begin DoDot:1
+2 DO W^APCM2AEH($SELECT($PIECE(^APCM25OB(M,0),U,6)="A":" N/A",APCMCYN'?.N:" N/A",1:$$C(APCMCYN,0,9)),0,0,APCMPTYP,,51)
+3 DO W^APCM2AEH($SELECT($PIECE(^APCM25OB(M,0),U,6)="A":" N/A",APCMCYD'?.N:" N/A",1:$$C(APCMCYD,0,9)),0,0,APCMPTYP,,61)
End DoDot:1
QUIT
+4 SET $PIECE(APCMX,U,4)=$SELECT($PIECE(^APCM25OB(M,0),U,6)="A":"N/A",1:+APCMCYN)
+5 SET $PIECE(APCMX,U,5)=$SELECT($PIECE(^APCM25OB(M,0),U,6)="A":"N/A",1:+APCMCYD)
+6 QUIT