APCM14ET ;IHS/CMI/LAB - IHS MU PATIENT LIST;
;;1.0;IHS MU PERFORMANCE REPORTS;**5,6**;MAR 26, 2012;Build 65
;
;
;
W:$D(IOF) @IOF
D XIT
INTRO ;
S APCMRPTT=1 ;CONTROL VARIABLE FOR EP REPORT
S APCMRPTC=$O(^APCMMUCN("B","INTERIM STAGE 1 2014",0))
W !!!
S X=0 F S X=$O(^APCMMUCN(APCMRPTC,11,X)) Q:X'=+X W ^APCMMUCN(APCMRPTC,11,X,0),!
W !!,"This options produces Patient Lists which will display patient-specific "
W !,"data used to calculate the results documented in the Meaningful Use "
W !,"Performance Report. One or more lists may be selected.",!
K DIR S DIR(0)="E",DIR("A")="Press Enter to Continue" D ^DIR K DIR,DUOUT,DIRUT
;NOTICE
W !!
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:Selected set of MU Performance Measures;A:All MU 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^APCM14SI 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(^APCM14OB(X,29,O)) Q:O'=+O S Y=$P(^APCM14OB(X,29,O,0),U,1),Y=$O(^APCM14OB("B",Y,0)) I Y S APCMIND(Y)=""
I APCMINDZ="A" S X=0 F S X=$O(^APCM14OB(X)) Q:X'=+X I $P(^APCM14OB(X,0),U,2)="E" S APCMIND(X)=""
SI D LISTS
I APCMQ 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(^APCM14OB(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="AEP"
.K APCMX S APCMO=0,X=0,APCMC=0 F S APCMO=$O(^APCMM14L(APCMCR,APCMIND,APCMO)) Q:APCMO'=+APCMO!($D(DIRUT)) D
..S X=$O(^APCMM14L(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(^APCM14OB(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(^APCMM14L(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 ;D RT^APCM14SL I '$D(APCMLIST)!($D(APCMQUIT)) G SI
RT ;
S APCMSUM="S"
TP ;
S APCMRPTP=""
;W !!,"Report may be run for a quarter, 90-days, a one year or a user defined period."
;display note
W !!
S X=0 F S X=$O(^APCMMUCN(APCMRPTC,17,X)) Q:X'=+X W ^APCMMUCN(APCMRPTC,17,X,0),!
YEAR ;
S (APCMPER,APCMVDT,APCMBD,APCMED)=""
W !!,"Enter the Calendar 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 Calendar 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: January 1 - March 31"
.W !?10,"2 Quarter: April 1 - June 30"
.W !?10,"3 Quarter: July 1 - September 30"
.W !?10,"4 Quarter: October 1 - December 31"
.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)_"0101",APCMED=$E(APCMPER,1,3)_"0331" Q
.I APCMRPTP=2 S APCMBD=$E(APCMPER,1,3)_"0401",APCMED=$E(APCMPER,1,3)_"0630" Q
.I APCMRPTP=3 S APCMBD=$E(APCMPER,1,3)_"0701",APCMED=$E(APCMPER,1,3)_"0930" Q
.I APCMRPTP=4 S APCMBD=$E(APCMPER,1,3)_"1001",APCMED=$E(APCMPER,1,3)_"1231" Q
.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: January 1 - December 31"
.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)_"0101",APCMED=$E(APCMPER,1,3)_"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.EP",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
PRV ;
S APCMPLTY=""
S DIR(0)="S^IP:Individual Provider;SEL:Selected Providers (User Defined);TAX:Provider Taxonomy List",DIR("A")="Enter Selection" KILL DA D ^DIR KILL DIR
I $D(DIRUT) G TP
S APCMPLTY=Y
S APCMQUIT=""
I APCMPLTY="IP" D I $G(APCMQUIT) G PRV
.K APCMPRV
.W !!,"Enter the name of the provider for whom the Meaningful Use Patient List will be run.",!
.S DIC="^VA(200,",DIC(0)="AEMQ",D="AK.PROVIDER",DIC("A")="Enter PROVIDER NAME: " D MIX^DIC1 K DIC,D
.I Y<0 S APCMQUIT=1 Q
.S APCMPRV(+Y)=""
I APCMPLTY="SEL" D I $G(APCMQUIT) G PRV
.K APCMPRV
.W !!,"Enter the name of the provider for whom the Meaningful Use Patient List will be run.",!
SEL1 .S DIC="^VA(200,",DIC(0)="AEMQ",D="AK.PROVIDER",DIC("A")="Enter PROVIDER NAME: " D MIX^DIC1 K DIC,D
.I Y<0,'$D(APCMPRV) S APCMQUIT=1 Q
.I Y<0 Q
.S APCMPRV(+Y)=""
.G SEL1
I APCMPLTY="TAX" D I $G(APCMQUIT) G PRV
.W !!,"Enter the name of the provider taxonomy"
.S DIC="^ATXAX(",DIC("S")="I $P(^(0),U,15)=200",DIC(0)="AEMQ",DIC("A")="Enter PROVIDER TAXONOMY NAME: " D ^DIC K DIC
.I Y<0 S APCMQUIT=1 Q
.S APCMPRTX=+Y
.W !,"The following providers are members of this taxonomy: "
.S X=0 F S X=$O(^ATXAX(+Y,21,"B",X)) Q:X'=+X S APCMPRV(X)="" W !?5,"- ",$P(^VA(200,X,0),U,1)
DEMO ;
D DEMOCHK^APCLUTL(.APCMDEMO)
I APCMDEMO=-1 G PRV
ASKADD ;
K APCMADDQ,APCMATTE
S A=$O(^APCM14OB("B","S1.008.EP",0))
S B=$O(^APCM14OB("B","S1.003.EP",0))
S C=$O(^APCM14OB("B","S1.020.EP",0))
I '$D(APCMIND(A)),'$D(APCMIND(B)),'$D(APCMIND(C)) G ATTEST
W !!,"Please answer the following exclusion questions for each provider."
D EPRES^APCM14E ;ASK ADDITIONAL QUESTIONS FOR E-PRESCRIBING
I APCMQ G DEMO
D VITALS^APCM14E ;ASK ADDITIONAL QUESTIONS FOR VITALS
I APCMQ G ASKADD
D VDT^APCM14E1
I APCMQ G ASKADD
ATTEST ;get answers to attestation questions for each provider.
D ATTESTQ^APCM14E
I APCMQ G DEMO
SUM ;display summary of this report
W:$D(IOF) @IOF
W !,$$CTR("SUMMARY OF STAGE 1 2014/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 !!,"Providers: "
S X=0 F S X=$O(APCMPRV(X)) Q:X'=+X W !?5,$P(^VA(200,X,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 POP W !,"Report Aborted" S DA=APCMRPT,DIK="^APCMM14P(" 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^APCM14ET",XBRX="XIT^APCM14ET",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^APCM14E",ZTDTH="",ZTDESC="2014 MU STAGE 1 REPORT" D ^%ZTLOAD D XIT Q
Q
;
XIT ;
L -^APCMM14C
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
S APCMQ=0
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 APCMQ=1 Q
I Y=0 Q
K APCMLIST
D EN^APCM14SL
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
5 ;
B ;
W !
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 ;
C ;EP
S (APCMPER,APCMVDT,APCMBD,APCMED)=""
K DIR W ! S DIR(0)="DO^::EXP",DIR("A")="Enter Beginning Date"
D ^DIR G:Y<1 CXIT
I Y>DT W !!,"Future dates not allowed." G C
S APCMBD=Y
K DIR S DIR(0)="DO^:DT:EXP",DIR("A")="Enter Ending Date"
D ^DIR G:Y<1 C S APCMED=Y
;
I APCMED<APCMBD D G C
. W !!,$C(7),"Sorry, Ending Date MUST not be earlier than Beginning Date."
Q
CXIT ;
K DIR
Q
APCM14ET ;IHS/CMI/LAB - IHS MU PATIENT LIST;
+1 ;;1.0;IHS MU PERFORMANCE REPORTS;**5,6**;MAR 26, 2012;Build 65
+2 ;
+3 ;
+4 ;
+5 IF $DATA(IOF)
WRITE @IOF
+6 DO XIT
INTRO ;
+1 ;CONTROL VARIABLE FOR EP REPORT
SET APCMRPTT=1
+2 SET APCMRPTC=$ORDER(^APCMMUCN("B","INTERIM STAGE 1 2014",0))
+3 WRITE !!!
+4 SET X=0
FOR
SET X=$ORDER(^APCMMUCN(APCMRPTC,11,X))
IF X'=+X
QUIT
WRITE ^APCMMUCN(APCMRPTC,11,X,0),!
+5 WRITE !!,"This options produces Patient Lists which will display patient-specific "
+6 WRITE !,"data used to calculate the results documented in the Meaningful Use "
+7 WRITE !,"Performance Report. One or more lists may be selected.",!
+8 KILL DIR
SET DIR(0)="E"
SET DIR("A")="Press Enter to Continue"
DO ^DIR
KILL DIR,DUOUT,DIRUT
+9 ;NOTICE
+10 WRITE !!
+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:Selected set of MU Performance Measures;A:All MU 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^APCM14SI
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(^APCM14OB(X,29,O))
IF O'=+O
QUIT
SET Y=$PIECE(^APCM14OB(X,29,O,0),U,1)
SET Y=$ORDER(^APCM14OB("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(^APCM14OB(X))
IF X'=+X
QUIT
IF $PIECE(^APCM14OB(X,0),U,2)="E"
SET APCMIND(X)=""
SI DO LISTS
+1 IF APCMQ
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(^APCM14OB(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="AEP"
+9 KILL APCMX
SET APCMO=0
SET X=0
SET APCMC=0
FOR
SET APCMO=$ORDER(^APCMM14L(APCMCR,APCMIND,APCMO))
IF APCMO'=+APCMO!($DATA(DIRUT))
QUIT
Begin DoDot:2
+10 SET X=$ORDER(^APCMM14L(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(^APCM14OB(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(^APCMM14L(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 ;D RT^APCM14SL I '$D(APCMLIST)!($D(APCMQUIT)) G SI
KILL APCMQUIT
RT ;
+1 SET APCMSUM="S"
TP ;
+1 SET APCMRPTP=""
+2 ;W !!,"Report may be run for a quarter, 90-days, a one year or a user defined period."
+3 ;display note
+4 WRITE !!
+5 SET X=0
FOR
SET X=$ORDER(^APCMMUCN(APCMRPTC,17,X))
IF X'=+X
QUIT
WRITE ^APCMMUCN(APCMRPTC,17,X,0),!
YEAR ;
+1 SET (APCMPER,APCMVDT,APCMBD,APCMED)=""
+2 WRITE !!,"Enter the Calendar 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 Calendar 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: January 1 - March 31"
+16 WRITE !?10,"2 Quarter: April 1 - June 30"
+17 WRITE !?10,"3 Quarter: July 1 - September 30"
+18 WRITE !?10,"4 Quarter: October 1 - December 31"
+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)_"0101"
SET APCMED=$EXTRACT(APCMPER,1,3)_"0331"
QUIT
+25 IF APCMRPTP=2
SET APCMBD=$EXTRACT(APCMPER,1,3)_"0401"
SET APCMED=$EXTRACT(APCMPER,1,3)_"0630"
QUIT
+26 IF APCMRPTP=3
SET APCMBD=$EXTRACT(APCMPER,1,3)_"0701"
SET APCMED=$EXTRACT(APCMPER,1,3)_"0930"
QUIT
+27 IF APCMRPTP=4
SET APCMBD=$EXTRACT(APCMPER,1,3)_"1001"
SET APCMED=$EXTRACT(APCMPER,1,3)_"1231"
QUIT
+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: January 1 - December 31"
+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)_"0101"
SET APCMED=$EXTRACT(APCMPER,1,3)_"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.EP",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
PRV ;
+1 SET APCMPLTY=""
+2 SET DIR(0)="S^IP:Individual Provider;SEL:Selected Providers (User Defined);TAX:Provider Taxonomy List"
SET DIR("A")="Enter Selection"
KILL DA
DO ^DIR
KILL DIR
+3 IF $DATA(DIRUT)
GOTO TP
+4 SET APCMPLTY=Y
+5 SET APCMQUIT=""
+6 IF APCMPLTY="IP"
Begin DoDot:1
+7 KILL APCMPRV
+8 WRITE !!,"Enter the name of the provider for whom the Meaningful Use Patient List will be run.",!
+9 SET DIC="^VA(200,"
SET DIC(0)="AEMQ"
SET D="AK.PROVIDER"
SET DIC("A")="Enter PROVIDER NAME: "
DO MIX^DIC1
KILL DIC,D
+10 IF Y<0
SET APCMQUIT=1
QUIT
+11 SET APCMPRV(+Y)=""
End DoDot:1
IF $GET(APCMQUIT)
GOTO PRV
+12 IF APCMPLTY="SEL"
Begin DoDot:1
+13 KILL APCMPRV
+14 WRITE !!,"Enter the name of the provider for whom the Meaningful Use Patient List will be run.",!
SEL1 SET DIC="^VA(200,"
SET DIC(0)="AEMQ"
SET D="AK.PROVIDER"
SET DIC("A")="Enter PROVIDER NAME: "
DO MIX^DIC1
KILL DIC,D
+1 IF Y<0
IF '$DATA(APCMPRV)
SET APCMQUIT=1
QUIT
+2 IF Y<0
QUIT
+3 SET APCMPRV(+Y)=""
+4 GOTO SEL1
End DoDot:1
IF $GET(APCMQUIT)
GOTO PRV
+5 IF APCMPLTY="TAX"
Begin DoDot:1
+6 WRITE !!,"Enter the name of the provider taxonomy"
+7 SET DIC="^ATXAX("
SET DIC("S")="I $P(^(0),U,15)=200"
SET DIC(0)="AEMQ"
SET DIC("A")="Enter PROVIDER TAXONOMY NAME: "
DO ^DIC
KILL DIC
+8 IF Y<0
SET APCMQUIT=1
QUIT
+9 SET APCMPRTX=+Y
+10 WRITE !,"The following providers are members of this taxonomy: "
+11 SET X=0
FOR
SET X=$ORDER(^ATXAX(+Y,21,"B",X))
IF X'=+X
QUIT
SET APCMPRV(X)=""
WRITE !?5,"- ",$PIECE(^VA(200,X,0),U,1)
End DoDot:1
IF $GET(APCMQUIT)
GOTO PRV
DEMO ;
+1 DO DEMOCHK^APCLUTL(.APCMDEMO)
+2 IF APCMDEMO=-1
GOTO PRV
ASKADD ;
+1 KILL APCMADDQ,APCMATTE
+2 SET A=$ORDER(^APCM14OB("B","S1.008.EP",0))
+3 SET B=$ORDER(^APCM14OB("B","S1.003.EP",0))
+4 SET C=$ORDER(^APCM14OB("B","S1.020.EP",0))
+5 IF '$DATA(APCMIND(A))
IF '$DATA(APCMIND(B))
IF '$DATA(APCMIND(C))
GOTO ATTEST
+6 WRITE !!,"Please answer the following exclusion questions for each provider."
+7 ;ASK ADDITIONAL QUESTIONS FOR E-PRESCRIBING
DO EPRES^APCM14E
+8 IF APCMQ
GOTO DEMO
+9 ;ASK ADDITIONAL QUESTIONS FOR VITALS
DO VITALS^APCM14E
+10 IF APCMQ
GOTO ASKADD
+11 DO VDT^APCM14E1
+12 IF APCMQ
GOTO ASKADD
ATTEST ;get answers to attestation questions for each provider.
+1 DO ATTESTQ^APCM14E
+2 IF APCMQ
GOTO DEMO
SUM ;display summary of this report
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE !,$$CTR("SUMMARY OF STAGE 1 2014/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 !!,"Providers: "
+6 SET X=0
FOR
SET X=$ORDER(APCMPRV(X))
IF X'=+X
QUIT
WRITE !?5,$PIECE(^VA(200,X,0),U,1)
+7 DO PT^APCM14SL
+8 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 POP
WRITE !,"Report Aborted"
SET DA=APCMRPT
SET DIK="^APCMM14P("
DO ^DIK
KILL DIK
DO XIT
QUIT
+8 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^APCM14ET"
SET XBRX="XIT^APCM14ET"
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^APCM14E"
SET ZTDTH=""
SET ZTDESC="2014 MU STAGE 1 REPORT"
DO ^%ZTLOAD
DO XIT
QUIT
+6 QUIT
+7 ;
XIT ;
+1 LOCK -^APCMM14C
+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")
+2 ;
LISTS ;any lists with measures?
+1 KILL APCMLIST,APCMQUIT
+2 SET APCMQ=0
+3 WRITE !!,"PATIENT LISTS"
+4 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
+5 KILL DIR
SET DIR(0)="E"
SET DIR("A")="Press enter to continue"
DO ^DIR
KILL DIR
End DoDot:1
QUIT
+6 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
+7 IF $DATA(DIRUT)!(Y="")
SET APCMQ=1
QUIT
+8 IF Y=0
QUIT
+9 KILL APCMLIST
+10 DO EN^APCM14SL
+11 IF '$DATA(APCMLIST)
WRITE !!,"No lists selected.",!
+12 ;I '$D(APCMLIST)!($D(APCMQUIT)) G LISTS ;get report type for each list
IF $DATA(APCMLIST)
SET APCMLIST="A"
+13 QUIT
5 ;
B ;
+1 WRITE !
+2 SET (APCMPER,APCMVDT,APCMBD,APCMED)=""
+3 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
+4 IF $DATA(DIRUT)
QUIT
+5 SET (APCMPER,APCMVDT)=Y
+6 SET APCMBD=Y
SET APCMED=$$FMADD^XLFDT(APCMBD,89)
+7 QUIT
6 ;
C ;EP
+1 SET (APCMPER,APCMVDT,APCMBD,APCMED)=""
+2 KILL DIR
WRITE !
SET DIR(0)="DO^::EXP"
SET DIR("A")="Enter Beginning Date"
+3 DO ^DIR
IF Y<1
GOTO CXIT
+4 IF Y>DT
WRITE !!,"Future dates not allowed."
GOTO C
+5 SET APCMBD=Y
+6 KILL DIR
SET DIR(0)="DO^:DT:EXP"
SET DIR("A")="Enter Ending Date"
+7 DO ^DIR
IF Y<1
GOTO C
SET APCMED=Y
+8 ;
+9 IF APCMED<APCMBD
Begin DoDot:1
+10 WRITE !!,$CHAR(7),"Sorry, Ending Date MUST not be earlier than Beginning Date."
End DoDot:1
GOTO C
+11 QUIT
CXIT ;
+1 KILL DIR
+2 QUIT