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

APCM2AER.m

Go to the documentation of this file.
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