APCM13ER ;IHS/CMI/LAB - IHS MU REPORT;
;;1.0;IHS MU PERFORMANCE REPORTS;**2,4,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
S APCMPRN=$$V(2,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT) ;SPDX
Q:$P(^APCM13OB(APCMIC,0),U,6)="A" ;no % on attestation measures
S APCMCYP=$S(APCMCYD:((APCMCYN/APCMCYD)*100),1:"")
S APCMPRP=$S(APCMPRD:((APCMPRN/APCMPRD)*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 K="T" S I="TOTAL"
I T=1 D Q X
.S J=$O(^APCMM13C(R,$S(K="I":11,1:12),"B",I,0))
.I 'J S X=0 Q
.S X=$P($G(^APCMM13C(R,$S(K="I":11,1:12),J,N)),U,P)
I T=2 D Q X
.S J=$O(^APCMM13P(R,$S(K="I":11,1:12),"B",I,0))
.I 'J S X=0 Q
.S X=$P($G(^APCMM13P(R,$S(K="I":11,1:12),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^APCM13EH(" ",0,0,APCMPTYP) D
..D W^APCM13EH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP) ; At least one must be",0,1,APCMPTYP),W^APCM13EH("selected in the Menu Set options.",0,1,APCMPTYP),W^APCM13EH(" ",0,1,APCMPTYP),W^APCM13EH(" ",0,1,APCMPTYP)
Q
SUMHOS ;
S APCMPNAM=$P(^DIC(4,APCMFAC,0),U,1)
S APCMPROV=APCMFAC
D SUM1 D W^APCM13EH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP) ;,W^APCM13EH("selected in the Menu Set options.",0,1,APCMPTYP),W^APCM13EH(" ",0,1,APCMPTYP)
Q
;
SUM1 ;
K APCMINDO
S X=0 F S X=$O(APCMIND(X)) Q:X'=+X D
.S C=$P(^APCM13OB(X,0),U,3)
.S O=$P(^APCM13OB(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^APCM13EH("Indian Health Service RPMS Suite (BCER) v1.0",0,2,APCMPTYP)
.S X="STAGE 1 "_$S(APCMRPTT=1:"EP ",1:"HOSPITAL ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY" D W^APCM13EH(X,0,1,APCMPTYP)
.S X="Summary Report for "_APCMPNAM D W^APCM13EH(X,0,2,APCMPTYP)
.S X="^Excl^#^#^Current^Prev^Stage 1^Attest" D W^APCM13EH(X,0,2,APCMPTYP)
.S X="Performance Measure^?^Den^Num^Period^Period^Target^?" D W^APCM13EH(X,0,1,APCMPTYP)
.I APCMRPTT=1 S X=$S(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 10 including at least one public health",1:"CORE SET MEASURES (EPs must meet all 13)") D W^APCM13EH(X,0,2,APCMPTYP)
.I APCMRPTT=1 S X=$S(APCMCM="M":"measure (*))",1:"") D W^APCM13EH(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^APCM13EH(X,0,2,APCMPTYP)
.I APCMRPTT=2 S X=$S(APCMCM="M":"measure (*))",1:"") D W^APCM13EH(X,0,1,APCMPTYP)
S APCMCM="" F S APCMCM=$O(APCMINDO(APCMCM)) Q:APCMCM=""!(APCMQUIT) D
.I APCMCM="M" D ; W^APCM13EH("MENU SET MEASURES",0,2,APCMPTYP)
..I APCMRPTT=1 S X=$S(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 10 including at least one public",1:"CORE SET MEASURES (EPs must meet all 13)") D W^APCM13EH(X,0,2,APCMPTYP)
..I APCMRPTT=1 S X=$S(APCMCM="M":"health measure (*))",1:"") D W^APCM13EH(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^APCM13EH(X,0,2,APCMPTYP)
..I APCMRPTT=2 S X=$S(APCMCM="M":"health measure (*))",1:"") D W^APCM13EH(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^APCM13EH(" ",0,1,APCMPTYP)
Q
SUM2 ;
I APCMPTYP="P",APCMGPG=0 D SUMH Q:APCMQUIT
I APCMPTYP="P",$Y>(APCMIOSL-4) D SUMH Q:APCMQUIT
;I APCMPTYP="D" D W^APCM13EH(" ",0,2,APCMPTYP)
S APCMDF=$P(^APCM13OB(APCMIC,0),U,8)
;get NUMERATOR value
S APCMNP=$P(^DD(9001301.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)
S APCMPRD=$$V(2,APCMRPT,N,P,APCMPROV,$S($G(APCMTOT):"T",1:"I"),APCMRPTT)
I $P(^APCM13OB(APCMIC,0),U,6)="A" S (APCMPRN,APCMCYN)="" G WSUM
S APCMNF=$P(^APCM13OB(APCMIC,0),U,9) ;numerator field
S APCMNP=$P(^DD(9001301.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
.D W^APCM13EH($S($L(APCMMO)=1:" "_APCMMO,1:APCMMO)_". "_$E($P(^APCM13OB(APCMIC,0),U,14),1,22),0,2,APCMPTYP)
.S APCMEF=$P(^APCM13OB(APCMIC,0),U,11)
.I APCMEF]"" D
..S APCMNP=$P(^DD(9001301.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^APCM13EH($S(APCMEV]"":"Yes",1:"No"),0,0,APCMPTYP,,28)
.I APCMEF="" D W^APCM13EH("N/A",0,0,APCMPTYP,,28) ;
.D W^APCM13EH($S($P(^APCM13OB(APCMIC,0),U,6)="A":" N/A",1:$$C(APCMCYD,0,7)),0,0,APCMPTYP,,33)
.D W^APCM13EH($S($P(^APCM13OB(APCMIC,0),U,6)="A":" N/A",1:$$C(APCMCYN,0,7)),0,0,APCMPTYP,,42)
.D W^APCM13EH($S($P(^APCM13OB(APCMIC,0),U,6)="A":" N/A",1:$J(APCMCYP,5,1)_"%"),0,0,APCMPTYP,,51)
.D W^APCM13EH($S($P(^APCM13OB(APCMIC,0),U,6)="A":" N/A",1:$J(APCMPRP,5,1)_"%"),0,0,APCMPTYP,,59)
TARGET .D W^APCM13EH($G(^APCM13OB(APCMIC,13,1,0)),0,0,APCMPTYP,,68)
.I $P(^APCM13OB(APCMIC,0),U,6)'="A" D W^APCM13EH("N/A",0,0,APCMPTYP,,76)
.I $P(^APCM13OB(APCMIC,0),U,6)="A" D W^APCM13EH(APCMCYD,0,0,APCMPTYP,,76)
I APCMPTYP="D" D
.S APCMX=APCMMO_". "_$P(^APCM13OB(APCMIC,0),U,14)
.S APCMEF=$P(^APCM13OB(APCMIC,0),U,11)
.I APCMEF]"" D
..S APCMNP=$P(^DD(9001301.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,2)=$S(APCMRPTT=1:"Yes",1:"No")
..S $P(APCMX,U,2)=$S(APCMEV]"":"Yes",1:"No") ;IHS/CMI/LAB - fix display
.I APCMEF="" S $P(APCMX,U,2)="N/A"
.S $P(APCMX,U,3)=$S($P(^APCM13OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYD)
.S $P(APCMX,U,4)=$S($P(^APCM13OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYN) ;$S($P(^APCM13OB(APCMIC,0),U,6)="A":APCMCYD,1:$$SB($J(APCMCYP,5,1))_"%")
.S $P(APCMX,U,5)=$S($P(^APCM13OB(APCMIC,0),U,6)="A":"N/A",1:$$SB($J(APCMCYP,5,1))_"%")
.S $P(APCMX,U,6)=$S($P(^APCM13OB(APCMIC,0),U,6)="A":"N/A",1:$$SB($J(APCMPRP,5,1))_"%")
TARG .S $P(APCMX,U,7)=$G(^APCM13OB(APCMIC,13,1,0))
.I $P(^APCM13OB(APCMIC,0),U,6)'="A" S $P(APCMX,U,8)="N/A"
.I $P(^APCM13OB(APCMIC,0),U,6)="A" S $P(APCMX,U,8)=APCMCYD
.D W^APCM13EH(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^APCM13EH(X,0,1,APCMPTYP)
D W^APCM13EH("Indian Health Service RPMS Suite (BCER) v1.0",1,2,APCMPTYP)
I APCMRPTT=1 D W^APCM13EH("** IHS 2013 Stage 1 Meaningful Use Performance Measure Report for EPs **",1,1,APCMPTYP)
I APCMRPTT=2 D W^APCM13EH("** IHS 2013 Stage 1 MU Performance Report for Eligible Hospitals/CAHs **",1,1,APCMPTYP)
I $G(APCMPROV),APCMRPTT=1 S X="Provider Name: "_$$SN^APCM13EH($P(^VA(200,APCMPROV,0),U,1)) D W^APCM13EH(X,1,1,APCMPTYP)
I $G(APCMPROV),APCMRPTT=2 S X="Facility: "_$P(^DIC(4,APCMPROV,0),U,1) D W^APCM13EH(X,1,1,APCMPTYP)
S X="Report Period: "_$$FMTE^XLFDT(APCMBD)_" to "_$$FMTE^XLFDT(APCMED) D W^APCM13EH(X,1,1,APCMPTYP)
I $G(APCMWPP) S X="Previous Period: "_$$FMTE^XLFDT(APCMPBD)_" to "_$$FMTE^XLFDT(APCMPED) D W^APCM13EH(X,1,1,APCMPTYP)
S X=$$REPEAT^XLFSTR("-",80) D W^APCM13EH(X,0,1,APCMPTYP)
D W^APCM13EH("STAGE 1 "_$S(APCMRPTT=1:"EP ",1:"HOSPITAL ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY",1,1,APCMPTYP)
;I '$G(APCMTOT) D W^APCM13EH("Provider: "_APCMPNAM,0,2,APCMPTYP)
I $G(APCMTOT) D
.K K S X=0 F S X=$O(APCMPRV(X)) Q:X'=+X S K($P(^VA(200,X,0),U,1))=""
.S C=0,T=3,X="",Y=""
.F S X=$O(K(X)) Q:X="" D
..I Y="" S $E(Y,3)=X Q
..I Y]"" S $E(Y,40)=X D W^APCM13EH(Y,0,1,APCMPTYP) S Y=""
.I Y]"" D W^APCM13EH(Y,0,1,APCMPTYP)
S X=$$REPEAT^XLFSTR("-",80) D W^APCM13EH(X,0,1,APCMPTYP)
;S X="",$E(X,40)="Current",$E(X,52)="Previous",$E(X,64)="Stage 1" D W^APCM13EH(X,0,1,APCMPTYP)
S X="",$E(X,28)="Excl",$E(X,37)="#",$E(X,46)="#",$E(X,51)="Current",$E(X,61)="Prev",$E(X,67)="Stage 1",$E(X,75)="Attest" D W^APCM13EH(X,0,1,APCMPTYP)
S X="",X="Performance Measures",$E(X,30)="?",$E(X,36)="Den",$E(X,45)="Num",$E(X,51)="Period",$E(X,60)="Period",$E(X,67)="Target",$E(X,77)="?" D W^APCM13EH(X,0,1,APCMPTYP)
D W^APCM13EH($$REPEAT^XLFSTR("-",80),0,1,APCMPTYP)
I APCMRPTT=1 S X=$S(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 10 including at least one public",1:"CORE SET MEASURES (EPs must meet all 13)") D W^APCM13EH(X,0,1,APCMPTYP)
I APCMRPTT=1 S X=$S(APCMCM="M":"health measure (*))",1:"") D W^APCM13EH(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^APCM13EH(X,0,1,APCMPTYP)
I APCMRPTT=2 S X=$S(APCMCM="M":"health measure (*))",1:"") D W^APCM13EH(X,0,1,APCMPTYP)
Q
APCM13ER ;IHS/CMI/LAB - IHS MU REPORT;
+1 ;;1.0;IHS MU PERFORMANCE REPORTS;**2,4,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 ;SPDX
SET APCMPRN=$$V(2,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+3 ;no % on attestation measures
IF $PIECE(^APCM13OB(APCMIC,0),U,6)="A"
QUIT
+4 SET APCMCYP=$SELECT(APCMCYD:((APCMCYN/APCMCYD)*100),1:"")
+5 SET APCMPRP=$SELECT(APCMPRD:((APCMPRN/APCMPRD)*100),1:"")
+6 QUIT
+7 ;
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 K="T"
SET I="TOTAL"
+5 IF T=1
Begin DoDot:1
+6 SET J=$ORDER(^APCMM13C(R,$SELECT(K="I":11,1:12),"B",I,0))
+7 IF 'J
SET X=0
QUIT
+8 SET X=$PIECE($GET(^APCMM13C(R,$SELECT(K="I":11,1:12),J,N)),U,P)
End DoDot:1
QUIT X
+9 IF T=2
Begin DoDot:1
+10 SET J=$ORDER(^APCMM13P(R,$SELECT(K="I":11,1:12),"B",I,0))
+11 IF 'J
SET X=0
QUIT
+12 SET X=$PIECE($GET(^APCMM13P(R,$SELECT(K="I":11,1:12),J,N)),U,P)
End DoDot:1
QUIT X
+13 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^APCM13EH(" ",0,0,APCMPTYP)
Begin DoDot:2
+9 ; At least one must be",0,1,APCMPTYP),W^APCM13EH("selected in the Menu Set options.",0,1,APCMPTYP),W^APCM13EH(" ",0,1,APCMPTYP),W^APCM13EH(" ",0,1,APCMPTYP)
DO W^APCM13EH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP)
End DoDot:2
End DoDot:1
+10 QUIT
SUMHOS ;
+1 SET APCMPNAM=$PIECE(^DIC(4,APCMFAC,0),U,1)
+2 SET APCMPROV=APCMFAC
+3 ;,W^APCM13EH("selected in the Menu Set options.",0,1,APCMPTYP),W^APCM13EH(" ",0,1,APCMPTYP)
DO SUM1
DO W^APCM13EH("* Indicates Public Health Performance Measure.",0,1,APCMPTYP)
+4 QUIT
+5 ;
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(^APCM13OB(X,0),U,3)
+4 SET O=$PIECE(^APCM13OB(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^APCM13EH("Indian Health Service RPMS Suite (BCER) v1.0",0,2,APCMPTYP)
+10 SET X="STAGE 1 "_$SELECT(APCMRPTT=1:"EP ",1:"HOSPITAL ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY"
DO W^APCM13EH(X,0,1,APCMPTYP)
+11 SET X="Summary Report for "_APCMPNAM
DO W^APCM13EH(X,0,2,APCMPTYP)
+12 SET X="^Excl^#^#^Current^Prev^Stage 1^Attest"
DO W^APCM13EH(X,0,2,APCMPTYP)
+13 SET X="Performance Measure^?^Den^Num^Period^Period^Target^?"
DO W^APCM13EH(X,0,1,APCMPTYP)
+14 IF APCMRPTT=1
SET X=$SELECT(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 10 including at least one public health",1:"CORE SET MEASURES (EPs must meet all 13)")
DO W^APCM13EH(X,0,2,APCMPTYP)
+15 IF APCMRPTT=1
SET X=$SELECT(APCMCM="M":"measure (*))",1:"")
DO W^APCM13EH(X,0,1,APCMPTYP)
+16 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^APCM13EH(X,0,2,APCMPTYP)
+17 IF APCMRPTT=2
SET X=$SELECT(APCMCM="M":"measure (*))",1:"")
DO W^APCM13EH(X,0,1,APCMPTYP)
End DoDot:1
+18 SET APCMCM=""
FOR
SET APCMCM=$ORDER(APCMINDO(APCMCM))
IF APCMCM=""!(APCMQUIT)
QUIT
Begin DoDot:1
+19 ; W^APCM13EH("MENU SET MEASURES",0,2,APCMPTYP)
IF APCMCM="M"
Begin DoDot:2
+20 IF APCMRPTT=1
SET X=$SELECT(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 10 including at least one public",1:"CORE SET MEASURES (EPs must meet all 13)")
DO W^APCM13EH(X,0,2,APCMPTYP)
+21 IF APCMRPTT=1
SET X=$SELECT(APCMCM="M":"health measure (*))",1:"")
DO W^APCM13EH(X,0,1,APCMPTYP)
+22 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^APCM13EH(X,0,2,APCMPTYP)
+23 IF APCMRPTT=2
SET X=$SELECT(APCMCM="M":"health measure (*))",1:"")
DO W^APCM13EH(X,0,1,APCMPTYP)
End DoDot:2
+24 SET APCMMO=0
FOR
SET APCMMO=$ORDER(APCMINDO(APCMCM,APCMMO))
IF APCMMO=""!(APCMQUIT)
QUIT
Begin DoDot:2
+25 SET APCMIC=0
FOR
SET APCMIC=$ORDER(APCMINDO(APCMCM,APCMMO,APCMIC))
IF APCMIC=""!(APCMQUIT)
QUIT
DO SUM2
End DoDot:2
End DoDot:1
+26 DO W^APCM13EH(" ",0,1,APCMPTYP)
+27 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 ;I APCMPTYP="D" D W^APCM13EH(" ",0,2,APCMPTYP)
+4 SET APCMDF=$PIECE(^APCM13OB(APCMIC,0),U,8)
+5 ;get NUMERATOR value
+6 SET APCMNP=$PIECE(^DD(9001301.0311,APCMDF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+7 SET APCMCYD=$$V(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+8 SET APCMPRD=$$V(2,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+9 IF $PIECE(^APCM13OB(APCMIC,0),U,6)="A"
SET (APCMPRN,APCMCYN)=""
GOTO WSUM
+10 ;numerator field
SET APCMNF=$PIECE(^APCM13OB(APCMIC,0),U,9)
+11 SET APCMNP=$PIECE(^DD(9001301.0311,APCMNF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+12 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 DO W^APCM13EH($SELECT($LENGTH(APCMMO)=1:" "_APCMMO,1:APCMMO)_". "_$EXTRACT($PIECE(^APCM13OB(APCMIC,0),U,14),1,22),0,2,APCMPTYP)
+4 SET APCMEF=$PIECE(^APCM13OB(APCMIC,0),U,11)
+5 IF APCMEF]""
Begin DoDot:2
+6 SET APCMNP=$PIECE(^DD(9001301.0311,APCMEF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+7 SET APCMEV=$$V(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+8 DO W^APCM13EH($SELECT(APCMEV]"":"Yes",1:"No"),0,0,APCMPTYP,,28)
End DoDot:2
+9 ;
IF APCMEF=""
DO W^APCM13EH("N/A",0,0,APCMPTYP,,28)
+10 DO W^APCM13EH($SELECT($PIECE(^APCM13OB(APCMIC,0),U,6)="A":" N/A",1:$$C(APCMCYD,0,7)),0,0,APCMPTYP,,33)
+11 DO W^APCM13EH($SELECT($PIECE(^APCM13OB(APCMIC,0),U,6)="A":" N/A",1:$$C(APCMCYN,0,7)),0,0,APCMPTYP,,42)
+12 DO W^APCM13EH($SELECT($PIECE(^APCM13OB(APCMIC,0),U,6)="A":" N/A",1:$JUSTIFY(APCMCYP,5,1)_"%"),0,0,APCMPTYP,,51)
+13 DO W^APCM13EH($SELECT($PIECE(^APCM13OB(APCMIC,0),U,6)="A":" N/A",1:$JUSTIFY(APCMPRP,5,1)_"%"),0,0,APCMPTYP,,59)
TARGET DO W^APCM13EH($GET(^APCM13OB(APCMIC,13,1,0)),0,0,APCMPTYP,,68)
+1 IF $PIECE(^APCM13OB(APCMIC,0),U,6)'="A"
DO W^APCM13EH("N/A",0,0,APCMPTYP,,76)
+2 IF $PIECE(^APCM13OB(APCMIC,0),U,6)="A"
DO W^APCM13EH(APCMCYD,0,0,APCMPTYP,,76)
End DoDot:1
+3 IF APCMPTYP="D"
Begin DoDot:1
+4 SET APCMX=APCMMO_". "_$PIECE(^APCM13OB(APCMIC,0),U,14)
+5 SET APCMEF=$PIECE(^APCM13OB(APCMIC,0),U,11)
+6 IF APCMEF]""
Begin DoDot:2
+7 SET APCMNP=$PIECE(^DD(9001301.0311,APCMEF,0),U,4)
SET N=$PIECE(APCMNP,";")
SET P=$PIECE(APCMNP,";",2)
+8 SET APCMEV=$$V(1,APCMRPT,N,P,APCMPROV,$SELECT($GET(APCMTOT):"T",1:"I"),APCMRPTT)
+9 ;S $P(APCMX,U,2)=$S(APCMRPTT=1:"Yes",1:"No")
+10 ;IHS/CMI/LAB - fix display
SET $PIECE(APCMX,U,2)=$SELECT(APCMEV]"":"Yes",1:"No")
End DoDot:2
+11 IF APCMEF=""
SET $PIECE(APCMX,U,2)="N/A"
+12 SET $PIECE(APCMX,U,3)=$SELECT($PIECE(^APCM13OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYD)
+13 ;$S($P(^APCM13OB(APCMIC,0),U,6)="A":APCMCYD,1:$$SB($J(APCMCYP,5,1))_"%")
SET $PIECE(APCMX,U,4)=$SELECT($PIECE(^APCM13OB(APCMIC,0),U,6)="A":"N/A",1:+APCMCYN)
+14 SET $PIECE(APCMX,U,5)=$SELECT($PIECE(^APCM13OB(APCMIC,0),U,6)="A":"N/A",1:$$SB($JUSTIFY(APCMCYP,5,1))_"%")
+15 SET $PIECE(APCMX,U,6)=$SELECT($PIECE(^APCM13OB(APCMIC,0),U,6)="A":"N/A",1:$$SB($JUSTIFY(APCMPRP,5,1))_"%")
TARG SET $PIECE(APCMX,U,7)=$GET(^APCM13OB(APCMIC,13,1,0))
+1 IF $PIECE(^APCM13OB(APCMIC,0),U,6)'="A"
SET $PIECE(APCMX,U,8)="N/A"
+2 IF $PIECE(^APCM13OB(APCMIC,0),U,6)="A"
SET $PIECE(APCMX,U,8)=APCMCYD
+3 DO W^APCM13EH(APCMX,0,2,APCMPTYP,1)
End DoDot:1
+4 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^APCM13EH(X,0,1,APCMPTYP)
+3 DO W^APCM13EH("Indian Health Service RPMS Suite (BCER) v1.0",1,2,APCMPTYP)
+4 IF APCMRPTT=1
DO W^APCM13EH("** IHS 2013 Stage 1 Meaningful Use Performance Measure Report for EPs **",1,1,APCMPTYP)
+5 IF APCMRPTT=2
DO W^APCM13EH("** IHS 2013 Stage 1 MU Performance Report for Eligible Hospitals/CAHs **",1,1,APCMPTYP)
+6 IF $GET(APCMPROV)
IF APCMRPTT=1
SET X="Provider Name: "_$$SN^APCM13EH($PIECE(^VA(200,APCMPROV,0),U,1))
DO W^APCM13EH(X,1,1,APCMPTYP)
+7 IF $GET(APCMPROV)
IF APCMRPTT=2
SET X="Facility: "_$PIECE(^DIC(4,APCMPROV,0),U,1)
DO W^APCM13EH(X,1,1,APCMPTYP)
+8 SET X="Report Period: "_$$FMTE^XLFDT(APCMBD)_" to "_$$FMTE^XLFDT(APCMED)
DO W^APCM13EH(X,1,1,APCMPTYP)
+9 IF $GET(APCMWPP)
SET X="Previous Period: "_$$FMTE^XLFDT(APCMPBD)_" to "_$$FMTE^XLFDT(APCMPED)
DO W^APCM13EH(X,1,1,APCMPTYP)
+10 SET X=$$REPEAT^XLFSTR("-",80)
DO W^APCM13EH(X,0,1,APCMPTYP)
+11 DO W^APCM13EH("STAGE 1 "_$SELECT(APCMRPTT=1:"EP ",1:"HOSPITAL ")_"MEANINGFUL USE PERFORMANCE REPORT SUMMARY",1,1,APCMPTYP)
+12 ;I '$G(APCMTOT) D W^APCM13EH("Provider: "_APCMPNAM,0,2,APCMPTYP)
+13 IF $GET(APCMTOT)
Begin DoDot:1
+14 KILL K
SET X=0
FOR
SET X=$ORDER(APCMPRV(X))
IF X'=+X
QUIT
SET K($PIECE(^VA(200,X,0),U,1))=""
+15 SET C=0
SET T=3
SET X=""
SET Y=""
+16 FOR
SET X=$ORDER(K(X))
IF X=""
QUIT
Begin DoDot:2
+17 IF Y=""
SET $EXTRACT(Y,3)=X
QUIT
+18 IF Y]""
SET $EXTRACT(Y,40)=X
DO W^APCM13EH(Y,0,1,APCMPTYP)
SET Y=""
End DoDot:2
+19 IF Y]""
DO W^APCM13EH(Y,0,1,APCMPTYP)
End DoDot:1
+20 SET X=$$REPEAT^XLFSTR("-",80)
DO W^APCM13EH(X,0,1,APCMPTYP)
+21 ;S X="",$E(X,40)="Current",$E(X,52)="Previous",$E(X,64)="Stage 1" D W^APCM13EH(X,0,1,APCMPTYP)
+22 SET X=""
SET $EXTRACT(X,28)="Excl"
SET $EXTRACT(X,37)="#"
SET $EXTRACT(X,46)="#"
SET $EXTRACT(X,51)="Current"
SET $EXTRACT(X,61)="Prev"
SET $EXTRACT(X,67)="Stage 1"
SET $EXTRACT(X,75)="Attest"
DO W^APCM13EH(X,0,1,APCMPTYP)
+23 SET X=""
SET X="Performance Measures"
SET $EXTRACT(X,30)="?"
SET $EXTRACT(X,36)="Den"
SET $EXTRACT(X,45)="Num"
SET $EXTRACT(X,51)="Period"
SET $EXTRACT(X,60)="Period"
SET $EXTRACT(X,67)="Target"
SET $EXTRACT(X,77)="?"
DO W^APCM13EH(X,0,1,APCMPTYP)
+24 DO W^APCM13EH($$REPEAT^XLFSTR("-",80),0,1,APCMPTYP)
+25 IF APCMRPTT=1
SET X=$SELECT(APCMCM="M":"MENU SET MEASURES (EPs must meet 5 out of 10 including at least one public",1:"CORE SET MEASURES (EPs must meet all 13)")
DO W^APCM13EH(X,0,1,APCMPTYP)
+26 IF APCMRPTT=1
SET X=$SELECT(APCMCM="M":"health measure (*))",1:"")
DO W^APCM13EH(X,0,1,APCMPTYP)
+27 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^APCM13EH(X,0,1,APCMPTYP)
+28 IF APCMRPTT=2
SET X=$SELECT(APCMCM="M":"health measure (*))",1:"")
DO W^APCM13EH(X,0,1,APCMPTYP)
+29 QUIT