APCM25N ;IHS/CMI/LAB - MU PATIENT LIST;
;;1.0;MU PERFORMANCE REPORTS;**7,9,10**;MAR 26, 2012;Build 31
;
;
;
W:$D(IOF) @IOF
EP D XIT
INTRO ;
S APCMRPTT=2 ;CONTROL VARIABLE FOR CAH REPORT
S APCMRPTC=$O(^APCMMUCN("B","MODIFIED STAGE 2 2015",0))
W !!!
W "* IHS Modified Stage 2 MU Performance Reports for Hospitals & CAHs*",!
W !,"This report displays the performance measure results for Modified Stage 2",!
W "Meaningful Use. In order to achieve Meaningful Use, an EH/CAH must meet",!
W "all 9 objectives and their associated performance measures. The report",!
W "may be run for 90 days, 1 year or a user defined time period.",!
W !,"This report allows a user to review the patients that populate the",!
W "numerator and denominator of each Performance Measure.",!,!
S DIR(0)="Y",DIR("A")="Do you wish to continue to report",DIR("B")="YES" KILL DA D ^DIR KILL DIR
I $D(DIRUT) D XIT Q
I 'Y D XIT Q
;gather up measures for this report
S DIR(0)="S^S:One or More Performance Measures;A:All Performance Measures",DIR("A")="Run the report on",DIR("B")="S" KILL DA D ^DIR KILL DIR
I $D(DIRUT) D XIT Q
S APCMINDZ=Y
I APCMINDZ="S" D EN^APCM25SI S Q=0 D I Q G INTRO
.I '$D(APCMIND) W !!,"No measures selected" H 2 S Q=1 Q
.S X=0 F S X=$O(APCMIND(X)) Q:X'=+X D
..;GET ALL WITH SAME SUMMARY ORDER # AND ADD IN
..S O=0 F S O=$O(^APCM25OB(X,29,O)) Q:O'=+O S Y=$P(^APCM25OB(X,29,O,0),U,1),Y=$O(^APCM25OB("B",Y,0)) I Y S APCMIND(Y)=""
I APCMINDZ="A" S X=0 F S X=$O(^APCM25OB(X)) Q:X'=+X I $P(^APCM25OB(X,0),U,2)="H" S APCMIND(X)=""
SI D LISTS
I $G(APCMQUIT) G INTRO
SI1 ;NOW SELECT ONE OR MORE W/IN THE TOPIC
K APCMX,APCMY,APCMINDL S APCMQ=0
D TERM^VALM0
;REORDER IN AOI FORMAT
K APCMINDO
S APCMIND=0 F S APCMIND=$O(APCMLIST(APCMIND)) Q:APCMIND'=+APCMIND S APCMINDO($P(^APCM25OB(APCMIND,0),U,4),APCMIND)=""
S APCMORD=0 F S APCMORD=$O(APCMINDO(APCMORD)) Q:APCMORD'=+APCMORD!(APCMQ)!($D(DIRUT)) D
.S APCMIND=$O(APCMINDO(APCMORD,0))
.S APCMCR="AH"
.K APCMX S APCMO=0,X=0,APCMC=0 F S APCMO=$O(^APCMM25L(APCMCR,APCMIND,APCMO)) Q:APCMO'=+APCMO!($D(DIRUT)) D
..S X=$O(^APCMM25L(APCMCR,APCMIND,APCMO,0))
..S APCMX(APCMO,X)="",APCMC=APCMC+1
.;display the choices
.W !!!,"Please select one or more of these report choices within the",!,IORVON,$P(^APCM25OB(APCMIND,0),U,5),IORVOFF," objective.",!
.K APCMY S X=0,APCMC=0,APCMO=0 F S APCMO=$O(APCMX(APCMO)) Q:APCMO'=+APCMO!($D(DIRUT)) S X=0 F S X=$O(APCMX(APCMO,X)) Q:X'=+X!($D(DIRUT)) S APCMC=APCMC+1 W !?5,APCMC,")",?9,$P(^APCMM25L(X,0),U,3) S APCMY(APCMC)=X
.S DIR(0)="L^1:"_APCMC,DIR("A")="Which item(s)"
.D ^DIR K DIR S:$D(DUOUT) DIRUT=1
.I Y="" W !,"No REPORTS selected for this objective." Q
.I $D(DIRUT) W !,"No REPORTs selected for this objective." Q
.S APCMANS=Y,APCMC="" F APCMI=1:1 S APCMC=$P(APCMANS,",",APCMI) Q:APCMC="" S APCMINDL(APCMIND,APCMY(APCMC))=""
;get report type
I $D(DIRUT) G SI
K APCMQUIT
RT ;
S APCMSUM="S"
TP ;
S APCMRPTP=""
MUYEAR ;
K APCMVDT,APCMPER,APCMEDUD
K DIR S DIR(0)="D^::EP"
W !!,"Enter the Calendar Year for which the EH is demonstrating Meaningful"
S DIR("A")="Use. Use a 4 digit year, e.g. 2018"
S DIR("?")="Enter a valid year."
D ^DIR KILL DIR
I $D(DIRUT) G EP
I $D(DUOUT) G EP
S APCMVDT=Y
;I Y'="3150000",Y'="3160000",Y'="3170000",Y'="3180000" W !!,"You can only enter 2015, 2016, 2017 or 2018" G MUYEAR
I $E(Y,4,7)'="0000" W !!,"Please enter a year only!",! G MUYEAR
S APCMPER=APCMVDT
I $E(APCMPER,1,3)>316 S APCMEDUD=$E(APCMPER,1,3)_"1231" ;IHS/CMI/LAB - PATCH 9 06/06/2017
S APCMLD=$E(APCMPER,1,3)_"0101",APCMHD=$E(APCMPER,1,3)_"1231" ;LOW AND HIGH DATES ALLOWED BELOW
;I APCMPER="3150000" S APCMLD=$E(APCMPER,1,3)-1_"1001",APCMHD=$E(APCMPER,1,3)_"1231"
;
YEAR ;
S (APCMVDT,APCMBD,APCMED)=""
S APCMQ=0
D G:APCMQ INTRO
.W !!,"Select one of the following:",!
.W !?10,"1 User Defined 90-Day Report"
.W !?10,"2 Calendar Year"
.W !?10,"3 User Defined Date Range"
.W ! S DIR(0)="N^1:3:",DIR("A")="Select Report Period" KILL DA D ^DIR KILL DIR
.I $D(DIRUT) S APCMQ=1 Q
.S APCMRPTP=Y
.I APCMRPTP=1 D 5^APCM25H Q
.I APCMRPTP=2 S APCMBD=$E(APCMPER,1,3)_"0101",APCMED=$E(APCMPER,1,3)_"1231" W !!,"Date range is: ",$$FMTE^XLFDT(APCMBD)," - ",$$FMTE^XLFDT(APCMED),"." Q
.I APCMRPTP=3 D 6^APCM25H Q
I APCMBD="" G TP
I APCMED="" G TP
;
METHOD ;
S APCMMETH=""
W ! S DIR(0)="S^E:All Emergency Department;O:Observation Method",DIR("A")="Run the report using which method",DIR("B")="E" KILL DA D ^DIR KILL DIR
I $D(DIRUT) G TP
S APCMMETH=Y
FAC ;
S APCMFAC=""
W !
S DIC("A")="Select Hospital or CAH: ",DIC="^AUTTLOC(",DIC(0)="AEMQ",DIC("B")=$P(^DIC(4,DUZ(2),0),U) D ^DIC K DIC,DA
G:Y<0 METHOD
S APCMFAC=+Y
PRV ;
S APCMQUIT=""
DEMO ;
D DEMOCHK^APCLUTL(.APCMDEMO)
I APCMDEMO=-1 G FAC
ATTEST ;get answers to attestation questions for each provider.
K APCMATTE
D ATTESTQ^APCM25H
I APCMQ G DEMO
SUM ;display summary of this report
W:$D(IOF) @IOF
W !,$$CTR("SUMMARY OF MODIFIED STAGE 2-MEANINGFUL USE REPORT TO BE GENERATED")
W !!,"The date ranges for this report are:"
W !?5,"Report Period: ",?31,$$FMTE^XLFDT(APCMBD)," to ",?31,$$FMTE^XLFDT(APCMED)
I $E(APCMPER,1,3)>316,($$HAS^APCM25ET("S2.019.H")!($$HAS^APCM25ET("S2.025.H"))!($$HAS^APCM25ET("S2.021.H"))) D ;IHS/CMI/LAB - PATCH 9 06/06/2017 PATCH 10 06/20/18
.S C=0
.W !!,"Please note: the date range is ",$$FMTE^XLFDT(APCMBD)," to ",$$FMTE^XLFDT(APCMEDUD)," for ",!
.I $$HAS^APCM25ET("S2.019.H") W ?5,"Patient Education",!
.I $$HAS^APCM25ET("S2.025.H") W ?5,"Patient Electronic Access",!
.I $$HAS^APCM25ET("S2.021.H") W ?5,"Summary of Care (HIE)",!
W !,"Hospital: ",$P(^DIC(4,APCMFAC,0),U,1)
D PT^APCM25SL
I APCMROT="" G DEMO
ZIS ;call to XBDBQUE
D REPORT^APCM25SL
I $G(APCMQUIT) D XIT Q
I APCMRPT="" D XIT Q
K IOP,%ZIS I APCMROT="D",APCMDELT="F" D NODEV,XIT Q
K IOP,%ZIS W !! S %ZIS=$S(APCMDELT'="S":"PQM",1:"PM") D ^%ZIS
I POP W !,"Report Aborted" S DA=APCMRPT,DIK="^APCMM14C(" D ^DIK K DIK D XIT Q
I $D(IO("Q")) G TSKMN
DRIVER ;
D PROC^APCM25E1
U IO
D ^APCM25EP
D ^%ZISC
D XIT
Q
;
NODEV ;
S XBRP="",XBRC="NODEV1^APCM25N",XBRX="XIT^APCM25N",XBNS="APCM"
D ^XBDBQUE
Q
;
NODEV1 ;
D PROC^APCM25E1
D ^APCM25EP
D ^%ZISC
D XIT
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("APCM*")=""
S ZTCPU=$G(IOCPU),ZTRTN="DRIVER^APCM25N",ZTDTH="",ZTDESC="2015 MU STAGE 2 REPORT" D ^%ZTLOAD D XIT Q
Q
;
XIT ;
L -^APCMM25C
D ^%ZISC
D EN^XBVK("APCM")
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
D KILL^AUPNPAT
D ^XBFMK
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)!$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")
LISTS ;any lists with measures?
K APCMLIST,APCMQUIT
W !!,"PATIENT LISTS"
I '$D(^XUSEC("APCMZ 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 APCMZ 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")="NO" KILL DA D ^DIR KILL DIR
I $D(DIRUT)!(Y="") S APCMQUIT=1 Q
I Y=0 Q
K APCMLIST
D EN^APCM25SL
I '$D(APCMLIST) W !!,"No lists selected.",!
I $D(APCMLIST) S APCMLIST="A" ;I '$D(APCMLIST)!($D(APCMQUIT)) G LISTS ;get report type for each list
Q
APCM25N ;IHS/CMI/LAB - MU PATIENT LIST;
+1 ;;1.0;MU PERFORMANCE REPORTS;**7,9,10**;MAR 26, 2012;Build 31
+2 ;
+3 ;
+4 ;
+5 IF $DATA(IOF)
WRITE @IOF
EP DO XIT
INTRO ;
+1 ;CONTROL VARIABLE FOR CAH REPORT
SET APCMRPTT=2
+2 SET APCMRPTC=$ORDER(^APCMMUCN("B","MODIFIED STAGE 2 2015",0))
+3 WRITE !!!
+4 WRITE "* IHS Modified Stage 2 MU Performance Reports for Hospitals & CAHs*",!
+5 WRITE !,"This report displays the performance measure results for Modified Stage 2",!
+6 WRITE "Meaningful Use. In order to achieve Meaningful Use, an EH/CAH must meet",!
+7 WRITE "all 9 objectives and their associated performance measures. The report",!
+8 WRITE "may be run for 90 days, 1 year or a user defined time period.",!
+9 WRITE !,"This report allows a user to review the patients that populate the",!
+10 WRITE "numerator and denominator of each Performance Measure.",!,!
+11 SET DIR(0)="Y"
SET DIR("A")="Do you wish to continue to report"
SET DIR("B")="YES"
KILL DA
DO ^DIR
KILL DIR
+12 IF $DATA(DIRUT)
DO XIT
QUIT
+13 IF 'Y
DO XIT
QUIT
+14 ;gather up measures for this report
+15 SET DIR(0)="S^S:One or More Performance Measures;A:All Performance Measures"
SET DIR("A")="Run the report on"
SET DIR("B")="S"
KILL DA
DO ^DIR
KILL DIR
+16 IF $DATA(DIRUT)
DO XIT
QUIT
+17 SET APCMINDZ=Y
+18 IF APCMINDZ="S"
DO EN^APCM25SI
SET Q=0
Begin DoDot:1
+19 IF '$DATA(APCMIND)
WRITE !!,"No measures selected"
HANG 2
SET Q=1
QUIT
+20 SET X=0
FOR
SET X=$ORDER(APCMIND(X))
IF X'=+X
QUIT
Begin DoDot:2
+21 ;GET ALL WITH SAME SUMMARY ORDER # AND ADD IN
+22 SET O=0
FOR
SET O=$ORDER(^APCM25OB(X,29,O))
IF O'=+O
QUIT
SET Y=$PIECE(^APCM25OB(X,29,O,0),U,1)
SET Y=$ORDER(^APCM25OB("B",Y,0))
IF Y
SET APCMIND(Y)=""
End DoDot:2
End DoDot:1
IF Q
GOTO INTRO
+23 IF APCMINDZ="A"
SET X=0
FOR
SET X=$ORDER(^APCM25OB(X))
IF X'=+X
QUIT
IF $PIECE(^APCM25OB(X,0),U,2)="H"
SET APCMIND(X)=""
SI DO LISTS
+1 IF $GET(APCMQUIT)
GOTO INTRO
SI1 ;NOW SELECT ONE OR MORE W/IN THE TOPIC
+1 KILL APCMX,APCMY,APCMINDL
SET APCMQ=0
+2 DO TERM^VALM0
+3 ;REORDER IN AOI FORMAT
+4 KILL APCMINDO
+5 SET APCMIND=0
FOR
SET APCMIND=$ORDER(APCMLIST(APCMIND))
IF APCMIND'=+APCMIND
QUIT
SET APCMINDO($PIECE(^APCM25OB(APCMIND,0),U,4),APCMIND)=""
+6 SET APCMORD=0
FOR
SET APCMORD=$ORDER(APCMINDO(APCMORD))
IF APCMORD'=+APCMORD!(APCMQ)!($DATA(DIRUT))
QUIT
Begin DoDot:1
+7 SET APCMIND=$ORDER(APCMINDO(APCMORD,0))
+8 SET APCMCR="AH"
+9 KILL APCMX
SET APCMO=0
SET X=0
SET APCMC=0
FOR
SET APCMO=$ORDER(^APCMM25L(APCMCR,APCMIND,APCMO))
IF APCMO'=+APCMO!($DATA(DIRUT))
QUIT
Begin DoDot:2
+10 SET X=$ORDER(^APCMM25L(APCMCR,APCMIND,APCMO,0))
+11 SET APCMX(APCMO,X)=""
SET APCMC=APCMC+1
End DoDot:2
+12 ;display the choices
+13 WRITE !!!,"Please select one or more of these report choices within the",!,IORVON,$PIECE(^APCM25OB(APCMIND,0),U,5),IORVOFF," objective.",!
+14 KILL APCMY
SET X=0
SET APCMC=0
SET APCMO=0
FOR
SET APCMO=$ORDER(APCMX(APCMO))
IF APCMO'=+APCMO!($DATA(DIRUT))
QUIT
SET X=0
FOR
SET X=$ORDER(APCMX(APCMO,X))
IF X'=+X!($DATA(DIRUT))
QUIT
SET APCMC=APCMC+1
WRITE !?5,APCMC,")",?9,$PIECE(^APCMM25L(X,0),U,3)
SET APCMY(APCMC)=X
+15 SET DIR(0)="L^1:"_APCMC
SET DIR("A")="Which item(s)"
+16 DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+17 IF Y=""
WRITE !,"No REPORTS selected for this objective."
QUIT
+18 IF $DATA(DIRUT)
WRITE !,"No REPORTs selected for this objective."
QUIT
+19 SET APCMANS=Y
SET APCMC=""
FOR APCMI=1:1
SET APCMC=$PIECE(APCMANS,",",APCMI)
IF APCMC=""
QUIT
SET APCMINDL(APCMIND,APCMY(APCMC))=""
End DoDot:1
+20 ;get report type
+21 IF $DATA(DIRUT)
GOTO SI
+22 KILL APCMQUIT
RT ;
+1 SET APCMSUM="S"
TP ;
+1 SET APCMRPTP=""
MUYEAR ;
+1 KILL APCMVDT,APCMPER,APCMEDUD
+2 KILL DIR
SET DIR(0)="D^::EP"
+3 WRITE !!,"Enter the Calendar Year for which the EH is demonstrating Meaningful"
+4 SET DIR("A")="Use. Use a 4 digit year, e.g. 2018"
+5 SET DIR("?")="Enter a valid year."
+6 DO ^DIR
KILL DIR
+7 IF $DATA(DIRUT)
GOTO EP
+8 IF $DATA(DUOUT)
GOTO EP
+9 SET APCMVDT=Y
+10 ;I Y'="3150000",Y'="3160000",Y'="3170000",Y'="3180000" W !!,"You can only enter 2015, 2016, 2017 or 2018" G MUYEAR
+11 IF $EXTRACT(Y,4,7)'="0000"
WRITE !!,"Please enter a year only!",!
GOTO MUYEAR
+12 SET APCMPER=APCMVDT
+13 ;IHS/CMI/LAB - PATCH 9 06/06/2017
IF $EXTRACT(APCMPER,1,3)>316
SET APCMEDUD=$EXTRACT(APCMPER,1,3)_"1231"
+14 ;LOW AND HIGH DATES ALLOWED BELOW
SET APCMLD=$EXTRACT(APCMPER,1,3)_"0101"
SET APCMHD=$EXTRACT(APCMPER,1,3)_"1231"
+15 ;I APCMPER="3150000" S APCMLD=$E(APCMPER,1,3)-1_"1001",APCMHD=$E(APCMPER,1,3)_"1231"
+16 ;
YEAR ;
+1 SET (APCMVDT,APCMBD,APCMED)=""
+2 SET APCMQ=0
+3 Begin DoDot:1
+4 WRITE !!,"Select one of the following:",!
+5 WRITE !?10,"1 User Defined 90-Day Report"
+6 WRITE !?10,"2 Calendar Year"
+7 WRITE !?10,"3 User Defined Date Range"
+8 WRITE !
SET DIR(0)="N^1:3:"
SET DIR("A")="Select Report Period"
KILL DA
DO ^DIR
KILL DIR
+9 IF $DATA(DIRUT)
SET APCMQ=1
QUIT
+10 SET APCMRPTP=Y
+11 IF APCMRPTP=1
DO 5^APCM25H
QUIT
+12 IF APCMRPTP=2
SET APCMBD=$EXTRACT(APCMPER,1,3)_"0101"
SET APCMED=$EXTRACT(APCMPER,1,3)_"1231"
WRITE !!,"Date range is: ",$$FMTE^XLFDT(APCMBD)," - ",$$FMTE^XLFDT(APCMED),"."
QUIT
+13 IF APCMRPTP=3
DO 6^APCM25H
QUIT
End DoDot:1
IF APCMQ
GOTO INTRO
+14 IF APCMBD=""
GOTO TP
+15 IF APCMED=""
GOTO TP
+16 ;
METHOD ;
+1 SET APCMMETH=""
+2 WRITE !
SET DIR(0)="S^E:All Emergency Department;O:Observation Method"
SET DIR("A")="Run the report using which method"
SET DIR("B")="E"
KILL DA
DO ^DIR
KILL DIR
+3 IF $DATA(DIRUT)
GOTO TP
+4 SET APCMMETH=Y
FAC ;
+1 SET APCMFAC=""
+2 WRITE !
+3 SET DIC("A")="Select Hospital or CAH: "
SET DIC="^AUTTLOC("
SET DIC(0)="AEMQ"
SET DIC("B")=$PIECE(^DIC(4,DUZ(2),0),U)
DO ^DIC
KILL DIC,DA
+4 IF Y<0
GOTO METHOD
+5 SET APCMFAC=+Y
PRV ;
+1 SET APCMQUIT=""
DEMO ;
+1 DO DEMOCHK^APCLUTL(.APCMDEMO)
+2 IF APCMDEMO=-1
GOTO FAC
ATTEST ;get answers to attestation questions for each provider.
+1 KILL APCMATTE
+2 DO ATTESTQ^APCM25H
+3 IF APCMQ
GOTO DEMO
SUM ;display summary of this report
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE !,$$CTR("SUMMARY OF MODIFIED STAGE 2-MEANINGFUL USE REPORT TO BE GENERATED")
+3 WRITE !!,"The date ranges for this report are:"
+4 WRITE !?5,"Report Period: ",?31,$$FMTE^XLFDT(APCMBD)," to ",?31,$$FMTE^XLFDT(APCMED)
+5 ;IHS/CMI/LAB - PATCH 9 06/06/2017 PATCH 10 06/20/18
IF $EXTRACT(APCMPER,1,3)>316
IF ($$HAS^APCM25ET("S2.019.H")!($$HAS^APCM25ET("S2.025.H"))!($$HAS^APCM25ET("S2.021.H")))
Begin DoDot:1
+6 SET C=0
+7 WRITE !!,"Please note: the date range is ",$$FMTE^XLFDT(APCMBD)," to ",$$FMTE^XLFDT(APCMEDUD)," for ",!
+8 IF $$HAS^APCM25ET("S2.019.H")
WRITE ?5,"Patient Education",!
+9 IF $$HAS^APCM25ET("S2.025.H")
WRITE ?5,"Patient Electronic Access",!
+10 IF $$HAS^APCM25ET("S2.021.H")
WRITE ?5,"Summary of Care (HIE)",!
End DoDot:1
+11 WRITE !,"Hospital: ",$PIECE(^DIC(4,APCMFAC,0),U,1)
+12 DO PT^APCM25SL
+13 IF APCMROT=""
GOTO DEMO
ZIS ;call to XBDBQUE
+1 DO REPORT^APCM25SL
+2 IF $GET(APCMQUIT)
DO XIT
QUIT
+3 IF APCMRPT=""
DO XIT
QUIT
+4 KILL IOP,%ZIS
IF APCMROT="D"
IF APCMDELT="F"
DO NODEV
DO XIT
QUIT
+5 KILL IOP,%ZIS
WRITE !!
SET %ZIS=$SELECT(APCMDELT'="S":"PQM",1:"PM")
DO ^%ZIS
+6 IF POP
WRITE !,"Report Aborted"
SET DA=APCMRPT
SET DIK="^APCMM14C("
DO ^DIK
KILL DIK
DO XIT
QUIT
+7 IF $DATA(IO("Q"))
GOTO TSKMN
DRIVER ;
+1 DO PROC^APCM25E1
+2 USE IO
+3 DO ^APCM25EP
+4 DO ^%ZISC
+5 DO XIT
+6 QUIT
+7 ;
NODEV ;
+1 SET XBRP=""
SET XBRC="NODEV1^APCM25N"
SET XBRX="XIT^APCM25N"
SET XBNS="APCM"
+2 DO ^XBDBQUE
+3 QUIT
+4 ;
NODEV1 ;
+1 DO PROC^APCM25E1
+2 DO ^APCM25EP
+3 DO ^%ZISC
+4 DO XIT
+5 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("APCM*")=""
+5 SET ZTCPU=$GET(IOCPU)
SET ZTRTN="DRIVER^APCM25N"
SET ZTDTH=""
SET ZTDESC="2015 MU STAGE 2 REPORT"
DO ^%ZTLOAD
DO XIT
QUIT
+6 QUIT
+7 ;
XIT ;
+1 LOCK -^APCMM25C
+2 DO ^%ZISC
+3 DO EN^XBVK("APCM")
+4 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+5 KILL DIRUT,DUOUT,DIR,DOD
+6 KILL DIADD,DLAYGO
+7 DO KILL^AUPNPAT
+8 KILL X,X1,X2,X3,X4,X5,X6
+9 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
+10 KILL N,N1,N2,N3,N4,N5,N6
+11 KILL BD,ED
+12 DO KILL^AUPNPAT
+13 DO ^XBFMK
+14 QUIT
+15 ;
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)!$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")
LISTS ;any lists with measures?
+1 KILL APCMLIST,APCMQUIT
+2 WRITE !!,"PATIENT LISTS"
+3 IF '$DATA(^XUSEC("APCMZ 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 APCMZ 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")="NO"
KILL DA
DO ^DIR
KILL DIR
+6 IF $DATA(DIRUT)!(Y="")
SET APCMQUIT=1
QUIT
+7 IF Y=0
QUIT
+8 KILL APCMLIST
+9 DO EN^APCM25SL
+10 IF '$DATA(APCMLIST)
WRITE !!,"No lists selected.",!
+11 ;I '$D(APCMLIST)!($D(APCMQUIT)) G LISTS ;get report type for each list
IF $DATA(APCMLIST)
SET APCMLIST="A"
+12 QUIT