BGPMUEP ; IHS/MSC/MMT - IHS MU PERFORMANCE MEASURE REPORT FRONT-END ;02-Mar-2011 13:57;DU
;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
;
;
W:$D(IOF) @IOF
W !!,$$CTR("IHS Meaningful Use Clinical Quality Measure Report",80)
W !,$$CTR("Report on all Patients regardless of Community of Residence",80),!!
D MUCHECK Q:BGPQUIT
INTRO ;
D XIT
W !,"This will produce a Clinical Quality Measure Report for one or more measures"
W !,"for a period you specify. You will be asked to provide: 1) the length of the"
W !,"reporting period , 2) the desired start date for your reporting period and,"
W !,"3) the baseline period to compare data to."
SETIND ;
D XIT
S BGPINDT=""
S BGPMUYF="90595.11"
S BGPRTYPE=4,BGP0RPTH="A"
S BGPMUT="P"
TP ;get time period
S BGPRTYPE=4,BGP0RPTH="A"
S (BGPBD,BGPED,BGPTP)=""
S DIR(0)="S^1:90-Days;2:One Year;3:User Defined Date Range",DIR("A")="Enter the reporting period length for your report" KILL DA D ^DIR KILL DIR
I $D(DIRUT) D XIT Q
S BGPANS=Y
S BGPLEN=$S(Y=1:89,Y=2:364,1:"")
S (BGPPER,BGPVDT)=""
I BGPANS=3 D GETBE I BGPBD=""!(BGPED)="" D XIT Q
I BGPANS=3 G BY
W !!,"Enter the reporting period start date."
S DIR(0)="D^::EP"
S DIR("A")="Enter Date"
S DIR("?")="This report is compiled for a period. Enter a valid date."
D ^DIR KILL DIR
I $D(DIRUT) Q
I $D(DUOUT) S DIRUT=1 Q
S BGPVDT=Y
S BGPPER=BGPVDT
I BGPPER="" W !,"Start date not entered.",! G TP
;Setup: BGPBD - begin date & BGPED - end date
S BGPBD=BGPPER
S:$E(BGPBD,4,7)="0000" $E(BGPBD,4,7)="0101"
S BGPED=$$FMADD^XLFDT(BGPPER,BGPLEN)
;I BGPLEN=90 S BGPMON=$E(BGPPER,4,5)+3 S:BGPMON<10 BGPMON="0"_BGPMON S BGPED=$E(BGPPER,1,3)_BGPMON_$E(BGPPER,6,7)
;I BGPLEN=365 S BGPED=($E(BGPPER,1,3)+1)_$E(BGPPER,4,7)
I BGPED>DT D G:BGPDO=1 TP
.W !!,"You have selected Current Report period ",$$FMTE^XLFDT(BGPBD)," through ",$$FMTE^XLFDT(BGPED),"."
.W !,"The end date of this report is in the future; your data will not be",!,"complete.",!
.K DIR S BGPDO=0 S DIR(0)="Y",DIR("A")="Do you want to change your Current Report Dates",DIR("B")="N" KILL DA D ^DIR KILL DIR
.I $D(DIRUT) S BGPDO=1 Q
.I Y S BGPDO=1 Q
.Q
BY ;get previous year
N X1,X2,X
S X1=BGPBD,X2=-365
D C^%DTC
S BGPPBD=X
S X1=BGPED,X2=-365
D C^%DTC
S BGPPED=X
I BGPANS=3 S BGPPBD=($E(BGPBD,1,3)-1)_$E(BGPBD,4,7),BGPPED=($E(BGPED,1,3)-1)_$E(BGPED,4,7)
;get baseline year
S BGPVDT=""
W !!,"Enter the Baseline Year to compare data to.",!,"Use a 4 digit year, e.g. 1999, 2000"
S DIR(0)="D^::EP"
S DIR("A")="Enter Year (e.g. 2000)"
D ^DIR KILL DIR
I $D(DIRUT) G TP
I $D(DUOUT) S DIRUT=1 G TP
S BGPVDT=Y
I $E(Y,4,7)'="0000" W !!,"Please enter a year only!",! G BY
S X=$E(BGPPER,1,3)-$E(BGPVDT,1,3)
S X=X_"0000"
S BGPBBD=BGPBD-X,BGPBBD=$E(BGPBBD,1,3)_$E(BGPBD,4,7)
S BGPBED=BGPED-X,BGPBED=$E(BGPBED,1,3)_$E(BGPED,4,7)
W !!,"The date ranges for this report are:"
W !?5,"Report Period: ",?31,$$FMTE^XLFDT(BGPBD)," to ",?31,$$FMTE^XLFDT(BGPED)
W !?5,"Previous Year Period: ",?31,$$FMTE^XLFDT(BGPPBD)," to ",?31,$$FMTE^XLFDT(BGPPED)
W !?5,"Baseline Period: ",?31,$$FMTE^XLFDT(BGPBBD)," to ",?31,$$FMTE^XLFDT(BGPBED)
EP ;collect eligible provider to run report for
W !!
S DIC("A")="Which Eligible Provider: ",DIC="^VA(200,",DIC(0)="AEMQ" D ^DIC K DIC,DA
I X="^" D XIT Q
I Y=-1 W !!,"provider is required, use an '^' to exit." G EP
S BGPPROV=+Y S DIR(0)="ST^CM:Core Measures;ACM:Alternate Core Measures;MSM:Menu Set Measures;SEL:Selected Measures (User Defined)"
S DIR("A")="Which set of Measures should be included in this report" KILL DA D ^DIR KILL DIR
I $D(DIRUT) D XIT Q
S BGPINDT=$E(Y)
I BGPINDT="M" D MI I '$D(BGPIND) G SETIND
I BGPINDT="S" D SI I '$D(BGPIND) G SETIND
GI ;gather all measures
I BGPINDT="C" D CI
I BGPINDT="A" D AI
I '$D(BGPIND) W !!,"no measures selected" G SETIND
COMM ;
;I BGPINDT'="S" D LISTS
BEN ;
S BGPBEN=""
S DIR(0)="S^1:Indian/Alaskan Native (Classification 01);2:Not Indian Alaskan/Native (Not Classification 01);3:All (both Indian/Alaskan Natives and Non 01)",DIR("A")="Select Beneficiary Population to include in this report"
S DIR("B")="3"
KILL DA D ^DIR KILL DIR
I $D(DIRUT) G COMM
S BGPBEN=Y
SUM ;display summary of this report
W:$D(IOF) @IOF
W !,$$CTR("SUMMARY OF MEANINGFUL USE CLINICAL QUALITY MEASURE REPORT TO BE GENERATED")
W !!,"The date ranges for this report are:"
W !?5,"Report Period: ",?31,$$FMTE^XLFDT(BGPBD)," to ",?31,$$FMTE^XLFDT(BGPED)
W !?5,"Baseline Period: ",?31,$$FMTE^XLFDT(BGPBBD)," to ",?31,$$FMTE^XLFDT(BGPBED)
W !!,"ALL Patients will be included."
W !!,"These measures will be calculated: " S X=0 F S X=$O(BGPIND(X)) Q:X'=+X W !,?10,$P(^BGPMUIND(BGPMUYF,X,0),U,3)
W !!,"Lists will be produced for these measures: "
S X=0 F S X=$O(BGPLIST(X)) Q:X'=+X W !,?10,$P(^BGPMUIND(BGPMUYF,X,0),U,3)
D PT^BGPMUDSL
I BGPROT="" G LISTS
ZIS ;call to XBDBQUE
;D REPORT^BGPMUUTL ;- I don't think this is necessary since it seems to only handle data export files
;I $G(BGPQUIT) D XIT Q
;I BGPRPT="" D XIT Q
K IOP,%ZIS I (BGPROT="D"!(BGPROT="X")),BGPDELT="F" D NODEV,XIT Q
W !! S %ZIS=$S(BGPDELT'="S":"QM",1:"M") D ^%ZIS
ZIS1 ;
;I POP W !,"Report Aborted" S DA=BGPRPT,DIK="^BGPGPDCT(" D ^DIK K DIK D XIT Q
;I POP W !,"Report Aborted" S DA=BGPRPT,DIK="^BGPGPDPT(" D ^DIK K DIK D XIT Q
;I POP W !,"Report Aborted" S DA=BGPRPT,DIK="^BGPGPDBT(" D ^DIK K DIK D XIT Q
I $D(IO("Q")) G TSKMN
DRIVER ;
K ^TMP($J)
D ^BGPMUEPD ;gather data
U IO
D ^BGPMUPP ;print/export data
D ^%ZISC
K ^TMP($J)
D XIT
Q
;
NODEV1 ;
D ^BGPMUEPD ;gather data
D ^BGPMUPP ;print/export data
D ^%ZISC
D XIT
Q
CI ;
S X=0 F S X=$O(^BGPMUIND(BGPMUYF,"AMS","C",X)) Q:X'=+X S BGPIND(X)=""
D LISTS
Q
AI ;
S X=0 F S X=$O(^BGPMUIND(BGPMUYF,"AMS","A",X)) Q:X'=+X S BGPIND(X)=""
D LISTS
Q
MI ;
K BGPIND
D ENM^BGPMUDSI
I '$D(BGPIND) Q
D LISTS
Q
SI ;
K BGPIND
D EN^BGPMUDSI
I '$D(BGPIND) Q
D LISTS
Q
LISTS ;any lists with measures?
K BGPLIST
W !!,"PATIENT LISTS"
I '$D(^XUSEC("BGPZ PATIENT LISTS",DUZ)) W !!,"You do not have the security access to print patient lists.",!,"Please see your supervisor or program manager if you feel you should have",!,"the BGPZ PATIENT LISTS security key.",! D Q
.K DIR S DIR(0)="E",DIR("A")="Press enter to continue" D ^DIR K DIR
S DIR(0)="Y",DIR("A")="Do you want patient lists for any of the measures",DIR("B")="N" KILL DA D ^DIR KILL DIR
I $D(DIRUT)!(Y="") Q
I Y=0 Q
K BGPLIST
D EN^BGPMUDSL
;D EN^BGPMUDSI
I '$D(BGPLIST) W !!,"No lists selected.",!
I $D(BGPLIST) D RT^BGPMUDSL I '$D(BGPLIST)!($D(BGPQUIT)) G LISTS ;get report type for each list
Q
TSKMN ;EP ENTRY POINT FROM TASKMAN
S ZTIO=$S($D(ION):ION,1:IO) I $D(IOST)#2,IOST]"" S ZTIO=ZTIO_";"_IOST
I $G(IO("DOC"))]"" S ZTIO=ZTIO_";"_$G(IO("DOC"))
I $D(IOM)#2,IOM S ZTIO=ZTIO_";"_IOM I $D(IOSL)#2,IOSL S ZTIO=ZTIO_";"_IOSL
K ZTSAVE S ZTSAVE("BGP*")=""
S ZTCPU=$G(IOCPU),ZTRTN="DRIVER^BGPMUEP",ZTDTH="",ZTDESC="MU PERF MEASURE REPORT" D ^%ZTLOAD D XIT Q
Q
;
NODEV ;
S XBRP="",XBRC="NODEV1^BGPMUEP",XBRX="XIT^BGPMUEP",XBNS="BGP"
D ^XBDBQUE
;D XIT
Q
;
XIT ;
D ^%ZISC
D EN^XBVK("BGP") I $D(ZTQUEUED) S ZTREQ="@"
K DIRUT,DUOUT,DIR,DOD
K DIADD,DLAYGO
D KILL^AUPNPAT
K X,X1,X2,X3,X4,X5,X6
K A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,V,W,X,Y,Z
K N,N1,N2,N3,N4,N5,N6
K BD,ED
K IOCPU,IOT,ZTREQ,ZTRTN,ZTIO,ZTDTH,ZTDESC,ZTCPT
K XBRC,XBRP,XBRX,XWB,XBGL,XBNS
K VALMBCK,VALMCNT,VALMHDR
D ^XBFMK
Q
MUCHECK ;Site must have EHR 1.1 Patch 8 installed to qualify for MU since that is the certified version
;S XPXPCH="EHR*1.1*8"
;S X=$$PATCH^XPDUTL(XPXPCH)
;Q:X
;W !!,$$C^XBFUNC("Meaningful Use CQM reporting requires that the certified version be installed.")
;W !!,$$C^XBFUNC("EHR 1.1 Patch 8 must first be installed.")
N IN,INSTDA,STAT
S BGPQUIT=0
S IN="EHR*1.1*8",INSTDA=""
I '$D(^XPD(9.7,"B",IN)) D Q
.W !!,$$C^XBFUNC("Meaningful Use CQM reporting requires that the certified version be installed.")
.W !!,$$C^XBFUNC("EHR 1.1 Patch 8 must first be installed.") S BGPQUIT=1
S INSTDA=$O(^XPD(9.7,"B",IN,INSTDA),-1)
S STAT=+$P($G(^XPD(9.7,INSTDA,0)),U,9)
I STAT'=3 D Q
.W !!,$$C^XBFUNC("Meaningful Use CQM reporting requires that the certified version be installed.")
.W !!,$$C^XBFUNC("EHR 1.1 Patch 8 must first be installed.")
.S BGPQUIT=1
Q
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 DIR,DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
S DIR(0)="E" D ^DIR KILL DIR
Q
;----------
USR() ;EP - Return name of current user from ^VA(200.
Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
;----------
LOC() ;EP - Return location name from file 4 based on DUZ(2).
Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
;----------
;
GETBE ;EP
D F
I BGPBD="" Q
D E
Q
F ;report start date
S (BGPPER,BGPVDT,BGPBD)=""
W !!,"Enter the reporting period start date."
S DIR(0)="D^::EP"
S DIR("A")="Enter Start Date"
S DIR("?")="This report is compiled for a period. Enter a valid date."
D ^DIR KILL DIR
I $D(DIRUT) Q
I $D(DUOUT) S DIRUT=1 Q
S BGPVDT=Y
S BGPBD=Y
S BGPPER=BGPVDT
Q
E ;report start date
S (BGPVDT,BGPED)=""
W !!,"Enter the reporting period end date."
S DIR(0)="D^::EP"
S DIR("A")="Enter End Date"
S DIR("?")="This report is compiled for a period. Enter a valid date."
D ^DIR KILL DIR
I $D(DIRUT) Q
I $D(DUOUT) S DIRUT=1 Q
;S BGPVDT=Y
S BGPED=Y
Q
BGPMUEP ; IHS/MSC/MMT - IHS MU PERFORMANCE MEASURE REPORT FRONT-END ;02-Mar-2011 13:57;DU
+1 ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
+2 ;
+3 ;
+4 IF $DATA(IOF)
WRITE @IOF
+5 WRITE !!,$$CTR("IHS Meaningful Use Clinical Quality Measure Report",80)
+6 WRITE !,$$CTR("Report on all Patients regardless of Community of Residence",80),!!
+7 DO MUCHECK
IF BGPQUIT
QUIT
INTRO ;
+1 DO XIT
+2 WRITE !,"This will produce a Clinical Quality Measure Report for one or more measures"
+3 WRITE !,"for a period you specify. You will be asked to provide: 1) the length of the"
+4 WRITE !,"reporting period , 2) the desired start date for your reporting period and,"
+5 WRITE !,"3) the baseline period to compare data to."
SETIND ;
+1 DO XIT
+2 SET BGPINDT=""
+3 SET BGPMUYF="90595.11"
+4 SET BGPRTYPE=4
SET BGP0RPTH="A"
+5 SET BGPMUT="P"
TP ;get time period
+1 SET BGPRTYPE=4
SET BGP0RPTH="A"
+2 SET (BGPBD,BGPED,BGPTP)=""
+3 SET DIR(0)="S^1:90-Days;2:One Year;3:User Defined Date Range"
SET DIR("A")="Enter the reporting period length for your report"
KILL DA
DO ^DIR
KILL DIR
+4 IF $DATA(DIRUT)
DO XIT
QUIT
+5 SET BGPANS=Y
+6 SET BGPLEN=$SELECT(Y=1:89,Y=2:364,1:"")
+7 SET (BGPPER,BGPVDT)=""
+8 IF BGPANS=3
DO GETBE
IF BGPBD=""!(BGPED)=""
DO XIT
QUIT
+9 IF BGPANS=3
GOTO BY
+10 WRITE !!,"Enter the reporting period start date."
+11 SET DIR(0)="D^::EP"
+12 SET DIR("A")="Enter Date"
+13 SET DIR("?")="This report is compiled for a period. Enter a valid date."
+14 DO ^DIR
KILL DIR
+15 IF $DATA(DIRUT)
QUIT
+16 IF $DATA(DUOUT)
SET DIRUT=1
QUIT
+17 SET BGPVDT=Y
+18 SET BGPPER=BGPVDT
+19 IF BGPPER=""
WRITE !,"Start date not entered.",!
GOTO TP
+20 ;Setup: BGPBD - begin date & BGPED - end date
+21 SET BGPBD=BGPPER
+22 IF $EXTRACT(BGPBD,4,7)="0000"
SET $EXTRACT(BGPBD,4,7)="0101"
+23 SET BGPED=$$FMADD^XLFDT(BGPPER,BGPLEN)
+24 ;I BGPLEP_source.html#xE">EP_source.html#xEP_source.html#xE">E">EP_source.html#xE">EN=90 S BGPMON=$EP_source.html#xE">EP_source.html#xEP_source.html#xE">E">EP_source.html#xE">E(BGPPEP_source.html#xE">EP_source.html#xEP_source.html#xE">E">EP_source.html#xE">ER,4,5)+3 S:BGPMON<10 BGPMON="0"_BGPMON S BGPEP_source.html#xE">EP_source.html#xEP_source.html#xE">E">EP_source.html#xE">ED=$EP_source.html#xE">EP_source.html#xEP_source.html#xE">E">EP_source.html#xE">E(BGPPEP_source.html#xE">EP_source.html#xEP_source.html#xE">E">EP_source.html#xE">ER,1,3)_BGPMON_$EP_source.html#xE">EP_source.html#xEP_source.html#xE">E">EP_source.html#xE">E(BGPPEP_source.html#xE">EP_source.html#xEP_source.html#xE">E">EP_source.html#xE">ER,6,7)
+25 ;I BGPLEP_source.html#xE">EN=365 S BGPEP_source.html#xE">ED=($EP_source.html#xE">E(BGPPEP_source.html#xE">ER,1,3)+1)_$EP_source.html#xE">E(BGPPEP_source.html#xE">ER,4,7)
+26 IF BGPED>DT
Begin DoDot:1
+27 WRITE !!,"You have selected Current Report period ",$$FMTE^XLFDT(BGPBD)," through ",$$FMTE^XLFDT(BGPED),"."
+28 WRITE !,"The end date of this report is in the future; your data will not be",!,"complete.",!
+29 KILL DIR
SET BGPDO=0
SET DIR(0)="Y"
SET DIR("A")="Do you want to change your Current Report Dates"
SET DIR("B")="N"
KILL DA
DO ^DIR
KILL DIR
+30 IF $DATA(DIRUT)
SET BGPDO=1
QUIT
+31 IF Y
SET BGPDO=1
QUIT
+32 QUIT
End DoDot:1
IF BGPDO=1
GOTO TP
BY ;get previous year
+1 NEW X1,X2,X
+2 SET X1=BGPBD
SET X2=-365
+3 DO C^%DTC
+4 SET BGPPBD=X
+5 SET X1=BGPED
SET X2=-365
+6 DO C^%DTC
+7 SET BGPPED=X
+8 IF BGPANS=3
SET BGPPBD=($EXTRACT(BGPBD,1,3)-1)_$EXTRACT(BGPBD,4,7)
SET BGPPED=($EXTRACT(BGPED,1,3)-1)_$EXTRACT(BGPED,4,7)
+9 ;get baseline year
+10 SET BGPVDT=""
+11 WRITE !!,"Enter the Baseline Year to compare data to.",!,"Use a 4 digit year, e.g. 1999, 2000"
+12 SET DIR(0)="D^::EP"
+13 SET DIR("A")="Enter Year (e.g. 2000)"
+14 DO ^DIR
KILL DIR
+15 IF $DATA(DIRUT)
GOTO TP
+16 IF $DATA(DUOUT)
SET DIRUT=1
GOTO TP
+17 SET BGPVDT=Y
+18 IF $EXTRACT(Y,4,7)'="0000"
WRITE !!,"Please enter a year only!",!
GOTO BY
+19 SET X=$EXTRACT(BGPPER,1,3)-$EXTRACT(BGPVDT,1,3)
+20 SET X=X_"0000"
+21 SET BGPBBD=BGPBD-X
SET BGPBBD=$EXTRACT(BGPBBD,1,3)_$EXTRACT(BGPBD,4,7)
+22 SET BGPBED=BGPED-X
SET BGPBED=$EXTRACT(BGPBED,1,3)_$EXTRACT(BGPED,4,7)
+23 WRITE !!,"The date ranges for this report are:"
+24 WRITE !?5,"Report Period: ",?31,$$FMTE^XLFDT(BGPBD)," to ",?31,$$FMTE^XLFDT(BGPED)
+25 WRITE !?5,"Previous Year Period: ",?31,$$FMTE^XLFDT(BGPPBD)," to ",?31,$$FMTE^XLFDT(BGPPED)
+26 WRITE !?5,"Baseline Period: ",?31,$$FMTE^XLFDT(BGPBBD)," to ",?31,$$FMTE^XLFDT(BGPBED)
EP ;collect eligible provider to run report for
+1 WRITE !!
+2 SET DIC("A")="Which Eligible Provider: "
SET DIC="^VA(200,"
SET DIC(0)="AEMQ"
DO ^DIC
KILL DIC,DA
+3 IF X="^"
DO XIT
QUIT
+4 IF Y=-1
WRITE !!,"provider is required, use an '^' to exit."
GOTO EP
+5 SET BGPPROV=+Y
SET DIR(0)="ST^CM:Core Measures;ACM:Alternate Core Measures;MSM:Menu Set Measures;SEL:Selected Measures (User Defined)"
+6 SET DIR("A")="Which set of Measures should be included in this report"
KILL DA
DO ^DIR
KILL DIR
+7 IF $DATA(DIRUT)
DO XIT
QUIT
+8 SET BGPINDT=$EXTRACT(Y)
+9 IF BGPINDT="M"
DO MI
IF '$DATA(BGPIND)
GOTO SETIND
+10 IF BGPINDT="S"
DO SI
IF '$DATA(BGPIND)
GOTO SETIND
GI ;gather all measures
+1 IF BGPINDT="C"
DO CI
+2 IF BGPINDT="A"
DO AI
+3 IF '$DATA(BGPIND)
WRITE !!,"no measures selected"
GOTO SETIND
COMM ;
+1 ;I BGPINDT'="S" D LISTS
BEN ;
+1 SET BGPBEN=""
+2 SET DIR(0)="S^1:Indian/Alaskan Native (Classification 01);2:Not Indian Alaskan/Native (Not Classification 01);3:All (both Indian/Alaskan Natives and Non 01)"
SET DIR("A")="Select Beneficiary Population to include in this report"
+3 SET DIR("B")="3"
+4 KILL DA
DO ^DIR
KILL DIR
+5 IF $DATA(DIRUT)
GOTO COMM
+6 SET BGPBEN=Y
SUM ;display summary of this report
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE !,$$CTR("SUMMARY OF MEANINGFUL USE CLINICAL QUALITY MEASURE REPORT TO BE GENERATED")
+3 WRITE !!,"The date ranges for this report are:"
+4 WRITE !?5,"Report Period: ",?31,$$FMTE^XLFDT(BGPBD)," to ",?31,$$FMTE^XLFDT(BGPED)
+5 WRITE !?5,"Baseline Period: ",?31,$$FMTE^XLFDT(BGPBBD)," to ",?31,$$FMTE^XLFDT(BGPBED)
+6 WRITE !!,"ALL Patients will be included."
+7 WRITE !!,"These measures will be calculated: "
SET X=0
FOR
SET X=$ORDER(BGPIND(X))
IF X'=+X
QUIT
WRITE !,?10,$PIECE(^BGPMUIND(BGPMUYF,X,0),U,3)
+8 WRITE !!,"Lists will be produced for these measures: "
+9 SET X=0
FOR
SET X=$ORDER(BGPLIST(X))
IF X'=+X
QUIT
WRITE !,?10,$PIECE(^BGPMUIND(BGPMUYF,X,0),U,3)
+10 DO PT^BGPMUDSL
+11 IF BGPROT=""
GOTO LISTS
ZIS ;call to XBDBQUE
+1 ;D REPORT^BGPMUUTL ;- I don't think this is necessary since it seems to only handle data export files
+2 ;I $G(BGPQUIT) D XIT Q
+3 ;I BGPRPT="" D XIT Q
+4 KILL IOP,%ZIS
IF (BGPROT="D"!(BGPROT="X"))
IF BGPDELT="F"
DO NODEV
DO XIT
QUIT
+5 WRITE !!
SET %ZIS=$SELECT(BGPDELT'="S":"QM",1:"M")
DO ^%ZIS
ZIS1 ;
+1 ;I POP W !,"Report Aborted" S DA=BGPRPT,DIK="^BGPGPDCT(" D ^DIK K DIK D XIT Q
+2 ;I POP W !,"Report Aborted" S DA=BGPRPT,DIK="^BGPGPDPT(" D ^DIK K DIK D XIT Q
+3 ;I POP W !,"Report Aborted" S DA=BGPRPT,DIK="^BGPGPDBT(" D ^DIK K DIK D XIT Q
+4 IF $DATA(IO("Q"))
GOTO TSKMN
DRIVER ;
+1 KILL ^TMP($JOB)
+2 ;gather data
DO ^BGPMUEPD
+3 USE IO
+4 ;print/export data
DO ^BGPMUPP
+5 DO ^%ZISC
+6 KILL ^TMP($JOB)
+7 DO XIT
+8 QUIT
+9 ;
NODEV1 ;
+1 ;gather data
DO ^BGPMUEPD
+2 ;print/export data
DO ^BGPMUPP
+3 DO ^%ZISC
+4 DO XIT
+5 QUIT
CI ;
+1 SET X=0
FOR
SET X=$ORDER(^BGPMUIND(BGPMUYF,"AMS","C",X))
IF X'=+X
QUIT
SET BGPIND(X)=""
+2 DO LISTS
+3 QUIT
AI ;
+1 SET X=0
FOR
SET X=$ORDER(^BGPMUIND(BGPMUYF,"AMS","A",X))
IF X'=+X
QUIT
SET BGPIND(X)=""
+2 DO LISTS
+3 QUIT
MI ;
+1 KILL BGPIND
+2 DO ENM^BGPMUDSI
+3 IF '$DATA(BGPIND)
QUIT
+4 DO LISTS
+5 QUIT
SI ;
+1 KILL BGPIND
+2 DO EN^BGPMUDSI
+3 IF '$DATA(BGPIND)
QUIT
+4 DO LISTS
+5 QUIT
LISTS ;any lists with measures?
+1 KILL BGPLIST
+2 WRITE !!,"PATIENT LISTS"
+3 IF '$DATA(^XUSEC("BGPZ PATIENT LISTS",DUZ))
WRITE !!,"You do not have the security access to print patient lists.",!,"Please see your supervisor or program manager if you feel you should have",!,"the BGPZ PATIENT LISTS security key.",!
Begin DoDot:1
+4 KILL DIR
SET DIR(0)="E"
SET DIR("A")="Press enter to continue"
DO ^DIR
KILL DIR
End DoDot:1
QUIT
+5 SET DIR(0)="Y"
SET DIR("A")="Do you want patient lists for any of the measures"
SET DIR("B")="N"
KILL DA
DO ^DIR
KILL DIR
+6 IF $DATA(DIRUT)!(Y="")
QUIT
+7 IF Y=0
QUIT
+8 KILL BGPLIST
+9 DO EN^BGPMUDSL
+10 ;D EN^BGPMUDSI
+11 IF '$DATA(BGPLIST)
WRITE !!,"No lists selected.",!
+12 ;get report type for each list
IF $DATA(BGPLIST)
DO RT^BGPMUDSL
IF '$DATA(BGPLIST)!($DATA(BGPQUIT))
GOTO LISTS
+13 QUIT
TSKMN ;EP ENTRY POINT FROM TASKMAN
+1 SET ZTIO=$SELECT($DATA(ION):ION,1:IO)
IF $DATA(IOST)#2
IF IOST]""
SET ZTIO=ZTIO_";"_IOST
+2 IF $GET(IO("DOC"))]""
SET ZTIO=ZTIO_";"_$GET(IO("DOC"))
+3 IF $DATA(IOM)#2
IF IOM
SET ZTIO=ZTIO_";"_IOM
IF $DATA(IOSL)#2
IF IOSL
SET ZTIO=ZTIO_";"_IOSL
+4 KILL ZTSAVE
SET ZTSAVE("BGP*")=""
+5 SET ZTCPU=$GET(IOCPU)
SET ZTRTN="DRIVER^BGPMUEP"
SET ZTDTH=""
SET ZTDESC="MU PERF MEASURE REPORT"
DO ^%ZTLOAD
DO XIT
QUIT
+6 QUIT
+7 ;
NODEV ;
+1 SET XBRP=""
SET XBRC="NODEV1^BGPMUEP"
SET XBRX="XIT^BGPMUEP"
SET XBNS="BGP"
+2 DO ^XBDBQUE
+3 ;D XIT
+4 QUIT
+5 ;
XIT ;
+1 DO ^%ZISC
+2 DO EN^XBVK("BGP")
IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+3 KILL DIRUT,DUOUT,DIR,DOD
+4 KILL DIADD,DLAYGO
+5 DO KILL^AUPNPAT
+6 KILL X,X1,X2,X3,X4,X5,X6
+7 KILL A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,V,W,X,Y,Z
+8 KILL N,N1,N2,N3,N4,N5,N6
+9 KILL BD,ED
+10 KILL IOCPU,IOT,ZTREQ,ZTRTN,ZTIO,ZTDTH,ZTDESC,ZTCPT
+11 KILL XBRC,XBRP,XBRX,XWB,XBGL,XBNS
+12 KILL VALMBCK,VALMCNT,VALMHDR
+13 DO ^XBFMK
+14 QUIT
MUCHECK ;Site must have EHR 1.1 Patch 8 installed to qualify for MU since that is the certified version
+1 ;S XPXPCH="EHR*1.1*8"
+2 ;S X=$$PATCH^XPDUTL(XPXPCH)
+3 ;Q:X
+4 ;W !!,$$C^XBFUNC("Meaningful Use CQM reporting requires that the certified version be installed.")
+5 ;W !!,$$C^XBFUNC("EHR 1.1 Patch 8 must first be installed.")
+6 NEW IN,INSTDA,STAT
+7 SET BGPQUIT=0
+8 SET IN="EHR*1.1*8"
SET INSTDA=""
+9 IF '$DATA(^XPD(9.7,"B",IN))
Begin DoDot:1
+10 WRITE !!,$$C^XBFUNC("Meaningful Use CQM reporting requires that the certified version be installed.")
+11 WRITE !!,$$C^XBFUNC("EHR 1.1 Patch 8 must first be installed.")
SET BGPQUIT=1
End DoDot:1
QUIT
+12 SET INSTDA=$ORDER(^XPD(9.7,"B",IN,INSTDA),-1)
+13 SET STAT=+$PIECE($GET(^XPD(9.7,INSTDA,0)),U,9)
+14 IF STAT'=3
Begin DoDot:1
+15 WRITE !!,$$C^XBFUNC("Meaningful Use CQM reporting requires that the certified version be installed.")
+16 WRITE !!,$$C^XBFUNC("EHR 1.1 Patch 8 must first be installed.")
+17 SET BGPQUIT=1
End DoDot:1
QUIT
+18 QUIT
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 DIR,DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
+5 SET DIR(0)="E"
DO ^DIR
KILL DIR
+6 QUIT
+7 ;----------
USR() ;EP - Return name of current user from ^VA(200.
+1 QUIT $SELECT($GET(DUZ):$SELECT($DATA(^VA(200,DUZ,0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
+2 ;----------
LOC() ;EP - Return location name from file 4 based on DUZ(2).
+1 QUIT $SELECT($GET(DUZ(2)):$SELECT($DATA(^DIC(4,DUZ(2),0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
+2 ;----------
+3 ;
GETBE ;EP
+1 DO F
+2 IF BGPBD=""
QUIT
+3 DO E
+4 QUIT
F ;report start date
+1 SET (BGPPER,BGPVDT,BGPBD)=""
+2 WRITE !!,"Enter the reporting period start date."
+3 SET DIR(0)="D^::EP"
+4 SET DIR("A")="Enter Start Date"
+5 SET DIR("?")="This report is compiled for a period. Enter a valid date."
+6 DO ^DIR
KILL DIR
+7 IF $DATA(DIRUT)
QUIT
+8 IF $DATA(DUOUT)
SET DIRUT=1
QUIT
+9 SET BGPVDT=Y
+10 SET BGPBD=Y
+11 SET BGPPER=BGPVDT
+12 QUIT
E ;report start date
+1 SET (BGPVDT,BGPED)=""
+2 WRITE !!,"Enter the reporting period end date."
+3 SET DIR(0)="D^::EP"
+4 SET DIR("A")="Enter End Date"
+5 SET DIR("?")="This report is compiled for a period. Enter a valid date."
+6 DO ^DIR
KILL DIR
+7 IF $DATA(DIRUT)
QUIT
+8 IF $DATA(DUOUT)
SET DIRUT=1
QUIT
+9 ;S BGPVDT=Y
+10 SET BGPED=Y
+11 QUIT