BGPMUPPS ; IHS/MSC/MMT - MU Summary Page output ;08-Mar-2011 14:07;DU
;;11.1;IHS CLINICAL REPORTING SYSTEM;**1**;JUN 27, 2011;Build 106
;
;Print the summary page for all measures
SUMM ;summary print
N BGPMD,BGPDORD,BGPIND,BGPSFLG,BGPDCNT,BGPIC
S BGPIC=""
D HEADER^BGPMUPH
I BGPMUT="P" D
.D W^BGPMUPP("Eligible Professional (EP): "_$P(^VA(200,BGPPROV,0),U),0,2,BGPPTYPE)
.S X="Warning: The Meaningful Use reports do not verify that the EP selected" D W^BGPMUPP(X,0,2,BGPPTYPE)
.S X="for the reports meets the CMS EHR Incentive Program eligibility criteria." D W^BGPMUPP(X,0,1,BGPPTYPE)
.S X="The EP must make that determination." D W^BGPMUPP(X,0,1,BGPPTYPE)
.D W^BGPMUPP($TR($J("",80)," ","-"),0,2,BGPPTYPE)
.D W^BGPMUPP("MU EP CLINICAL QUALITY MEASURES PERFORMANCE SUMMARY",1,1,BGPPTYPE)
I BGPMUT="H" D
.D W^BGPMUPP($TR($J("",80)," ","-"),0,2,BGPPTYPE)
.D W^BGPMUPP("MU HOSPITAL CLINICAL QUALITY MEASURES PERFORMANCE SUMMARY",1,1,BGPPTYPE)
D SUMMHDR
I BGPMUT="P" D
.;EP Report - segregate by CORE/ALT/MENU
.K BGPSFLG
.F BGPSET="C","A","M" S BGPDORD=0 F S BGPDORD=$O(^BGPMUIND(BGPMUYF,"ADO",BGPDORD)) Q:BGPDORD'=+BGPDORD!(BGPQUIT) D
..S BGPIND=$O(^BGPMUIND(BGPMUYF,"ADO",BGPDORD,0)) Q:BGPIND=""
..I ($P(^BGPMUIND(BGPMUYF,BGPIND,0),U,4)=BGPSET)&$D(^TMP("BGPMU SUMMARY",$J,BGPIND)) D
...I '$G(BGPSFLG(BGPSET)) D
....I $Y>(BGPIOSL-5)&(BGPPTYPE'="D") D SUMMHDR2 Q:BGPQUIT
....D W^BGPMUPP($S(BGPSET="C":"CORE MEASURES",BGPSET="A":"ALTERNATE CORE MEASURES",1:"MENU SET MEASURES"),,2,BGPPTYPE)
....S BGPSFLG(BGPSET)=1
...S BGPDCNT=$$COUNT(BGPIND) ;COUNT NUMBER OF LINES NEEDED FOR THIS MEASURE'S DISPLAY
...I $Y>(BGPIOSL-BGPDCNT)&(BGPPTYPE'="D") D SUMMHDR2 Q:BGPQUIT
...S BGPMD=$G(^TMP("BGPMU SUMMARY",$J,BGPIND))
...D W^BGPMUPP($P(BGPMD,U,1),,1,BGPPTYPE)
...D W^BGPMUPP($S($P(BGPMD,U,2)="":"N/A",1:$P(BGPMD,U,2)),,0,BGPPTYPE,2,6)
...D W^BGPMUPP($E($P($G(^BGPMUIND(BGPMUYF,BGPIND,0)),U,3),1,67),,0,BGPPTYPE,3,12)
...S BGPMDORD=0 F S BGPMDORD=$O(^TMP("BGPMU SUMMARY",$J,BGPIND,BGPMDORD)) Q:BGPMDORD'=+BGPMDORD!(BGPQUIT) D
....S BGPPOPD=^TMP("BGPMU SUMMARY",$J,BGPIND,BGPMDORD)
....D W^BGPMUPP($E($P(BGPPOPD,U,2),1,35),,1,BGPPTYPE,3,12)
....D W^BGPMUPP($J($S($P(BGPPOPD,U,3)="":"0",1:$P(BGPPOPD,U,3)),3),,0,BGPPTYPE,4,48)
....D W^BGPMUPP($J($P(BGPPOPD,U,4),3),,0,BGPPTYPE,5,53)
....D W^BGPMUPP($J($P(BGPPOPD,U,5),3),,0,BGPPTYPE,6,58)
....D W^BGPMUPP($J($P(BGPPOPD,U,6),5,1)_"%",,0,BGPPTYPE,7,65)
....D W^BGPMUPP($J($P(BGPPOPD,U,14),5,1)_"%",,0,BGPPTYPE,8,73)
I BGPMUT="H" D
.;Hospital report - display in order
.S BGPDORD=0 F S BGPDORD=$O(^BGPMUIND(BGPMUYF,"ADO",BGPDORD)) Q:BGPDORD'=+BGPDORD!(BGPQUIT) D
..S BGPIND=$O(^BGPMUIND(BGPMUYF,"ADO",BGPDORD,0)) Q:BGPIND=""
..I $D(^TMP("BGPMU SUMMARY",$J,BGPIND)) D
...S BGPDCNT=$$COUNT(BGPIND) ;COUNT NUMBER OF LINES NEEDED FOR THIS MEASURE'S DISPLAY
...I $Y>(BGPIOSL-BGPDCNT)&(BGPPTYPE'="D") D SUMMHDR2 Q:BGPQUIT
...S BGPMD=$G(^TMP("BGPMU SUMMARY",$J,BGPIND))
...D W^BGPMUPP($P(BGPMD,U,1),,1,BGPPTYPE)
...;D W^BGPMUPP($P(BGPMD,U,2),,0,BGPPTYPE,2,7) ;NO PQRI numbers for Hospital measures
...D W^BGPMUPP($E($P($G(^BGPMUIND(BGPMUYF,BGPIND,0)),U,3),1,65),,0,BGPPTYPE,3,14)
...S BGPMDORD=0 F S BGPMDORD=$O(^TMP("BGPMU SUMMARY",$J,BGPIND,BGPMDORD)) Q:BGPMDORD'=+BGPMDORD!(BGPQUIT) D
....S BGPPOPD=^TMP("BGPMU SUMMARY",$J,BGPIND,BGPMDORD)
....D W^BGPMUPP($E($P(BGPPOPD,U,2),1,32),,1,BGPPTYPE,3,14)
....;Handle ED measures output differently
....I ($P(BGPMD,U,1)="0495")!($P(BGPMD,U,1)="0497") D
.....D W^BGPMUPP($J($P(BGPPOPD,U,4),5,1),,0,BGPPTYPE,7,65)
.....D W^BGPMUPP($J($P(BGPPOPD,U,5),5,1),,0,BGPPTYPE,8,73)
....E D
.....D W^BGPMUPP($J($S($P(BGPPOPD,U,3)="":"0",1:$P(BGPPOPD,U,3)),3),,0,BGPPTYPE,4,48)
.....D W^BGPMUPP($J($P(BGPPOPD,U,4),3),,0,BGPPTYPE,5,53)
.....D W^BGPMUPP($J($P(BGPPOPD,U,5),3),,0,BGPPTYPE,6,58)
.....D W^BGPMUPP($J($P(BGPPOPD,U,6),5,1)_"%",,0,BGPPTYPE,7,65)
.....D W^BGPMUPP($J($P(BGPPOPD,U,14),5,1)_"%",,0,BGPPTYPE,8,73)
K ^TMP("BGPMU SUMMARY",$J)
Q
SUMMHDR2 ; HEADER FOR 2-n PAGES OF SUMMARY PAGE
D HEADER^BGPMUPH
D SUMMHDR
Q
SUMMHDR ;
D W^BGPMUPP("#",,1,BGPPTYPE,4,48)
D W^BGPMUPP("#",,0,BGPPTYPE,5,54)
D W^BGPMUPP("#",,0,BGPPTYPE,6,59)
D W^BGPMUPP("Report",,0,BGPPTYPE,7,65)
D W^BGPMUPP("Prev",,0,BGPPTYPE,8,73)
D W^BGPMUPP("NQF",,1,BGPPTYPE)
I BGPMUT'="H" D W^BGPMUPP("PQRI",,0,BGPPTYPE,2,6)
D W^BGPMUPP("Measure",,0,BGPPTYPE,3,12)
D W^BGPMUPP("Excl",,0,BGPPTYPE,4,47)
D W^BGPMUPP("Den",,0,BGPPTYPE,5,53)
D W^BGPMUPP("Num",,0,BGPPTYPE,6,58)
D W^BGPMUPP("Period",,0,BGPPTYPE,7,65)
D W^BGPMUPP("Period",,0,BGPPTYPE,8,73)
D W^BGPMUPP($TR($J("",80)," ","-"),0,1,BGPPTYPE)
Q
COUNT(BGPIND) ;COUNT NUMBER OF LINES NEEDED FOR THIS MEASURE'S DISPLAY
N TOTAL,LINE
S TOTAL=1
S LINE=0 F S LINE=$O(^TMP("BGPMU SUMMARY",$J,BGPIND,LINE)) Q:LINE'=+LINE D
.S TOTAL=TOTAL+1
K LINE
Q TOTAL
BGPMUPPS ; IHS/MSC/MMT - MU Summary Page output ;08-Mar-2011 14:07;DU
+1 ;;11.1;IHS CLINICAL REPORTING SYSTEM;**1**;JUN 27, 2011;Build 106
+2 ;
+3 ;Print the summary page for all measures
SUMM ;summary print
+1 NEW BGPMD,BGPDORD,BGPIND,BGPSFLG,BGPDCNT,BGPIC
+2 SET BGPIC=""
+3 DO HEADER^BGPMUPH
+4 IF BGPMUT="P"
Begin DoDot:1
+5 DO W^BGPMUPP("Eligible Professional (EP): "_$PIECE(^VA(200,BGPPROV,0),U),0,2,BGPPTYPE)
+6 SET X="Warning: The Meaningful Use reports do not verify that the EP selected"
DO W^BGPMUPP(X,0,2,BGPPTYPE)
+7 SET X="for the reports meets the CMS EHR Incentive Program eligibility criteria."
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+8 SET X="The EP must make that determination."
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+9 DO W^BGPMUPP($TRANSLATE($JUSTIFY("",80)," ","-"),0,2,BGPPTYPE)
+10 DO W^BGPMUPP("MU EP CLINICAL QUALITY MEASURES PERFORMANCE SUMMARY",1,1,BGPPTYPE)
End DoDot:1
+11 IF BGPMUT="H"
Begin DoDot:1
+12 DO W^BGPMUPP($TRANSLATE($JUSTIFY("",80)," ","-"),0,2,BGPPTYPE)
+13 DO W^BGPMUPP("MU HOSPITAL CLINICAL QUALITY MEASURES PERFORMANCE SUMMARY",1,1,BGPPTYPE)
End DoDot:1
+14 DO SUMMHDR
+15 IF BGPMUT="P"
Begin DoDot:1
+16 ;EP Report - segregate by CORE/ALT/MENU
+17 KILL BGPSFLG
+18 FOR BGPSET="C","A","M"
SET BGPDORD=0
FOR
SET BGPDORD=$ORDER(^BGPMUIND(BGPMUYF,"ADO",BGPDORD))
IF BGPDORD'=+BGPDORD!(BGPQUIT)
QUIT
Begin DoDot:2
+19 SET BGPIND=$ORDER(^BGPMUIND(BGPMUYF,"ADO",BGPDORD,0))
IF BGPIND=""
QUIT
+20 IF ($PIECE(^BGPMUIND(BGPMUYF,BGPIND,0),U,4)=BGPSET)&$DATA(^TMP("BGPMU SUMMARY",$JOB,BGPIND))
Begin DoDot:3
+21 IF '$GET(BGPSFLG(BGPSET))
Begin DoDot:4
+22 IF $Y>(BGPIOSL-5)&(BGPPTYPE'="D")
DO SUMMHDR2
IF BGPQUIT
QUIT
+23 DO W^BGPMUPP($SELECT(BGPSET="C":"CORE MEASURES",BGPSET="A":"ALTERNATE CORE MEASURES",1:"MENU SET MEASURES"),,2,BGPPTYPE)
+24 SET BGPSFLG(BGPSET)=1
End DoDot:4
+25 ;COUNT NUMBER OF LINES NEEDED FOR THIS MEASURE'S DISPLAY
SET BGPDCNT=$$COUNT(BGPIND)
+26 IF $Y>(BGPIOSL-BGPDCNT)&(BGPPTYPE'="D")
DO SUMMHDR2
IF BGPQUIT
QUIT
+27 SET BGPMD=$GET(^TMP("BGPMU SUMMARY",$JOB,BGPIND))
+28 DO W^BGPMUPP($PIECE(BGPMD,U,1),,1,BGPPTYPE)
+29 DO W^BGPMUPP($SELECT($PIECE(BGPMD,U,2)="":"N/A",1:$PIECE(BGPMD,U,2)),,0,BGPPTYPE,2,6)
+30 DO W^BGPMUPP($EXTRACT($PIECE($GET(^BGPMUIND(BGPMUYF,BGPIND,0)),U,3),1,67),,0,BGPPTYPE,3,12)
+31 SET BGPMDORD=0
FOR
SET BGPMDORD=$ORDER(^TMP("BGPMU SUMMARY",$JOB,BGPIND,BGPMDORD))
IF BGPMDORD'=+BGPMDORD!(BGPQUIT)
QUIT
Begin DoDot:4
+32 SET BGPPOPD=^TMP("BGPMU SUMMARY",$JOB,BGPIND,BGPMDORD)
+33 DO W^BGPMUPP($EXTRACT($PIECE(BGPPOPD,U,2),1,35),,1,BGPPTYPE,3,12)
+34 DO W^BGPMUPP($JUSTIFY($SELECT($PIECE(BGPPOPD,U,3)="":"0",1:$PIECE(BGPPOPD,U,3)),3),,0,BGPPTYPE,4,48)
+35 DO W^BGPMUPP($JUSTIFY($PIECE(BGPPOPD,U,4),3),,0,BGPPTYPE,5,53)
+36 DO W^BGPMUPP($JUSTIFY($PIECE(BGPPOPD,U,5),3),,0,BGPPTYPE,6,58)
+37 DO W^BGPMUPP($JUSTIFY($PIECE(BGPPOPD,U,6),5,1)_"%",,0,BGPPTYPE,7,65)
+38 DO W^BGPMUPP($JUSTIFY($PIECE(BGPPOPD,U,14),5,1)_"%",,0,BGPPTYPE,8,73)
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+39 IF BGPMUT="H"
Begin DoDot:1
+40 ;Hospital report - display in order
+41 SET BGPDORD=0
FOR
SET BGPDORD=$ORDER(^BGPMUIND(BGPMUYF,"ADO",BGPDORD))
IF BGPDORD'=+BGPDORD!(BGPQUIT)
QUIT
Begin DoDot:2
+42 SET BGPIND=$ORDER(^BGPMUIND(BGPMUYF,"ADO",BGPDORD,0))
IF BGPIND=""
QUIT
+43 IF $DATA(^TMP("BGPMU SUMMARY",$JOB,BGPIND))
Begin DoDot:3
+44 ;COUNT NUMBER OF LINES NEEDED FOR THIS MEASURE'S DISPLAY
SET BGPDCNT=$$COUNT(BGPIND)
+45 IF $Y>(BGPIOSL-BGPDCNT)&(BGPPTYPE'="D")
DO SUMMHDR2
IF BGPQUIT
QUIT
+46 SET BGPMD=$GET(^TMP("BGPMU SUMMARY",$JOB,BGPIND))
+47 DO W^BGPMUPP($PIECE(BGPMD,U,1),,1,BGPPTYPE)
+48 ;D W^BGPMUPP($P(BGPMD,U,2),,0,BGPPTYPE,2,7) ;NO PQRI numbers for Hospital measures
+49 DO W^BGPMUPP($EXTRACT($PIECE($GET(^BGPMUIND(BGPMUYF,BGPIND,0)),U,3),1,65),,0,BGPPTYPE,3,14)
+50 SET BGPMDORD=0
FOR
SET BGPMDORD=$ORDER(^TMP("BGPMU SUMMARY",$JOB,BGPIND,BGPMDORD))
IF BGPMDORD'=+BGPMDORD!(BGPQUIT)
QUIT
Begin DoDot:4
+51 SET BGPPOPD=^TMP("BGPMU SUMMARY",$JOB,BGPIND,BGPMDORD)
+52 DO W^BGPMUPP($EXTRACT($PIECE(BGPPOPD,U,2),1,32),,1,BGPPTYPE,3,14)
+53 ;Handle ED measures output differently
+54 IF ($PIECE(BGPMD,U,1)="0495")!($PIECE(BGPMD,U,1)="0497")
Begin DoDot:5
+55 DO W^BGPMUPP($JUSTIFY($PIECE(BGPPOPD,U,4),5,1),,0,BGPPTYPE,7,65)
+56 DO W^BGPMUPP($JUSTIFY($PIECE(BGPPOPD,U,5),5,1),,0,BGPPTYPE,8,73)
End DoDot:5
+57 IF '$TEST
Begin DoDot:5
+58 DO W^BGPMUPP($JUSTIFY($SELECT($PIECE(BGPPOPD,U,3)="":"0",1:$PIECE(BGPPOPD,U,3)),3),,0,BGPPTYPE,4,48)
+59 DO W^BGPMUPP($JUSTIFY($PIECE(BGPPOPD,U,4),3),,0,BGPPTYPE,5,53)
+60 DO W^BGPMUPP($JUSTIFY($PIECE(BGPPOPD,U,5),3),,0,BGPPTYPE,6,58)
+61 DO W^BGPMUPP($JUSTIFY($PIECE(BGPPOPD,U,6),5,1)_"%",,0,BGPPTYPE,7,65)
+62 DO W^BGPMUPP($JUSTIFY($PIECE(BGPPOPD,U,14),5,1)_"%",,0,BGPPTYPE,8,73)
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+63 KILL ^TMP("BGPMU SUMMARY",$JOB)
+64 QUIT
SUMMHDR2 ; HEADER FOR 2-n PAGES OF SUMMARY PAGE
+1 DO HEADER^BGPMUPH
+2 DO SUMMHDR
+3 QUIT
SUMMHDR ;
+1 DO W^BGPMUPP("#",,1,BGPPTYPE,4,48)
+2 DO W^BGPMUPP("#",,0,BGPPTYPE,5,54)
+3 DO W^BGPMUPP("#",,0,BGPPTYPE,6,59)
+4 DO W^BGPMUPP("Report",,0,BGPPTYPE,7,65)
+5 DO W^BGPMUPP("Prev",,0,BGPPTYPE,8,73)
+6 DO W^BGPMUPP("NQF",,1,BGPPTYPE)
+7 IF BGPMUT'="H"
DO W^BGPMUPP("PQRI",,0,BGPPTYPE,2,6)
+8 DO W^BGPMUPP("Measure",,0,BGPPTYPE,3,12)
+9 DO W^BGPMUPP("Excl",,0,BGPPTYPE,4,47)
+10 DO W^BGPMUPP("Den",,0,BGPPTYPE,5,53)
+11 DO W^BGPMUPP("Num",,0,BGPPTYPE,6,58)
+12 DO W^BGPMUPP("Period",,0,BGPPTYPE,7,65)
+13 DO W^BGPMUPP("Period",,0,BGPPTYPE,8,73)
+14 DO W^BGPMUPP($TRANSLATE($JUSTIFY("",80)," ","-"),0,1,BGPPTYPE)
+15 QUIT
COUNT(BGPIND) ;COUNT NUMBER OF LINES NEEDED FOR THIS MEASURE'S DISPLAY
+1 NEW TOTAL,LINE
+2 SET TOTAL=1
+3 SET LINE=0
FOR
SET LINE=$ORDER(^TMP("BGPMU SUMMARY",$JOB,BGPIND,LINE))
IF LINE'=+LINE
QUIT
Begin DoDot:1
+4 SET TOTAL=TOTAL+1
End DoDot:1
+5 KILL LINE
+6 QUIT TOTAL