BGPMUDEL ; IHS/MSC/MGH - MU Delimited output ;02-Mar-2011 14:38;DU
;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
;
;
PRINT1 ;EP
N BGPGDEV,BGPDEVOR,BGPIC
S BGPGDEV=1
D HEADER
S BGPDEVOR=0 F S BGPDEVOR=$O(^BGPMUIND(BGPMUYF,"ADO",BGPDEVOR)) Q:BGPDEVOR'=+BGPDEVOR!(BGPQUIT) D
.S BGPIC=$O(^BGPMUIND(BGPMUYF,"ADO",BGPDEVOR,0)) Q:BGPIC=""
.I $D(BGPIND(BGPIC)) D PRINT2
.Q:BGPQUIT
K BGPGDEV
PRINTSUM ; Print summary page of all measure calculations
D ^BGPMUPPS
Q
;
SAVEDEL ;EP
;If screen selected do screen
N X,C
I BGPDELT="S" D SCREEN,EXIT Q
;call xbgsave to create output file
S XBGL="BGPDATA"
L +^BGPDATA:300 E W:'$D(ZTQUEUED) "Unable to lock global" Q
K ^TMP($J,"SUMMARYDEL")
K ^BGPDATA($J) ;global for saving
S X=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X I ^TMP($J,"BGPDEL",X)'="ENDCOVERPAGE" S ^BGPDATA($J,X)=^TMP($J,"BGPDEL",X)
I '$D(BGPGUI) D
.S XBFLT=1,XBFN=BGPDELF_".txt",XBMED="F",XBTLE="MEANINGFUL USE 2011 DELIMITED OUTPUT",XBQ="N",XBF=0
.D ^XBGSAVE
.K XBFLT,XBFN,XBMED,XBTLE,XBE,XBF,X
I $D(BGPGUI) D
.S (C,X)=0 F S X=$O(^BGPDATA($J,X)) Q:X'=+X S C=C+1,^BGPGUIW(BGPGIEN,12,C,0)=^BGPDATA($J,X)
.S ^BGPGUIW(BGPGIEN,12,0)="^90546.1912^"_C_"^"_C_"^"_DT
L -^BGPDATA
K ^BGPDATA($J) ;export global
D EXIT
Q
SCREEN ;
S X=0 F S X=$O(^TMP($J,"BGPDEL",X)) Q:X'=+X W:^TMP($J,"BGPDEL",X)'="ENDCOVERPAGE" !,^TMP($J,"BGPDEL",X)
Q
PRINT3 ;
Q
PRINT2 ;
N X,BGPZ,BGPNODE
S BGPGPG=0
;quit if no delimited output routine defined
I '$D(^BGPMUIND(BGPMUYF,BGPIC,4)) S X="Delimited file output not currently supported for this measure" D S(X,1,1) Q
S X=$P(^BGPMUIND(BGPMUYF,BGPIC,0),U,3) D S(X,2,1)
;Print out the description node if there is data in it
S BGPNODE=12 I $D(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10 D
.S X="Measure Summary:" D S(X,2,1)
.S BGPZ=0 F S BGPZ=$O(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ)) Q:'BGPZ D
..S X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0) D S(X,1,1)
;Print out the population node if there is data in it
S BGPNODE=13 I $D(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10 D
.S X="Population:" D S(X,1,1)
.S BGPZ=0 F S BGPZ=$O(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ)) Q:'BGPZ D
..S X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0) D S(X,1,1)
S X="Logic:" D S(X,2,1)
;Print out the denominator node if there is data in it
S BGPNODE=14 I $D(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10 D
.S X="Denominator Logic:" D S(X,2,1)
.S X="" D S(X,1,1)
.S BGPZ=0 F S BGPZ=$O(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ)) Q:'BGPZ D
..S X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0) D S(X,1,1)
I $G(BGPMUT)'="H" D
.;Print out the numerator node if there is data in it
.S BGPNODE=15 I $D(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10 D
..S X="Numerator Logic:" D S(X,2,1)
..S X="" D S(X,1,1)
..S BGPZ=0 F S BGPZ=$O(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ)) Q:'BGPZ D
...S X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0) D S(X,1,1)
.;Print out the logic node if there is data in it
.S BGPNODE=16 I $D(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10 D
..S X="Exclusion Logic:" D S(X,2,1)
..S X="" D S(X,1,1)
..S BGPZ=0 F S BGPZ=$O(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ)) Q:'BGPZ D
...S X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0) D S(X,1,1)
I $G(BGPMUT)="H" D
.;Print out the logic node if there is data in it
.S BGPNODE=16 I $D(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10 D
..S X="Denominator Exclusion Logic:" D S(X,2,1)
..S X="" D S(X,1,1)
..S BGPZ=0 F S BGPZ=$O(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ)) Q:'BGPZ D
...S X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0) D S(X,1,1)
.;Print out the numerator node if there is data in it
.S BGPNODE=15 I $D(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10 D
..S X="Numerator Logic:" D S(X,2,1)
..S X="" D S(X,1,1)
..S BGPZ=0 F S BGPZ=$O(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ)) Q:'BGPZ D
...S X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0) D S(X,1,1)
;Print out the Performance node if there is data in it
S BGPNODE=17 I $D(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10 D
.S X="Performance:" D S(X,2,1)
.S BGPZ=0 F S BGPZ=$O(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ)) Q:'BGPZ D
..S X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0) D S(X,1,1)
;Print out the source node if there is data in it
S BGPNODE=18 I $D(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10 D
.S X="Measure Source:"
.S BGPZ=0 F S BGPZ=$O(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ)) Q:'BGPZ D
..S X=X_" "_^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0)
.D S(X,2,1)
CALC X ^BGPMUIND(BGPMUYF,BGPIC,4)
Q
S Y="Cover Page" D S(Y,1,1)
S Y="*** IHS Stage 1 Meaningful Use ***" D S(Y,2,1)
S Y="*** "_$S($G(BGPMUT)'="H":"Eligible Professional (EP)",1:"Hospital")_" Clinical Quality Measures Report ***" D S(Y,1,1)
S Y="CRS 2014, Version 14.1 Patch 1" D S(Y,1,1)
S Y="Date Report Run: "_$$FMTE^XLFDT(DT) D S(Y,1,1)
S Y="Site where Run: "_$P(^DIC(4,DUZ(2),0),U) D S(Y,1,1)
S Y="Report Generated by: "_$P($G(^VA(200,DUZ,0)),U,1) D S(Y,1,1)
S Y="Report Period: "_$$FMTE^XLFDT(BGPBD)_" to "_$$FMTE^XLFDT(BGPED) D S(Y,1,1)
S Y="Previous Period: "_$$FMTE^XLFDT(BGPPBD)_" to "_$$FMTE^XLFDT(BGPPED) D S(Y,1,1)
S Y="Baseline Period: "_$$FMTE^XLFDT(BGPBBD)_" to "_$$FMTE^XLFDT(BGPBED) D S(Y,1,1)
S Y="" D S(Y,1,1)
I $G(BGPMUT)'="H" S Y="Measures: Stage 1 Meaningful Use Eligible Professional (EP) "_$S(BGPINDT="C":"Core Measures",BGPINDT="A":"Alternate Core",BGPINDT="M":"Menu Set Measures",1:"Selected Measures") D S(Y,1,1)
I $G(BGPMUT)="H" D
.S Y="Measures: Stage 1 Meaningful Use Eligible Hospital (EH) and" D S(Y,1,1)
.S Y="Critical Access Hospital (CAH) Clinical Quality Measures" D S(Y,1,1)
I $G(BGPMUT)="P" S Y="Population: "_$S(BGPBEN=1:"AI/AN Only",BGPBEN=2:"Non-AI/AN",BGPBEN=3:"All Patients",1:"") D S(Y,2,1)
I $G(BGPMUT)'="H" D
.S Y="Eligible Professional (EP): "_$P(^VA(200,BGPPROV,0),U) D S(Y,2,1)
I $G(BGPMUT)="H" D
.S Y="Population: "_$S(BGPBEN=1:"AI/AN Only",BGPBEN=2:"Non-AI/AN",BGPBEN=3:"All Patients",1:"")
.D S(Y,2,1)
.S Y="Eligible Hospital: "_$$LOC^BGPMUEH()_", "_$$GET1^DIQ(4,DUZ(2)_",",1.03)_", "_$$GET1^DIQ(4,DUZ(2)_",",.02)
.D S(Y,1,1)
D ENDTIME
I $G(BGPMUT)'="H" D
.S Y="Warning: The Meaningful Use reports do not verify that the EP selected for" D S(Y,2,1)
.S Y="the reports meets the CMS EHR Incentive Program eligibility criteria. The" D S(Y,1,1)
.S Y="EP must make that determination." D S(Y,1,1)
I $G(BGPMUT)'="H" D
.S Y="This report includes the EP "_$S(BGPINDT="C":"core",BGPINDT="A":"alternate",BGPINDT="M":"menu set",1:"selected")_" clinical quality measures for" D S(Y,2,1)
.S Y="Stage 1 Meaningful Use." D S(Y,1,1)
I $G(BGPMUT)="H" D
.S Y="This report includes the eligible hospital and critical access hospital" D S(Y,2,1)
.S Y="clinical quality measures for Stage 1 Meaningful Use." D S(Y,1,1)
I $G(BGPMUT)'="H" D
.S Y="For the first Meaningful Use payment year, the reporting period is any" D S(Y,2,1)
.S Y="consecutive 90-days during a calendar year (Jan 1- Dec 31). For all" D S(Y,1,1)
.S Y="subsequent years, the reporting period is the entire calendar year." D S(Y,1,1)
I $G(BGPMUT)="H" D
.S Y="For the first Meaningful Use payment year, the reporting period is any" D S(Y,2,1)
.S Y="consecutive 90-days during a federal fiscal year (Oct 1 - Sep 30). For all" D S(Y,1,1)
.S Y="subsequent years, the reporting period is the entire federal fiscal year." D S(Y,1,1)
;
S Y="The report will provide a description of the measure, and explanations for" D S(Y,2,1)
S Y="the denominator(s), numerator(s) and exclusions (if applicable)" D S(Y,1,1)
S Y="and the measure logic." D S(Y,1,1)
S Y="The measure results are contained in tabular form with the following column" D S(Y,2,1)
S Y="headings:" D S(Y,1,1)
S Y="REPORT % PREV YR % CHG FROM BASE % CHG" D S(Y,1,1)
S Y="PERIOD PERIOD PREV YR YR BASE %" D S(Y,1,1)
I $G(BGPMUT)'="H" D
.S Y="When a report is run for a 90-day period, the PREV YR PERIOD is the same 90-day" D S(Y,2,1)
.S Y="period for the previous calendar year and the BASE YR is the same 90-day period" D S(Y,1,1)
.S Y="for the base calendar year selected. For example, a report run with Apr 1, 2010" D S(Y,1,1)
.S Y="through Jun 30, 2010 as the REPORT PERIOD and a base year of 2008 will include" D S(Y,1,1)
.S Y="data from Apr 1, 2009 through Jun 30, 2009 in the PREV YR PERIOD and Apr 1, 2008" D S(Y,1,1)
.S Y="through Jun 30, 2008 in the BASE YR." D S(Y,1,1)
I $G(BGPMUT)="H" D
.S Y="When a report is run for a 90-day period, the PREV YR PERIOD is the same 90-day" D S(Y,2,1)
.S Y="period for the previous fiscal year and the BASE YR is the same 90-day" D S(Y,1,1)
.S Y="period for the base fiscal year selected. For example, a report run" D S(Y,1,1)
.S Y="with Apr 1, 2010 through Jun 30, 2010 as the REPORT PERIOD and a base year of" D S(Y,1,1)
.S Y="2008 will include data from Apr 1, 2009 through Jun 30, 2009 in the PREV YR" D S(Y,1,1)
.S Y="PERIOD and Apr 1, 2008 through Jun 30, 2008 in the BASE YR." D S(Y,1,1)
Q
EXIT ;
K ^TMP($J)
Q
ENDTIME ;
I $D(BGPET) S BGPTS=(86400*($P(BGPET,",")-$P(BGPBT,",")))+($P(BGPET,",",2)-$P(BGPBT,",",2)),BGPHR=$P(BGPTS/3600,".") S:BGPHR="" BGPHR=0 D
.S BGPTS=BGPTS-(BGPHR*3600),BGPM=$P(BGPTS/60,".") S:BGPM="" BGPM=0 S BGPTS=BGPTS-(BGPM*60),BGPS=BGPTS S X="RUN TIME (H.M.S): "_BGPHR_"."_BGPM_"."_BGPS D S(X,2,1)
Q
CTR(X,Y) ;EP - Center
Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
;----------
USR() ;EP - Return user
Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
;----------
S(Y,F,P) ;EP set up array
I '$G(F) S F=0
NEW %,Z
S Z=""
S %=$P($G(^TMP($J,"BGPDEL",0)),U)
F Z=1:1:F S %=%+1 S ^TMP($J,"BGPDEL",%)=""
S $P(^TMP($J,"BGPDEL",0),U)=%
I '$D(^TMP($J,"BGPDEL",%)) S ^TMP($J,"BGPDEL",%)=""
S $P(^TMP($J,"BGPDEL",%),U,P)=Y
Q
C(X,X2,X3) ;
D COMMA^%DTC
Q X
BGPMUDEL ; IHS/MSC/MGH - MU Delimited output ;02-Mar-2011 14:38;DU
+1 ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
+2 ;
+3 ;
PRINT1 ;EP
+1 NEW BGPGDEV,BGPDEVOR,BGPIC
+2 SET BGPGDEV=1
+3 DO HEADER
+4 SET BGPDEVOR=0
FOR
SET BGPDEVOR=$ORDER(^BGPMUIND(BGPMUYF,"ADO",BGPDEVOR))
IF BGPDEVOR'=+BGPDEVOR!(BGPQUIT)
QUIT
Begin DoDot:1
+5 SET BGPIC=$ORDER(^BGPMUIND(BGPMUYF,"ADO",BGPDEVOR,0))
IF BGPIC=""
QUIT
+6 IF $DATA(BGPIND(BGPIC))
DO PRINT2
+7 IF BGPQUIT
QUIT
End DoDot:1
+8 KILL BGPGDEV
PRINTSUM ; Print summary page of all measure calculations
+1 DO ^BGPMUPPS
+2 QUIT
+3 ;
SAVEDEL ;EP
+1 ;If screen selected do screen
+2 NEW X,C
+3 IF BGPDELT="S"
DO SCREEN
DO EXIT
QUIT
+4 ;call xbgsave to create output file
+5 SET XBGL="BGPDATA"
+6 LOCK +^BGPDATA:300
IF '$TEST
IF '$DATA(ZTQUEUED)
WRITE "Unable to lock global"
QUIT
+7 KILL ^TMP($JOB,"SUMMARYDEL")
+8 ;global for saving
KILL ^BGPDATA($JOB)
+9 SET X=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X
QUIT
IF ^TMP($JOB,"BGPDEL",X)'="ENDCOVERPAGE"
SET ^BGPDATA($JOB,X)=^TMP($JOB,"BGPDEL",X)
+10 IF '$DATA(BGPGUI)
Begin DoDot:1
+11 SET XBFLT=1
SET XBFN=BGPDELF_".txt"
SET XBMED="F"
SET XBTLE="MEANINGFUL USE 2011 DELIMITED OUTPUT"
SET XBQ="N"
SET XBF=0
+12 DO ^XBGSAVE
+13 KILL XBFLT,XBFN,XBMED,XBTLE,XBE,XBF,X
End DoDot:1
+14 IF $DATA(BGPGUI)
Begin DoDot:1
+15 SET (C,X)=0
FOR
SET X=$ORDER(^BGPDATA($JOB,X))
IF X'=+X
QUIT
SET C=C+1
SET ^BGPGUIW(BGPGIEN,12,C,0)=^BGPDATA($JOB,X)
+16 SET ^BGPGUIW(BGPGIEN,12,0)="^90546.1912^"_C_"^"_C_"^"_DT
End DoDot:1
+17 LOCK -^BGPDATA
+18 ;export global
KILL ^BGPDATA($JOB)
+19 DO EXIT
+20 QUIT
SCREEN ;
+1 SET X=0
FOR
SET X=$ORDER(^TMP($JOB,"BGPDEL",X))
IF X'=+X
QUIT
IF ^TMP($JOB,"BGPDEL",X)'="ENDCOVERPAGE"
WRITE !,^TMP($JOB,"BGPDEL",X)
+2 QUIT
PRINT3 ;
+1 QUIT
PRINT2 ;
+1 NEW X,BGPZ,BGPNODE
+2 SET BGPGPG=0
+3 ;quit if no delimited output routine defined
+4 IF '$DATA(^BGPMUIND(BGPMUYF,BGPIC,4))
SET X="Delimited file output not currently supported for this measure"
DO S(X,1,1)
QUIT
+5 SET X=$PIECE(^BGPMUIND(BGPMUYF,BGPIC,0),U,3)
DO S(X,2,1)
+6 ;Print out the description node if there is data in it
+7 SET BGPNODE=12
IF $DATA(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10
Begin DoDot:1
+8 SET X="Measure Summary:"
DO S(X,2,1)
+9 SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ))
IF 'BGPZ
QUIT
Begin DoDot:2
+10 SET X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0)
DO S(X,1,1)
End DoDot:2
End DoDot:1
+11 ;Print out the population node if there is data in it
+12 SET BGPNODE=13
IF $DATA(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10
Begin DoDot:1
+13 SET X="Population:"
DO S(X,1,1)
+14 SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ))
IF 'BGPZ
QUIT
Begin DoDot:2
+15 SET X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0)
DO S(X,1,1)
End DoDot:2
End DoDot:1
+16 SET X="Logic:"
DO S(X,2,1)
+17 ;Print out the denominator node if there is data in it
+18 SET BGPNODE=14
IF $DATA(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10
Begin DoDot:1
+19 SET X="Denominator Logic:"
DO S(X,2,1)
+20 SET X=""
DO S(X,1,1)
+21 SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ))
IF 'BGPZ
QUIT
Begin DoDot:2
+22 SET X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0)
DO S(X,1,1)
End DoDot:2
End DoDot:1
+23 IF $GET(BGPMUT)'="H"
Begin DoDot:1
+24 ;Print out the numerator node if there is data in it
+25 SET BGPNODE=15
IF $DATA(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10
Begin DoDot:2
+26 SET X="Numerator Logic:"
DO S(X,2,1)
+27 SET X=""
DO S(X,1,1)
+28 SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ))
IF 'BGPZ
QUIT
Begin DoDot:3
+29 SET X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0)
DO S(X,1,1)
End DoDot:3
End DoDot:2
+30 ;Print out the logic node if there is data in it
+31 SET BGPNODE=16
IF $DATA(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10
Begin DoDot:2
+32 SET X="Exclusion Logic:"
DO S(X,2,1)
+33 SET X=""
DO S(X,1,1)
+34 SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ))
IF 'BGPZ
QUIT
Begin DoDot:3
+35 SET X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0)
DO S(X,1,1)
End DoDot:3
End DoDot:2
End DoDot:1
+36 IF $GET(BGPMUT)="H"
Begin DoDot:1
+37 ;Print out the logic node if there is data in it
+38 SET BGPNODE=16
IF $DATA(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10
Begin DoDot:2
+39 SET X="Denominator Exclusion Logic:"
DO S(X,2,1)
+40 SET X=""
DO S(X,1,1)
+41 SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ))
IF 'BGPZ
QUIT
Begin DoDot:3
+42 SET X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0)
DO S(X,1,1)
End DoDot:3
End DoDot:2
+43 ;Print out the numerator node if there is data in it
+44 SET BGPNODE=15
IF $DATA(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10
Begin DoDot:2
+45 SET X="Numerator Logic:"
DO S(X,2,1)
+46 SET X=""
DO S(X,1,1)
+47 SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ))
IF 'BGPZ
QUIT
Begin DoDot:3
+48 SET X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0)
DO S(X,1,1)
End DoDot:3
End DoDot:2
End DoDot:1
+49 ;Print out the Performance node if there is data in it
+50 SET BGPNODE=17
IF $DATA(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10
Begin DoDot:1
+51 SET X="Performance:"
DO S(X,2,1)
+52 SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ))
IF 'BGPZ
QUIT
Begin DoDot:2
+53 SET X=^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0)
DO S(X,1,1)
End DoDot:2
End DoDot:1
+54 ;Print out the source node if there is data in it
+55 SET BGPNODE=18
IF $DATA(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE))=10
Begin DoDot:1
+56 SET X="Measure Source:"
+57 SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ))
IF 'BGPZ
QUIT
Begin DoDot:2
+58 SET X=X_" "_^BGPMUIND(BGPMUYF,BGPIC,BGPNODE,BGPZ,0)
End DoDot:2
+59 DO S(X,2,1)
End DoDot:1
CALC XECUTE ^BGPMUIND(BGPMUYF,BGPIC,4)
+1 QUIT
+1 SET Y="Cover Page"
DO S(Y,1,1)
+2 SET Y="*** IHS Stage 1 Meaningful Use ***"
DO S(Y,2,1)
+3 SET Y="*** "_$SELECT($GET(BGPMUT)'="H":"Eligible Professional (EP)",1:"Hospital")_" Clinical Quality Measures Report ***"
DO S(Y,1,1)
+4 SET Y="CRS 2014, Version 14.1 Patch 1"
DO S(Y,1,1)
+5 SET Y="Date Report Run: "_$$FMTE^XLFDT(DT)
DO S(Y,1,1)
+6 SET Y="Site where Run: "_$PIECE(^DIC(4,DUZ(2),0),U)
DO S(Y,1,1)
+7 SET Y="Report Generated by: "_$PIECE($GET(^VA(200,DUZ,0)),U,1)
DO S(Y,1,1)
+8 SET Y="Report Period: "_$$FMTE^XLFDT(BGPBD)_" to "_$$FMTE^XLFDT(BGPED)
DO S(Y,1,1)
+9 SET Y="Previous Period: "_$$FMTE^XLFDT(BGPPBD)_" to "_$$FMTE^XLFDT(BGPPED)
DO S(Y,1,1)
+10 SET Y="Baseline Period: "_$$FMTE^XLFDT(BGPBBD)_" to "_$$FMTE^XLFDT(BGPBED)
DO S(Y,1,1)
+11 SET Y=""
DO S(Y,1,1)
+12 IF $GET(BGPMUT)'="H"
SET Y="Measures: Stage 1 Meaningful Use Eligible Professional (EP) "_$SELECT(BGPINDT="C":"Core Measures",BGPINDT="A":"Alternate Core",BGPINDT="M":"Menu Set Measures",1:"Selected Measures")
DO S(Y,1,1)
+13 IF $GET(BGPMUT)="H"
Begin DoDot:1
+14 SET Y="Measures: Stage 1 Meaningful Use Eligible Hospital (EH) and"
DO S(Y,1,1)
+15 SET Y="Critical Access Hospital (CAH) Clinical Quality Measures"
DO S(Y,1,1)
End DoDot:1
+16 IF $GET(BGPMUT)="P"
SET Y="Population: "_$SELECT(BGPBEN=1:"AI/AN Only",BGPBEN=2:"Non-AI/AN",BGPBEN=3:"All Patients",1:"")
DO S(Y,2,1)
+17 IF $GET(BGPMUT)'="H"
Begin DoDot:1
+18 SET Y="Eligible Professional (EP): "_$PIECE(^VA(200,BGPPROV,0),U)
DO S(Y,2,1)
End DoDot:1
+19 IF $GET(BGPMUT)="H"
Begin DoDot:1
+20 SET Y="Population: "_$SELECT(BGPBEN=1:"AI/AN Only",BGPBEN=2:"Non-AI/AN",BGPBEN=3:"All Patients",1:"")
+21 DO S(Y,2,1)
+22 SET Y="Eligible Hospital: "_$$LOC^BGPMUEH()_", "_$$GET1^DIQ(4,DUZ(2)_",",1.03)_", "_$$GET1^DIQ(4,DUZ(2)_",",.02)
+23 DO S(Y,1,1)
End DoDot:1
+24 DO ENDTIME
+25 IF $GET(BGPMUT)'="H"
Begin DoDot:1
+26 SET Y="Warning: The Meaningful Use reports do not verify that the EP selected for"
DO S(Y,2,1)
+27 SET Y="the reports meets the CMS EHR Incentive Program eligibility criteria. The"
DO S(Y,1,1)
+28 SET Y="EP must make that determination."
DO S(Y,1,1)
End DoDot:1
+29 IF $GET(BGPMUT)'="H"
Begin DoDot:1
+30 SET Y="This report includes the EP "_$SELECT(BGPINDT="C":"core",BGPINDT="A":"alternate",BGPINDT="M":"menu set",1:"selected")_" clinical quality measures for"
DO S(Y,2,1)
+31 SET Y="Stage 1 Meaningful Use."
DO S(Y,1,1)
End DoDot:1
+32 IF $GET(BGPMUT)="H"
Begin DoDot:1
+33 SET Y="This report includes the eligible hospital and critical access hospital"
DO S(Y,2,1)
+34 SET Y="clinical quality measures for Stage 1 Meaningful Use."
DO S(Y,1,1)
End DoDot:1
+35 IF $GET(BGPMUT)'="H"
Begin DoDot:1
+36 SET Y="For the first Meaningful Use payment year, the reporting period is any"
DO S(Y,2,1)
+37 SET Y="consecutive 90-days during a calendar year (Jan 1- Dec 31). For all"
DO S(Y,1,1)
+38 SET Y="subsequent years, the reporting period is the entire calendar year."
DO S(Y,1,1)
End DoDot:1
+39 IF $GET(BGPMUT)="H"
Begin DoDot:1
+40 SET Y="For the first Meaningful Use payment year, the reporting period is any"
DO S(Y,2,1)
+41 SET Y="consecutive 90-days during a federal fiscal year (Oct 1 - Sep 30). For all"
DO S(Y,1,1)
+42 SET Y="subsequent years, the reporting period is the entire federal fiscal year."
DO S(Y,1,1)
End DoDot:1
+43 ;
+44 SET Y="The report will provide a description of the measure, and explanations for"
DO S(Y,2,1)
+45 SET Y="the denominator(s), numerator(s) and exclusions (if applicable)"
DO S(Y,1,1)
+46 SET Y="and the measure logic."
DO S(Y,1,1)
+47 SET Y="The measure results are contained in tabular form with the following column"
DO S(Y,2,1)
+48 SET Y="headings:"
DO S(Y,1,1)
+49 SET Y="REPORT % PREV YR % CHG FROM BASE % CHG"
DO S(Y,1,1)
+50 SET Y="PERIOD PERIOD PREV YR YR BASE %"
DO S(Y,1,1)
+51 IF $GET(BGPMUT)'="H"
Begin DoDot:1
+52 SET Y="When a report is run for a 90-day period, the PREV YR PERIOD is the same 90-day"
DO S(Y,2,1)
+53 SET Y="period for the previous calendar year and the BASE YR is the same 90-day period"
DO S(Y,1,1)
+54 SET Y="for the base calendar year selected. For example, a report run with Apr 1, 2010"
DO S(Y,1,1)
+55 SET Y="through Jun 30, 2010 as the REPORT PERIOD and a base year of 2008 will include"
DO S(Y,1,1)
+56 SET Y="data from Apr 1, 2009 through Jun 30, 2009 in the PREV YR PERIOD and Apr 1, 2008"
DO S(Y,1,1)
+57 SET Y="through Jun 30, 2008 in the BASE YR."
DO S(Y,1,1)
End DoDot:1
+58 IF $GET(BGPMUT)="H"
Begin DoDot:1
+59 SET Y="When a report is run for a 90-day period, the PREV YR PERIOD is the same 90-day"
DO S(Y,2,1)
+60 SET Y="period for the previous fiscal year and the BASE YR is the same 90-day"
DO S(Y,1,1)
+61 SET Y="period for the base fiscal year selected. For example, a report run"
DO S(Y,1,1)
+62 SET Y="with Apr 1, 2010 through Jun 30, 2010 as the REPORT PERIOD and a base year of"
DO S(Y,1,1)
+63 SET Y="2008 will include data from Apr 1, 2009 through Jun 30, 2009 in the PREV YR"
DO S(Y,1,1)
+64 SET Y="PERIOD and Apr 1, 2008 through Jun 30, 2008 in the BASE YR."
DO S(Y,1,1)
End DoDot:1
+65 QUIT
EXIT ;
+1 KILL ^TMP($JOB)
+2 QUIT
ENDTIME ;
+1 IF $DATA(BGPET)
SET BGPTS=(86400*($PIECE(BGPET,",")-$PIECE(BGPBT,",")))+($PIECE(BGPET,",",2)-$PIECE(BGPBT,",",2))
SET BGPHR=$PIECE(BGPTS/3600,".")
IF BGPHR=""
SET BGPHR=0
Begin DoDot:1
+2 SET BGPTS=BGPTS-(BGPHR*3600)
SET BGPM=$PIECE(BGPTS/60,".")
IF BGPM=""
SET BGPM=0
SET BGPTS=BGPTS-(BGPM*60)
SET BGPS=BGPTS
SET X="RUN TIME (H.M.S): "_BGPHR_"."_BGPM_"."_BGPS
DO S(X,2,1)
End DoDot:1
+3 QUIT
CTR(X,Y) ;EP - Center
+1 QUIT $JUSTIFY("",$SELECT($DATA(Y):Y,1:IOM)-$LENGTH(X)\2)_X
+2 ;----------
USR() ;EP - Return user
+1 QUIT $SELECT($GET(DUZ):$SELECT($DATA(^VA(200,DUZ,0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
+2 ;----------
S(Y,F,P) ;EP set up array
+1 IF '$GET(F)
SET F=0
+2 NEW %,Z
+3 SET Z=""
+4 SET %=$PIECE($GET(^TMP($JOB,"BGPDEL",0)),U)
+5 FOR Z=1:1:F
SET %=%+1
SET ^TMP($JOB,"BGPDEL",%)=""
+6 SET $PIECE(^TMP($JOB,"BGPDEL",0),U)=%
+7 IF '$DATA(^TMP($JOB,"BGPDEL",%))
SET ^TMP($JOB,"BGPDEL",%)=""
+8 SET $PIECE(^TMP($JOB,"BGPDEL",%),U,P)=Y
+9 QUIT
C(X,X2,X3) ;
+1 DO COMMA^%DTC
+2 QUIT X