APCM14ER ;IHS/CMI/LAB - IHS MU REPORT;
;;1.0;IHS MU PERFORMANCE REPORTS;**5,6**;MAR 26, 2012;Build 65
;
;
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(^APCM14OB(APCMIC,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(^APCMM14C(R,11,"B",I,0))
.I 'J S X=0 Q
.S X=$P($G(^APCMM14C(R,11,J,N)),U,P)
Q ""
SUM ;EP - summary sheet for each provider
K APCMTOT
K APCMPROV
S APCMGPG=0
S APCMQUIT=""
I APCMRPTT=2 G SUMHOS
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^APCM14EH(" ",0,0,APCMPTYP) D
..D W^APCM14EH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP) ; At least one must be",0,1,APCMPTYP),W^APCM14EH("selected in the Menu Set options.",0,1,APCMPTYP),W^APCM14EH(" ",0,1,APCMPTYP),W^APCM14EH(" ",0,1,APCMPTYP)
..D W^APCM14EH("+ Indicates Yes/No Attestation Measure. The Yes or No displayed in the",0,1,APCMPTYP)
..D W^APCM14EH(" Current Rate Column is based on user input when generating the report.",0,1,APCMPTYP)
Q
SUMHOS ;
S APCMPNAM=$P(^DIC(4,APCMFAC,0),U,1)
S APCMPROV=APCMFAC
D SUM1
D W^APCM14EH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP)
D W^APCM14EH("+ Indicates Yes/No Attestation Measure. The Yes or No displayed in the",0,1,APCMPTYP)
D W^APCM14EH(" Current Rate Column is based on user input when generating the report.",0,1,APCMPTYP)
Q
;
SUM1 ;
K APCMINDO
S X=0 F S X=$O(APCMIND(X)) Q:X'=+X D
.S C=$P(^APCM14OB(X,0),U,3)
.S O=$P(^APCM14OB(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^APCM14EH("Indian Health Service RPMS Suite (BCER) v2.0",0,2,APCMPTYP)
.S X="STAGE 1 2014/2015 "_$S(APCMRPTT=1:"EP ",1:"HOSPITAL ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY" D W^APCM14EH(X,0,1,APCMPTYP)
.S X="Summary Report for "_APCMPNAM D W^APCM14EH(X,0,2,APCMPTYP)
.I APCMRPTT=1 S X=$S(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 9 including at least one public health",1:"CORE SET MEASURES (EPs must meet all 13)") D W^APCM14EH(X,0,2,APCMPTYP)
.I APCMRPTT=1 S X=$S(APCMCM="M":"measure (*))",1:"") D W^APCM14EH(X,0,1,APCMPTYP)
.I APCMRPTT=2 S X=$S(APCMCM="M":"MENU SET MEASURES (EHs/CAHs must meet 5 out of 10 including at least one public health",1:"CORE SET MEASURES (EHs/CAHs must meet all 12)") D W^APCM14EH(X,0,2,APCMPTYP)
.I APCMRPTT=2 S X=$S(APCMCM="M":"measure (*))",1:"") D W^APCM14EH(X,0,1,APCMPTYP)
.S X="Performance Measure^Target^Current Rate^Num^Den^Excl Met" D W^APCM14EH(X,0,2,APCMPTYP)
.;S X="Performance Measure^?^Den^Num^Period^Period^Target^?" D W^APCM14EH(X,0,1,APCMPTYP)
S APCMCM="" F S APCMCM=$O(APCMINDO(APCMCM)) Q:APCMCM=""!(APCMQUIT) D
.I APCMCM="M" D
..I APCMPTYP="P" D SUMH ; W^APCM14EH("MENU SET MEASURES",0,2,APCMPTYP)
..I APCMPTYP="D" D
...I APCMRPTT=1 S X=$S(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 9 including at least one public",1:"CORE SET MEASURES (EPs must meet all 13)") D W^APCM14EH(X,0,2,APCMPTYP)
...I APCMRPTT=1 S X=$S(APCMCM="M":"health measure (*))",1:"") D W^APCM14EH(X,0,1,APCMPTYP)
...I APCMRPTT=2 S X=$S(APCMCM="M":"MENU SET MEASURES (EHs/CAHs must meet 5 out of 10 including at least one public",1:"CORE SET MEASURES (EHs/CAHs must meet all 12)") D W^APCM14EH(X,0,2,APCMPTYP)
...I APCMRPTT=2 S X=$S(APCMCM="M":"health measure (*))",1:"") D W^APCM14EH(X,0,1,APCMPTYP)
.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^APCM14EH(" ",0,1,APCMPTYP)
Q
SUM2 ;
I APCMPTYP="P",APCMGPG=0 D SUMH Q:APCMQUIT
I APCMPTYP="P",$Y>(APCMIOSL-4) D SUMH Q:APCMQUIT
;SHOULD THIS LINE BE ALL N/As?
S F=$P(^APCM14OB(APCMIC,0),U,18)
I F]"" D I APCME="X" Q
.S APCMNP=$P(^DD(9001302.0311,F,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
.S APCME=$$V^APCM14ER(1,APCMRPT,N,P,APCMPROV,"I",APCMRPTT)
.Q:APCME'="X"
SUM21 .;
.I APCMPTYP="P" D
..I APCMMO["." D W^APCM14EH(" "_$E($P(^APCM14OB(APCMIC,0),U,14),1,28)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:""),0,1,APCMPTYP) I 1
..E D W^APCM14EH($S($L(APCMMO)=1:" "_APCMMO,1:APCMMO)_". "_$E($P(^APCM14OB(APCMIC,0),U,14),1,28)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:""),0,1,APCMPTYP)
..D W^APCM14EH("N/A",0,0,APCMPTYP,,36)
..D W^APCM14EH($$LBLK^APCLUTL("N/A",8),0,0,APCMPTYP,,43)
..D W^APCM14EH($$LBLK^APCLUTL("N/A",7),0,0,APCMPTYP,,55)
..D W^APCM14EH($$LBLK^APCLUTL("N/A",7),0,0,APCMPTYP,,65)
..;D W^APCM14EH("N/A",0,0,APCMPTYP,,76)
..S APCMEF=$P(^APCM14OB(APCMIC,0),U,11)
..I APCMEF]"" D
...S APCMNP=$P(^DD(9001302.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)
...D W^APCM14EH($S(APCMEV]"":APCMEV,1:"N/A"),0,0,APCMPTYP,,76)
..I APCMEF="" D W^APCM14EH("N/A",0,0,APCMPTYP,,76)
.I APCMPTYP="D" D
..I APCMMO["." S APCMX=" "_$P(^APCM14OB(APCMIC,0),U,14)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:"") I 1
..E S APCMX=$P(^APCM14OB(APCMIC,0),U,14)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:"")
..S APCMX=APCMX_U_"N/A"_U_"N/A"_U_"N/A"_U_"N/A"
..S APCMEF=$P(^APCM14OB(APCMIC,0),U,11)
..I APCMEF]"" D
...S APCMNP=$P(^DD(9001302.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)
...S APCMX=APCMX_U_$S(APCMEV]"":APCMEV,1:"N/A")
..I APCMEF="" S APCMX=APCMX_U_"N/A"
..D W^APCM14EH(APCMX,0,2,APCMPTYP,1)
S APCMDF=$P(^APCM14OB(APCMIC,0),U,8)
;get DENOMINATOR value
S APCMNP=$P(^DD(9001302.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(^APCM14OB(APCMIC,0),U,6)="A" S (APCMPRN,APCMCYN)="" G WSUM
S APCMNF=$P(^APCM14OB(APCMIC,0),U,9) ;numerator field
S APCMNP=$P(^DD(9001302.0311,APCMNF,0),U,4),N=$P(APCMNP,";"),P=$P(APCMNP,";",2)
D SETN
WSUM ;write out line
I APCMPTYP="P",$Y>(APCMIOSL-2) D SUMH Q:APCMQUIT
I APCMPTYP="P" D
.;LABEL
.I APCMMO["." D W^APCM14EH(" "_$E($P(^APCM14OB(APCMIC,0),U,14),1,28)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:""),0,1,APCMPTYP) I 1
.E D W^APCM14EH($S($L(APCMMO)=1:" "_APCMMO,1:APCMMO)_". "_$E($P(^APCM14OB(APCMIC,0),U,14),1,28)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:""),0,2,APCMPTYP)
.;TARGET
.D W^APCM14EH($G(^APCM14OB(APCMIC,13,1,0)),0,0,APCMPTYP,,35)
.;RATE
.I $P(^APCM14OB(APCMIC,0),U,6)="A" D W^APCM14EH($S(APCMCYD]"":$$LBLK^APCLUTL(APCMCYD,8),1:$$LBLK^APCLUTL("N/A",8)),0,0,APCMPTYP,,42)
.I $P(^APCM14OB(APCMIC,0),U,6)'="A" D W^APCM14EH($J(APCMCYP,8,2)_"%",0,0,APCMPTYP,,42)
.;NUMERATOR/DENOMINATOR
.D W^APCM14EH($S($P(^APCM14OB(APCMIC,0),U,6)="A":" N/A",APCMCYN'?.N:" N/A",1:$$C(APCMCYN,0,9)),0,0,APCMPTYP,,55)
.D W^APCM14EH($S($P(^APCM14OB(APCMIC,0),U,6)="A":" N/A",APCMCYD'?.N:" N/A",1:$$C(APCMCYD,0,9)),0,0,APCMPTYP,,65)
.;EXCL MET?
.S APCMEF=$P(^APCM14OB(APCMIC,0),U,11)
.I APCMEF]"" D
..S APCMNP=$P(^DD(9001302.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)
..D W^APCM14EH($S(APCMEV="N/A":"N/A",APCMEV]"":"Yes",1:"No"),0,0,APCMPTYP,,76)
.I APCMEF="" D W^APCM14EH("N/A",0,0,APCMPTYP,,76)
I APCMPTYP="D" D
.I APCMMO["." S APCMX=" "_$P(^APCM14OB(APCMIC,0),U,14)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:"") I 1
.E S APCMX=$P(^APCM14OB(APCMIC,0),U,14)_$S($P(^APCM14OB(APCMIC,0),U,6)="A":"+",1:"")
.;TARGet
.S $P(APCMX,U,2)=$G(^APCM14OB(APCMIC,13,1,0))
.;current rate
.I $P(^APCM14OB(APCMIC,0),U,6)="A" S $P(APCMX,U,3)=$S(APCMCYD]"":APCMCYD,1:"N/A")
.I $P(^APCM14OB(APCMIC,0),U,6)'="A" S $P(APCMX,U,3)=$$SB($J(APCMCYP,6,2))_"%"
.;numerator denominator
.S $P(APCMX,U,4)=$S($P(^APCM14OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYN)
.S $P(APCMX,U,5)=$S($P(^APCM14OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYD)
.S APCMEF=$P(^APCM14OB(APCMIC,0),U,11)
.;EXCLUSION MET?
.I APCMEF]"" D
..S APCMNP=$P(^DD(9001302.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)
..S $P(APCMX,U,6)=$S(APCMEV="N/A":APCMEV,APCMEV]"":"Yes",1:"No") ;IHS/CMI/LAB - fix display
.I APCMEF="" S $P(APCMX,U,6)="N/A"
.D W^APCM14EH(APCMX,0,2,APCMPTYP,1)
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^APCM14EH(X,0,1,APCMPTYP)
D W^APCM14EH("Indian Health Service RPMS Suite (BCER) v2.0",1,2,APCMPTYP)
I APCMRPTT=1 D W^APCM14EH("*** IHS 2014/2015 Stage 1 Meaningful Use Performance Measure Report for EPs ***",1,1,APCMPTYP)
I APCMRPTT=2 D W^APCM14EH("** IHS 2014/2015 Stage 1 MU Performance Report for Eligible Hospitals/CAHs **",1,1,APCMPTYP)
I $G(APCMPROV),APCMRPTT=1 S X="Provider Name: "_$$SN^APCM14EH($P(^VA(200,APCMPROV,0),U,1)) D W^APCM14EH(X,1,1,APCMPTYP)
I APCMRPTT=2 S X="Method: "_$S(APCMMETH="E":"All Emergency Department",1:"Observation") D W^APCM14EH(X,1,1,APCMPTYP)
I $G(APCMPROV),APCMRPTT=2 S X="Facility: "_$P(^DIC(4,APCMPROV,0),U,1) D W^APCM14EH(X,1,1,APCMPTYP)
S X="Report Period: "_$$FMTE^XLFDT(APCMBD)_" to "_$$FMTE^XLFDT(APCMED) D W^APCM14EH(X,1,1,APCMPTYP)
S X=$$REPEAT^XLFSTR("-",80) D W^APCM14EH(X,0,1,APCMPTYP)
D W^APCM14EH("STAGE 1 2014/2015 "_$S(APCMRPTT=1:"EP ",1:"HOSPITAL ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY",1,1,APCMPTYP)
I APCMRPTT=1 S X=$S(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 9 including at least one public",1:"CORE SET MEASURES (EPs must meet all 13)") D W^APCM14EH(X,1,1,APCMPTYP)
I APCMRPTT=1 S X=$S(APCMCM="M":"health measure (*))",1:"") D W^APCM14EH(X,1,1,APCMPTYP)
I APCMRPTT=2 S X=$S(APCMCM="M":"MENU SET MEASURES (EHs/CAHs must meet 5 out of 10 including at least one public",1:"CORE SET MEASURES (EHs/CAHs must meet all 11)") D W^APCM14EH(X,1,1,APCMPTYP)
I APCMRPTT=2 S X=$S(APCMCM="M":"health measure (*))",1:"") D W^APCM14EH(X,1,1,APCMPTYP)
S X=$$REPEAT^XLFSTR("-",80) D W^APCM14EH(X,0,1,APCMPTYP)
S X="",$E(X,45)="Current",$E(X,76)="Excl" D W^APCM14EH(X,0,1,APCMPTYP)
S X="",X="Performance Measures",$E(X,35)="Target",$E(X,45)="Rate",$E(X,59)="Num",$E(X,69)="Den",$E(X,76)="Met" D W^APCM14EH(X,0,1,APCMPTYP)
D W^APCM14EH($$REPEAT^XLFSTR("-",80),0,1,APCMPTYP)
Q
APCM14ER ;IHS/CMI/LAB - IHS MU REPORT;
+1 ;;1.0;IHS MU PERFORMANCE REPORTS;**5,6**;MAR 26, 2012;Build 65
+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(^APCM14OB(APCMIC,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(^APCMM14C(R,11,"B",I,0))
+6 IF 'J
SET X=0
QUIT
+7 SET X=$PIECE($GET(^APCMM14C(R,11,J,N)),U,P)
End DoDot:1
QUIT X
+8 QUIT ""
SUM ;EP - summary sheet for each provider
+1 KILL APCMTOT
+2 KILL APCMPROV
+3 SET APCMGPG=0
+4 SET APCMQUIT=""
+5 IF APCMRPTT=2
GOTO SUMHOS
+6 SET X=0
FOR
SET X=$ORDER(APCMPRV(X))
IF X'=+X
QUIT
SET APCMPROV($PIECE(^VA(200,X,0),U),X)=""
+7 SET APCMPNAM=""
FOR
SET APCMPNAM=$ORDER(APCMPROV(APCMPNAM))
IF APCMPNAM=""!(APCMQUIT)
QUIT
Begin DoDot:1
+8 SET APCMPROV=0
FOR
SET APCMPROV=$ORDER(APCMPROV(APCMPNAM,APCMPROV))
IF APCMPROV=""!(APCMQUIT)
QUIT
DO SUM1
DO W^APCM14EH(" ",0,0,APCMPTYP)
Begin DoDot:2
+9 ; At least one must be",0,1,APCMPTYP),W^APCM14EH("selected in the Menu Set options.",0,1,APCMPTYP),W^APCM14EH(" ",0,1,APCMPTYP),W^APCM14EH(" ",0,1,APCMPTYP)
DO W^APCM14EH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP)
+10 DO W^APCM14EH("+ Indicates Yes/No Attestation Measure. The Yes or No displayed in the",0,1,APCMPTYP)
+11 DO W^APCM14EH(" Current Rate Column is based on user input when generating the report.",0,1,APCMPTYP)
End DoDot:2
End DoDot:1
+12 QUIT
SUMHOS ;
+1 SET APCMPNAM=$PIECE(^DIC(4,APCMFAC,0),U,1)
+2 SET APCMPROV=APCMFAC
+3 DO SUM1
+4 DO W^APCM14EH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP)
+5 DO W^APCM14EH("+ Indicates Yes/No Attestation Measure. The Yes or No displayed in the",0,1,APCMPTYP)
+6 DO W^APCM14EH(" Current Rate Column is based on user input when generating the report.",0,1,APCMPTYP)
+7 QUIT
+8 ;
SUM1 ;
+1 KILL APCMINDO
+2 SET X=0
FOR
SET X=$ORDER(APCMIND(X))
IF X'=+X
QUIT
Begin DoDot:1
+3 SET C=$PIECE(^APCM14OB(X,0),U,3)
+4 SET O=$PIECE(^APCM14OB(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^APCM14EH("Indian Health Service RPMS Suite (BCER) v2.0",0,2,APCMPTYP)
+10 SET X="STAGE 1 2014/2015 "_$SELECT(APCMRPTT=1:"EP ",1:"HOSPITAL ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY"
DO W^APCM14EH(X,0,1,APCMPTYP)
+11 SET X="Summary Report for "_APCMPNAM
DO W^APCM14EH(X,0,2,APCMPTYP)
+12 IF APCMRPTT=1
SET X=$SELECT(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 9 including at least one public health",1:"CORE SET MEASURES (EPs must meet all 13)")
DO W^APCM14EH(X,0,2,APCMPTYP)
+13 IF APCMRPTT=1
SET X=$SELECT(APCMCM="M":"measure (*))",1:"")
DO W^APCM14EH(X,0,1,APCMPTYP)
+14 IF APCMRPTT=2
SET X=$SELECT(APCMCM="M":"MENU SET MEASURES (EHs/CAHs must meet 5 out of 10 including at least one public health",1:"CORE SET MEASURES (EHs/CAHs must meet all 12)")
DO W^APCM14EH(X,0,2,APCMPTYP)
+15 IF APCMRPTT=2
SET X=$SELECT(APCMCM="M":"measure (*))",1:"")
DO W^APCM14EH(X,0,1,APCMPTYP)
+16 SET X="Performance Measure^Target^Current Rate^Num^Den^Excl Met"
DO W^APCM14EH(X,0,2,APCMPTYP)
+17 ;S X="Performance Measure^?^Den^Num^Period^Period^Target^?" D W^APCM14EH(X,0,1,APCMPTYP)
End DoDot:1
+18 SET APCMCM=""
FOR
SET APCMCM=$ORDER(APCMINDO(APCMCM))
IF APCMCM=""!(APCMQUIT)
QUIT
Begin DoDot:1
+19 IF APCMCM="M"
Begin DoDot:2
+20 ; W^APCM14EH("MENU SET MEASURES",0,2,APCMPTYP)
IF APCMPTYP="P"
DO SUMH
+21 IF APCMPTYP="D"
Begin DoDot:3
+22 IF APCMRPTT=1
SET X=$SELECT(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 9 including at least one public",1:"CORE SET MEASURES (EPs must meet all 13)")
DO W^APCM14EH(X,0,2,APCMPTYP)
+23 IF APCMRPTT=1
SET X=$SELECT(APCMCM="M":"health measure (*))",1:"")
DO W^APCM14EH(X,0,1,APCMPTYP)
+24 IF APCMRPTT=2
SET X=$SELECT(APCMCM="M":"MENU SET MEASURES (EHs/CAHs must meet 5 out of 10 including at least one public",1:"CORE SET MEASURES (EHs/CAHs must meet all 12)")
DO W^APCM14EH(X,0,2,APCMPTYP)
+25 IF APCMRPTT=2
SET X=$SELECT(APCMCM="M":"health measure (*))",1:"")
DO W^APCM14EH(X,0,1,APCMPTYP)
End DoDot:3
End DoDot:2
+26 SET APCMMO=0
FOR
SET APCMMO=$ORDER(APCMINDO(APCMCM,APCMMO))
IF APCMMO=""!(APCMQUIT)
QUIT
Begin DoDot:2
+27 SET APCMIC=0
FOR
SET APCMIC=$ORDER(APCMINDO(APCMCM,APCMMO,APCMIC))
IF APCMIC=""!(APCMQUIT)
QUIT
DO SUM2
End DoDot:2
End DoDot:1
+28 DO W^APCM14EH(" ",0,1,APCMPTYP)
+29 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 ;SHOULD THIS LINE BE ALL N/As?
+4 SET F=$PIECE(^APCM14OB(APCMIC,0),U,18)
+5 IF F]""
Begin DoDot:1
+6 SET APCMNP=$PIECE(^DD(9001302.0311,F,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+7 SET APCME=$$V^APCM14ER(1,APCMRPT,N,P,APCMPROV,"I",APCMRPTT)
+8 IF APCME'="X"
QUIT
SUM21 ;
+1 IF APCMPTYP="P"
Begin DoDot:2
+2 IF APCMMO["."
DO W^APCM14EH(" "_$EXTRACT($PIECE(^APCM14OB(APCMIC,0),U,14),1,28)_$SELECT($PIECE(^APCM14OB(APCMIC,0),U,6)="A":"+",1:""),0,1,APCMPTYP)
IF 1
+3 IF '$TEST
DO W^APCM14EH($SELECT($LENGTH(APCMMO)=1:" "_APCMMO,1:APCMMO)_". "_$EXTRACT($PIECE(^APCM14OB(APCMIC,0),U,14),1,28)_$SELECT($PIECE(^APCM14OB(APCMIC,0),U,6)="A":"+",1:""),0,1,APCMPTYP)
+4 DO W^APCM14EH("N/A",0,0,APCMPTYP,,36)
+5 DO W^APCM14EH($$LBLK^APCLUTL("N/A",8),0,0,APCMPTYP,,43)
+6 DO W^APCM14EH($$LBLK^APCLUTL("N/A",7),0,0,APCMPTYP,,55)
+7 DO W^APCM14EH($$LBLK^APCLUTL("N/A",7),0,0,APCMPTYP,,65)
+8 ;D W^APCM14EH("N/A",0,0,APCMPTYP,,76)
+9 SET APCMEF=$PIECE(^APCM14OB(APCMIC,0),U,11)
+10 IF APCMEF]""
Begin DoDot:3
+11 SET APCMNP=$PIECE(^DD(9001302.0311,APCMEF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+12 SET APCMEV=$$V(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+13 DO W^APCM14EH($SELECT(APCMEV]"":APCMEV,1:"N/A"),0,0,APCMPTYP,,76)
End DoDot:3
+14 IF APCMEF=""
DO W^APCM14EH("N/A",0,0,APCMPTYP,,76)
End DoDot:2
+15 IF APCMPTYP="D"
Begin DoDot:2
+16 IF APCMMO["."
SET APCMX=" "_$PIECE(^APCM14OB(APCMIC,0),U,14)_$SELECT($PIECE(^APCM14OB(APCMIC,0),U,6)="A":"+",1:"")
IF 1
+17 IF '$TEST
SET APCMX=$PIECE(^APCM14OB(APCMIC,0),U,14)_$SELECT($PIECE(^APCM14OB(APCMIC,0),U,6)="A":"+",1:"")
+18 SET APCMX=APCMX_U_"N/A"_U_"N/A"_U_"N/A"_U_"N/A"
+19 SET APCMEF=$PIECE(^APCM14OB(APCMIC,0),U,11)
+20 IF APCMEF]""
Begin DoDot:3
+21 SET APCMNP=$PIECE(^DD(9001302.0311,APCMEF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+22 SET APCMEV=$$V(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+23 SET APCMX=APCMX_U_$SELECT(APCMEV]"":APCMEV,1:"N/A")
End DoDot:3
+24 IF APCMEF=""
SET APCMX=APCMX_U_"N/A"
+25 DO W^APCM14EH(APCMX,0,2,APCMPTYP,1)
End DoDot:2
End DoDot:1
IF APCME="X"
QUIT
+26 SET APCMDF=$PIECE(^APCM14OB(APCMIC,0),U,8)
+27 ;get DENOMINATOR value
+28 SET APCMNP=$PIECE(^DD(9001302.0311,APCMDF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+29 SET APCMCYD=$$V(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+30 IF $PIECE(^APCM14OB(APCMIC,0),U,6)="A"
SET (APCMPRN,APCMCYN)=""
GOTO WSUM
+31 ;numerator field
SET APCMNF=$PIECE(^APCM14OB(APCMIC,0),U,9)
+32 SET APCMNP=$PIECE(^DD(9001302.0311,APCMNF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+33 DO SETN
WSUM ;write out line
+1 IF APCMPTYP="P"
IF $Y>(APCMIOSL-2)
DO SUMH
IF APCMQUIT
QUIT
+2 IF APCMPTYP="P"
Begin DoDot:1
+3 ;LABEL
+4 IF APCMMO["."
DO W^APCM14EH(" "_$EXTRACT($PIECE(^APCM14OB(APCMIC,0),U,14),1,28)_$SELECT($PIECE(^APCM14OB(APCMIC,0),U,6)="A":"+",1:""),0,1,APCMPTYP)
IF 1
+5 IF '$TEST
DO W^APCM14EH($SELECT($LENGTH(APCMMO)=1:" "_APCMMO,1:APCMMO)_". "_$EXTRACT($PIECE(^APCM14OB(APCMIC,0),U,14),1,28)_$SELECT($PIECE(^APCM14OB(APCMIC,0),U,6)="A":"+",1:""),0,2,APCMPTYP)
+6 ;TARGET
+7 DO W^APCM14EH($GET(^APCM14OB(APCMIC,13,1,0)),0,0,APCMPTYP,,35)
+8 ;RATE
+9 IF $PIECE(^APCM14OB(APCMIC,0),U,6)="A"
DO W^APCM14EH($SELECT(APCMCYD]"":$$LBLK^APCLUTL(APCMCYD,8),1:$$LBLK^APCLUTL("N/A",8)),0,0,APCMPTYP,,42)
+10 IF $PIECE(^APCM14OB(APCMIC,0),U,6)'="A"
DO W^APCM14EH($JUSTIFY(APCMCYP,8,2)_"%",0,0,APCMPTYP,,42)
+11 ;NUMERATOR/DENOMINATOR
+12 DO W^APCM14EH($SELECT($PIECE(^APCM14OB(APCMIC,0),U,6)="A":" N/A",APCMCYN'?.N:" N/A",1:$$C(APCMCYN,0,9)),0,0,APCMPTYP,,55)
+13 DO W^APCM14EH($SELECT($PIECE(^APCM14OB(APCMIC,0),U,6)="A":" N/A",APCMCYD'?.N:" N/A",1:$$C(APCMCYD,0,9)),0,0,APCMPTYP,,65)
+14 ;EXCL MET?
+15 SET APCMEF=$PIECE(^APCM14OB(APCMIC,0),U,11)
+16 IF APCMEF]""
Begin DoDot:2
+17 SET APCMNP=$PIECE(^DD(9001302.0311,APCMEF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+18 SET APCMEV=$$V(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+19 DO W^APCM14EH($SELECT(APCMEV="N/A":"N/A",APCMEV]"":"Yes",1:"No"),0,0,APCMPTYP,,76)
End DoDot:2
+20 IF APCMEF=""
DO W^APCM14EH("N/A",0,0,APCMPTYP,,76)
End DoDot:1
+21 IF APCMPTYP="D"
Begin DoDot:1
+22 IF APCMMO["."
SET APCMX=" "_$PIECE(^APCM14OB(APCMIC,0),U,14)_$SELECT($PIECE(^APCM14OB(APCMIC,0),U,6)="A":"+",1:"")
IF 1
+23 IF '$TEST
SET APCMX=$PIECE(^APCM14OB(APCMIC,0),U,14)_$SELECT($PIECE(^APCM14OB(APCMIC,0),U,6)="A":"+",1:"")
+24 ;TARGet
+25 SET $PIECE(APCMX,U,2)=$GET(^APCM14OB(APCMIC,13,1,0))
+26 ;current rate
+27 IF $PIECE(^APCM14OB(APCMIC,0),U,6)="A"
SET $PIECE(APCMX,U,3)=$SELECT(APCMCYD]"":APCMCYD,1:"N/A")
+28 IF $PIECE(^APCM14OB(APCMIC,0),U,6)'="A"
SET $PIECE(APCMX,U,3)=$$SB($JUSTIFY(APCMCYP,6,2))_"%"
+29 ;numerator denominator
+30 SET $PIECE(APCMX,U,4)=$SELECT($PIECE(^APCM14OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYN)
+31 SET $PIECE(APCMX,U,5)=$SELECT($PIECE(^APCM14OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYD)
+32 SET APCMEF=$PIECE(^APCM14OB(APCMIC,0),U,11)
+33 ;EXCLUSION MET?
+34 IF APCMEF]""
Begin DoDot:2
+35 SET APCMNP=$PIECE(^DD(9001302.0311,APCMEF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+36 SET APCMEV=$$V(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+37 ;IHS/CMI/LAB - fix display
SET $PIECE(APCMX,U,6)=$SELECT(APCMEV="N/A":APCMEV,APCMEV]"":"Yes",1:"No")
End DoDot:2
+38 IF APCMEF=""
SET $PIECE(APCMX,U,6)="N/A"
+39 DO W^APCM14EH(APCMX,0,2,APCMPTYP,1)
End DoDot:1
+40 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^APCM14EH(X,0,1,APCMPTYP)
+3 DO W^APCM14EH("Indian Health Service RPMS Suite (BCER) v2.0",1,2,APCMPTYP)
+4 IF APCMRPTT=1
DO W^APCM14EH("*** IHS 2014/2015 Stage 1 Meaningful Use Performance Measure Report for EPs ***",1,1,APCMPTYP)
+5 IF APCMRPTT=2
DO W^APCM14EH("** IHS 2014/2015 Stage 1 MU Performance Report for Eligible Hospitals/CAHs **",1,1,APCMPTYP)
+6 IF $GET(APCMPROV)
IF APCMRPTT=1
SET X="Provider Name: "_$$SN^APCM14EH($PIECE(^VA(200,APCMPROV,0),U,1))
DO W^APCM14EH(X,1,1,APCMPTYP)
+7 IF APCMRPTT=2
SET X="Method: "_$SELECT(APCMMETH="E":"All Emergency Department",1:"Observation")
DO W^APCM14EH(X,1,1,APCMPTYP)
+8 IF $GET(APCMPROV)
IF APCMRPTT=2
SET X="Facility: "_$PIECE(^DIC(4,APCMPROV,0),U,1)
DO W^APCM14EH(X,1,1,APCMPTYP)
+9 SET X="Report Period: "_$$FMTE^XLFDT(APCMBD)_" to "_$$FMTE^XLFDT(APCMED)
DO W^APCM14EH(X,1,1,APCMPTYP)
+10 SET X=$$REPEAT^XLFSTR("-",80)
DO W^APCM14EH(X,0,1,APCMPTYP)
+11 DO W^APCM14EH("STAGE 1 2014/2015 "_$SELECT(APCMRPTT=1:"EP ",1:"HOSPITAL ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY",1,1,APCMPTYP)
+12 IF APCMRPTT=1
SET X=$SELECT(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 9 including at least one public",1:"CORE SET MEASURES (EPs must meet all 13)")
DO W^APCM14EH(X,1,1,APCMPTYP)
+13 IF APCMRPTT=1
SET X=$SELECT(APCMCM="M":"health measure (*))",1:"")
DO W^APCM14EH(X,1,1,APCMPTYP)
+14 IF APCMRPTT=2
SET X=$SELECT(APCMCM="M":"MENU SET MEASURES (EHs/CAHs must meet 5 out of 10 including at least one public",1:"CORE SET MEASURES (EHs/CAHs must meet all 11)")
DO W^APCM14EH(X,1,1,APCMPTYP)
+15 IF APCMRPTT=2
SET X=$SELECT(APCMCM="M":"health measure (*))",1:"")
DO W^APCM14EH(X,1,1,APCMPTYP)
+16 SET X=$$REPEAT^XLFSTR("-",80)
DO W^APCM14EH(X,0,1,APCMPTYP)
+17 SET X=""
SET $EXTRACT(X,45)="Current"
SET $EXTRACT(X,76)="Excl"
DO W^APCM14EH(X,0,1,APCMPTYP)
+18 SET X=""
SET X="Performance Measures"
SET $EXTRACT(X,35)="Target"
SET $EXTRACT(X,45)="Rate"
SET $EXTRACT(X,59)="Num"
SET $EXTRACT(X,69)="Den"
SET $EXTRACT(X,76)="Met"
DO W^APCM14EH(X,0,1,APCMPTYP)
+19 DO W^APCM14EH($$REPEAT^XLFSTR("-",80),0,1,APCMPTYP)
+20 QUIT