APCM14H ; IHS/CMI/LAB - IHS MU ;
;;1.0;IHS MU PERFORMANCE REPORTS;**5,6**;MAR 26, 2012;Build 65
;
;
W:$D(IOF) @IOF
D XIT
INTRO ;
S APCMRPTT=2 ;CONTROL VARIABLE FOR CAH REPORT
S APCMRPTC=$O(^APCMMUCN("B","INTERIM STAGE 1 2014",0))
W !!!
S X=0 F S X=$O(^APCMMUCN(APCMRPTC,15,X)) Q:X'=+X W ^APCMMUCN(APCMRPTC,15,X,0),!
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 X=0 F S X=$O(^APCM14OB(X)) Q:X'=+X I $P(^APCM14OB(X,0),U,2)="H" S APCMIND(X)=""
RT ;
S APCMSUM="S"
TP ;
S APCMRPTP=""
W !! S X=0 F S X=$O(^APCMMUCN(APCMRPTC,18,X)) Q:X'=+X W ^APCMMUCN(APCMRPTC,18,X,0),!
YEAR ;
S (APCMPER,APCMVDT,APCMBD,APCMED)=""
W !!,"Enter the Fiscal Year for which report is to be run. Use a 4 digit",!,"year, e.g. 2014."
S DIR(0)="D^::EP"
S DIR("A")="Enter the Fiscal year"
S DIR("?")="This report is compiled for a period. Enter a valid year."
D ^DIR KILL DIR
I $D(DIRUT) G INTRO
I $D(DUOUT) S DIRUT=1 G INTRO
S APCMVDT=Y
I $E(Y,4,7)'="0000" W !!,"Please enter a year only!",! G YEAR
S APCMPER=APCMVDT
S APCMQ=0
I APCMPER'="3150000" D G:APCMQ YEAR
.W !!,"Select one of the following:",!
.W !?10,"1 Quarter: October 1 - December 31"
.W !?10,"2 Quarter: January 1 - March 31"
.W !?10,"3 Quarter: April 1 - June 30"
.W !?10,"4 Quarter: July 1 - September 30"
.W !?10,"5 User Defined 90-Day Report"
.W !?10,"6 User Defined Date Range"
.S DIR(0)="N^1:6:",DIR("A")="Select Report Period" KILL DA D ^DIR KILL DIR
.I $D(DIRUT) S APCMQ=1
.S APCMRPTP=Y
.I APCMRPTP=1 S APCMBD=($E(APCMPER,1,3)-1)_"1001",APCMED=($E(APCMPER,1,3)-1)_"1231"
.I APCMRPTP=2 S APCMBD=$E(APCMPER,1,3)_"0101",APCMED=$E(APCMPER,1,3)_"0331"
.I APCMRPTP=3 S APCMBD=$E(APCMPER,1,3)_"0401",APCMED=$E(APCMPER,1,3)_"0630"
.I APCMRPTP=4 S APCMBD=$E(APCMPER,1,3)_"0701",APCMED=$E(APCMPER,1,3)_"0930"
.I APCMRPTP=5 D 5 Q
.I APCMRPTP=6 D 6 Q
I APCMPER="3150000" D G:APCMQ YEAR
.W !!,"Select one of the following:",!
.W !?10,"1 Year: October 1 - September 30"
.W !?10,"2 User Defined 90-Day Report"
.W !?10,"3 User Defined Date Range"
.S DIR(0)="N^1:3:",DIR("A")="Select Report Period" KILL DA D ^DIR KILL DIR
.I $D(DIRUT) S APCMQ=1
.S APCMRPTP=Y
.I APCMRPTP=1 S APCMBD=($E(APCMPER,1,3)-1)_"1001",APCMED=($E(APCMPER,1,3)-1)_"1231" Q
.I APCMRPTP=2 D 5 Q
.I APCMRPTP=3 D 6 Q
I APCMBD="" G TP
I APCMED="" G TP
;S X=$O(^APCM14OB("B","S1.002.H",0))
;S APCMQ=""
;I $D(APCMIND(X)),($P($G(^APCCCTRL(DUZ(2),"MU")),U,1)=""!($P($G(^APCCCTRL(DUZ(2),"MU")),U,1)'<APCMBD)) D G:APCMQ XIT
;.S APCMQ=""
;.W !!,"You have chosen to run the Drug Interaction Checks Measure."
;.W !,"Warning: Your MU Clean Date for this measure is either blank"
;.W !,"or set to a date that is after the beginning date of the report"
;.W !,"period. Therefore, you will not meet this measure."
;.S DIR(0)="Y",DIR("A")="Do you wish to continue to run this report",DIR("B")="YES" KILL DA D ^DIR KILL DIR
;.I $D(DIRUT) S APCMQ=1 Q
;.I 'Y S APCMQ=1 Q
;
METHOD ;
S APCMMETH=""
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=""
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 TP
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
F X="S1.002.H","S1.009.H","S1.025.H.1","S1.013.H","S1.018.H","S1.022.H","S1.023.H","S1.024.H" D
.S Z=$O(^APCM14OB("B",X,0))
.I 'Z Q
.I '$D(APCMIND(Z)) Q
.S Y=APCMFAC S APCMATTE(X,Y)=""
I '$D(APCMATTE) G SUM
W !!,"Several Stage 1 Meaningful Use Performance Measures require an attestation of "
W !,"Yes or No for the hospital/CAH for which the report in being run.",!
S DIR(0)="Y",DIR("A")="Do you wish to continue",DIR("B")="YES" KILL DA D ^DIR KILL DIR
I $D(DIRUT) G FAC
I 'Y G FAC
S APCMQ=0
S APCMX="" F S APCMX=$O(APCMATTE(APCMX)) Q:APCMX=""!(APCMQ) D
.;WRITE QUESTION
.W !
.S APCMY=$O(^APCM14OB("B",APCMX,0))
.S X=0 F S X=$O(^APCM14OB(APCMY,19,X)) Q:X'=+X W !,^APCM14OB(APCMY,19,X,0)
.D
..I '$P(^APCM14OB(APCMY,0),U,13),APCMX'="S1.025.H.1" S DIR(0)="Y",DIR("A")="Does "_$E($P(^DIC(4,APCMFAC,0),U,1),1,25)_" attest to this",DIR("B")="YES" KILL DA D ^DIR KILL DIR
..I '$P(^APCM14OB(APCMY,0),U,13),APCMX="S1.025.H.1" S DIR(0)="Y",DIR("A")="Does "_$E($P(^DIC(4,APCMFAC,0),U,1),1,25)_" meet this broadband exclusion",DIR("B")="YES" KILL DA D ^DIR KILL DIR
..I $P(^APCM14OB(APCMY,0),U,13) S DIR(0)="S^Y:YES;N:NO;X:No Registry Available",DIR("A")="Does "_$E($P(^DIC(4,APCMFAC,0),U,1),1,25)_" attest to this",DIR("B")="YES" KILL DA D ^DIR KILL DIR
..I $D(DIRUT) S APCMQ=1 Q
..S APCMATTE(APCMX,APCMFAC)=$S(Y="X":"N/A",Y="Y":"Yes",Y="N":"No",Y:"Yes",1:"No")
I APCMQ G DEMO
SUM ;display summary of this report
W:$D(IOF) @IOF
W !,$$CTR("SUMMARY OF STAGE 1 2014 and/or 2015 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)
W !!,"Hospital: ",$P(^DIC(4,APCMFAC,0),U,1)
D PT^APCM14SL
I APCMROT="" G DEMO
ZIS ;call to XBDBQUE
D REPORT^APCM14SL
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^APCM14E1
U IO
D ^APCM14EP
D ^%ZISC
D XIT
Q
;
NODEV ;
S XBRP="",XBRC="NODEV1^APCM14H",XBRX="XIT^APCM14H",XBNS="APCM"
D ^XBDBQUE
Q
;
NODEV1 ;
D PROC^APCM14E1
D ^APCM14EP
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^APCM14H",ZTDTH="",ZTDESC="2014 MU STAGE 1 REPORT" D ^%ZTLOAD D XIT Q
Q
;
XIT ;
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")
;----------
5 ;EP - TEXT
W !!,"IMPORTANT NOTE: This report may be run for any 90-day period. For submission"
W !,"to CMS, the report should not span Federal Fiscal Years."
W !!,"Enter the start date of the 90-day report period.",!
S (APCMPER,APCMVDT,APCMBD,APCMED)=""
W ! K DIR,X,Y S DIR(0)="D^::EP",DIR("A")="Enter Start Date for the 90-Day Report (e.g. 01/01/2014)" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
I $D(DIRUT) Q
S (APCMPER,APCMVDT)=Y
S APCMBD=Y,APCMED=$$FMADD^XLFDT(APCMBD,89)
Q
6 ;EP - TEXT
D 6^APCM14E
Q
APCM14H ; IHS/CMI/LAB - IHS MU ;
+1 ;;1.0;IHS MU PERFORMANCE REPORTS;**5,6**;MAR 26, 2012;Build 65
+2 ;
+3 ;
+4 IF $DATA(IOF)
WRITE @IOF
+5 DO XIT
INTRO ;
+1 ;CONTROL VARIABLE FOR CAH REPORT
SET APCMRPTT=2
+2 SET APCMRPTC=$ORDER(^APCMMUCN("B","INTERIM STAGE 1 2014",0))
+3 WRITE !!!
+4 SET X=0
FOR
SET X=$ORDER(^APCMMUCN(APCMRPTC,15,X))
IF X'=+X
QUIT
WRITE ^APCMMUCN(APCMRPTC,15,X,0),!
+5 SET DIR(0)="Y"
SET DIR("A")="Do you wish to continue to report"
SET DIR("B")="YES"
KILL DA
DO ^DIR
KILL DIR
+6 IF $DATA(DIRUT)
DO XIT
QUIT
+7 IF 'Y
DO XIT
QUIT
+8 ;gather up measures for this report
+9 SET X=0
FOR
SET X=$ORDER(^APCM14OB(X))
IF X'=+X
QUIT
IF $PIECE(^APCM14OB(X,0),U,2)="H"
SET APCMIND(X)=""
RT ;
+1 SET APCMSUM="S"
TP ;
+1 SET APCMRPTP=""
+2 WRITE !!
SET X=0
FOR
SET X=$ORDER(^APCMMUCN(APCMRPTC,18,X))
IF X'=+X
QUIT
WRITE ^APCMMUCN(APCMRPTC,18,X,0),!
YEAR ;
+1 SET (APCMPER,APCMVDT,APCMBD,APCMED)=""
+2 WRITE !!,"Enter the Fiscal Year for which report is to be run. Use a 4 digit",!,"year, e.g. 2014."
+3 SET DIR(0)="D^::EP"
+4 SET DIR("A")="Enter the Fiscal year"
+5 SET DIR("?")="This report is compiled for a period. Enter a valid year."
+6 DO ^DIR
KILL DIR
+7 IF $DATA(DIRUT)
GOTO INTRO
+8 IF $DATA(DUOUT)
SET DIRUT=1
GOTO INTRO
+9 SET APCMVDT=Y
+10 IF $EXTRACT(Y,4,7)'="0000"
WRITE !!,"Please enter a year only!",!
GOTO YEAR
+11 SET APCMPER=APCMVDT
+12 SET APCMQ=0
+13 IF APCMPER'="3150000"
Begin DoDot:1
+14 WRITE !!,"Select one of the following:",!
+15 WRITE !?10,"1 Quarter: October 1 - December 31"
+16 WRITE !?10,"2 Quarter: January 1 - March 31"
+17 WRITE !?10,"3 Quarter: April 1 - June 30"
+18 WRITE !?10,"4 Quarter: July 1 - September 30"
+19 WRITE !?10,"5 User Defined 90-Day Report"
+20 WRITE !?10,"6 User Defined Date Range"
+21 SET DIR(0)="N^1:6:"
SET DIR("A")="Select Report Period"
KILL DA
DO ^DIR
KILL DIR
+22 IF $DATA(DIRUT)
SET APCMQ=1
+23 SET APCMRPTP=Y
+24 IF APCMRPTP=1
SET APCMBD=($EXTRACT(APCMPER,1,3)-1)_"1001"
SET APCMED=($EXTRACT(APCMPER,1,3)-1)_"1231"
+25 IF APCMRPTP=2
SET APCMBD=$EXTRACT(APCMPER,1,3)_"0101"
SET APCMED=$EXTRACT(APCMPER,1,3)_"0331"
+26 IF APCMRPTP=3
SET APCMBD=$EXTRACT(APCMPER,1,3)_"0401"
SET APCMED=$EXTRACT(APCMPER,1,3)_"0630"
+27 IF APCMRPTP=4
SET APCMBD=$EXTRACT(APCMPER,1,3)_"0701"
SET APCMED=$EXTRACT(APCMPER,1,3)_"0930"
+28 IF APCMRPTP=5
DO 5
QUIT
+29 IF APCMRPTP=6
DO 6
QUIT
End DoDot:1
IF APCMQ
GOTO YEAR
+30 IF APCMPER="3150000"
Begin DoDot:1
+31 WRITE !!,"Select one of the following:",!
+32 WRITE !?10,"1 Year: October 1 - September 30"
+33 WRITE !?10,"2 User Defined 90-Day Report"
+34 WRITE !?10,"3 User Defined Date Range"
+35 SET DIR(0)="N^1:3:"
SET DIR("A")="Select Report Period"
KILL DA
DO ^DIR
KILL DIR
+36 IF $DATA(DIRUT)
SET APCMQ=1
+37 SET APCMRPTP=Y
+38 IF APCMRPTP=1
SET APCMBD=($EXTRACT(APCMPER,1,3)-1)_"1001"
SET APCMED=($EXTRACT(APCMPER,1,3)-1)_"1231"
QUIT
+39 IF APCMRPTP=2
DO 5
QUIT
+40 IF APCMRPTP=3
DO 6
QUIT
End DoDot:1
IF APCMQ
GOTO YEAR
+41 IF APCMBD=""
GOTO TP
+42 IF APCMED=""
GOTO TP
+43 ;S X=$O(^APCM14OB("B","S1.002.H",0))
+44 ;S APCMQ=""
+45 ;I $D(APCMIND(X)),($P($G(^APCCCTRL(DUZ(2),"MU")),U,1)=""!($P($G(^APCCCTRL(DUZ(2),"MU")),U,1)'<APCMBD)) D G:APCMQ XIT
+46 ;.S APCMQ=""
+47 ;.W !!,"You have chosen to run the Drug Interaction Checks Measure."
+48 ;.W !,"Warning: Your MU Clean Date for this measure is either blank"
+49 ;.W !,"or set to a date that is after the beginning date of the report"
+50 ;.W !,"period. Therefore, you will not meet this measure."
+51 ;.S DIR(0)="Y",DIR("A")="Do you wish to continue to run this report",DIR("B")="YES" KILL DA D ^DIR KILL DIR
+52 ;.I $D(DIRUT) S APCMQ=1 Q
+53 ;.I 'Y S APCMQ=1 Q
+54 ;
METHOD ;
+1 SET APCMMETH=""
+2 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 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
+3 IF Y<0
GOTO TP
+4 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 FOR X="S1.002.H","S1.009.H","S1.025.H.1","S1.013.H","S1.018.H","S1.022.H","S1.023.H","S1.024.H"
Begin DoDot:1
+3 SET Z=$ORDER(^APCM14OB("B",X,0))
+4 IF 'Z
QUIT
+5 IF '$DATA(APCMIND(Z))
QUIT
+6 SET Y=APCMFAC
SET APCMATTE(X,Y)=""
End DoDot:1
+7 IF '$DATA(APCMATTE)
GOTO SUM
+8 WRITE !!,"Several Stage 1 Meaningful Use Performance Measures require an attestation of "
+9 WRITE !,"Yes or No for the hospital/CAH for which the report in being run.",!
+10 SET DIR(0)="Y"
SET DIR("A")="Do you wish to continue"
SET DIR("B")="YES"
KILL DA
DO ^DIR
KILL DIR
+11 IF $DATA(DIRUT)
GOTO FAC
+12 IF 'Y
GOTO FAC
+13 SET APCMQ=0
+14 SET APCMX=""
FOR
SET APCMX=$ORDER(APCMATTE(APCMX))
IF APCMX=""!(APCMQ)
QUIT
Begin DoDot:1
+15 ;WRITE QUESTION
+16 WRITE !
+17 SET APCMY=$ORDER(^APCM14OB("B",APCMX,0))
+18 SET X=0
FOR
SET X=$ORDER(^APCM14OB(APCMY,19,X))
IF X'=+X
QUIT
WRITE !,^APCM14OB(APCMY,19,X,0)
+19 Begin DoDot:2
+20 IF '$PIECE(^APCM14OB(APCMY,0),U,13)
IF APCMX'="S1.025.H.1"
SET DIR(0)="Y"
SET DIR("A")="Does "_$EXTRACT($PIECE(^DIC(4,APCMFAC,0),U,1),1,25)_" attest to this"
SET DIR("B")="YES"
KILL DA
DO ^DIR
KILL DIR
+21 IF '$PIECE(^APCM14OB(APCMY,0),U,13)
IF APCMX="S1.025.H.1"
SET DIR(0)="Y"
SET DIR("A")="Does "_$EXTRACT($PIECE(^DIC(4,APCMFAC,0),U,1),1,25)_" meet this broadband exclusion"
SET DIR("B")="YES"
KILL DA
DO ^DIR
KILL DIR
+22 IF $PIECE(^APCM14OB(APCMY,0),U,13)
SET DIR(0)="S^Y:YES;N:NO;X:No Registry Available"
SET DIR("A")="Does "_$EXTRACT($PIECE(^DIC(4,APCMFAC,0),U,1),1,25)_" attest to this"
SET DIR("B")="YES"
KILL DA
DO ^DIR
KILL DIR
+23 IF $DATA(DIRUT)
SET APCMQ=1
QUIT
+24 SET APCMATTE(APCMX,APCMFAC)=$SELECT(Y="X":"N/A",Y="Y":"Yes",Y="N":"No",Y:"Yes",1:"No")
End DoDot:2
End DoDot:1
+25 IF APCMQ
GOTO DEMO
SUM ;display summary of this report
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE !,$$CTR("SUMMARY OF STAGE 1 2014 and/or 2015 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 WRITE !!,"Hospital: ",$PIECE(^DIC(4,APCMFAC,0),U,1)
+6 DO PT^APCM14SL
+7 IF APCMROT=""
GOTO DEMO
ZIS ;call to XBDBQUE
+1 DO REPORT^APCM14SL
+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^APCM14E1
+2 USE IO
+3 DO ^APCM14EP
+4 DO ^%ZISC
+5 DO XIT
+6 QUIT
+7 ;
NODEV ;
+1 SET XBRP=""
SET XBRC="NODEV1^APCM14H"
SET XBRX="XIT^APCM14H"
SET XBNS="APCM"
+2 DO ^XBDBQUE
+3 QUIT
+4 ;
NODEV1 ;
+1 DO PROC^APCM14E1
+2 DO ^APCM14EP
+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^APCM14H"
SET ZTDTH=""
SET ZTDESC="2014 MU STAGE 1 REPORT"
DO ^%ZTLOAD
DO XIT
QUIT
+6 QUIT
+7 ;
XIT ;
+1 DO ^%ZISC
+2 DO EN^XBVK("APCM")
+3 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+4 KILL DIRUT,DUOUT,DIR,DOD
+5 KILL DIADD,DLAYGO
+6 DO KILL^AUPNPAT
+7 KILL X,X1,X2,X3,X4,X5,X6
+8 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
+9 KILL N,N1,N2,N3,N4,N5,N6
+10 KILL BD,ED
+11 DO KILL^AUPNPAT
+12 DO ^XBFMK
+13 QUIT
+14 ;
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")
+2 ;----------
5 ;EP - TEXT
+1 WRITE !!,"IMPORTANT NOTE: This report may be run for any 90-day period. For submission"
+2 WRITE !,"to CMS, the report should not span Federal Fiscal Years."
+3 WRITE !!,"Enter the start date of the 90-day report period.",!
+4 SET (APCMPER,APCMVDT,APCMBD,APCMED)=""
+5 WRITE !
KILL DIR,X,Y
SET DIR(0)="D^::EP"
SET DIR("A")="Enter Start Date for the 90-Day Report (e.g. 01/01/2014)"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+6 IF $DATA(DIRUT)
QUIT
+7 SET (APCMPER,APCMVDT)=Y
+8 SET APCMBD=Y
SET APCMED=$$FMADD^XLFDT(APCMBD,89)
+9 QUIT
6 ;EP - TEXT
+1 DO 6^APCM14E
+2 QUIT