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

BGPMUPPS.m

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