Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: APCM11H

APCM11H.m

Go to the documentation of this file.
  1. APCM11H ; IHS/CMI/LAB - IHS MU ;
  1. ;;1.0;IHS MU PERFORMANCE REPORTS;**1**;MAR 26, 2012
  1. ;
  1. ;
  1. W:$D(IOF) @IOF
  1. D XIT
  1. INTRO ;
  1. S APCMRPTT=2 ;CONTROL VARIABLE FOR CAH REPORT
  1. S APCMRPTC=$O(^APCMMUCN("B","INTERIM STAGE 1 2011",0))
  1. W !
  1. S X=0 F S X=$O(^APCMMUCN(APCMRPTC,15,X)) Q:X'=+X W ^APCMMUCN(APCMRPTC,15,X,0),!
  1. K DIR S DIR(0)="E",DIR("A")="Press Enter to Continue" D ^DIR K DIR,DUOUT,DIRUT
  1. ;NOTICE
  1. W !!!
  1. S X=0 F S X=$O(^APCMMUCN(APCMRPTC,12,X)) Q:X'=+X W ^APCMMUCN(APCMRPTC,12,X,0),!
  1. S DIR(0)="Y",DIR("A")="Do you wish to continue to report",DIR("B")="Y" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) D XIT Q
  1. I 'Y D XIT Q
  1. ;gather up measures for this report
  1. S X=0 F S X=$O(^APCMMUM(X)) Q:X'=+X I $P(^APCMMUM(X,0),U,2)="H" S APCMIND(X)=""
  1. RT ;
  1. S APCMSUM=""
  1. W !!,"A full report will include an itemized listing of all Performance Measures "
  1. W !,"and will include a summary report. The summary report excludes itemized data."
  1. W !,"The full report will produce approximately 40 pages of data for the facility."
  1. W !,"Please take this into consideration when running print jobs, ensuring"
  1. W !,"dedicated time on your printer and sufficient paper supplies to complete "
  1. W !,"your job.",!
  1. S DIR(0)="S^F:Full Report;S:Summary Report",DIR("A")="Enter Selection",DIR("B")="F" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) D XIT Q
  1. S APCMSUM=Y
  1. TP ;
  1. S APCMRPTP=""
  1. W !!,"Report may be run for a 90-day, one year or a user defined time period. " ;The 90-day period"
  1. ;W !,"may be automatically defined or user may select a specific start date."
  1. ;W !!,"The automated reprt will return the first 90-day peiod in the calendar"
  1. ;W !,"year in which all meaningful use objectives have been met. If all"
  1. ;W !,"objectives have not been met, the report will return results on the highest"
  1. ;W !,"average 90-day performance period within the calendar year.",!
  1. S DIR(0)="S^A:October 1 - September 30;B:User Defined 90-Day Report;C:User Defined Date Range",DIR("A")="Select Report Period" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G RT
  1. S APCMRPTP=Y
  1. D @APCMRPTP
  1. I APCMBD="" G TP
  1. I APCMED="" G TP
  1. ;I APCMRPTP="C" D I $G(APCMQUIT) G TP
  1. ;.S APCMQUIT=""
  1. ;.W !!,$$CTR("*** IMPORTANT NOTICE ***")
  1. ;.W !,"This report may take several hours to run and could potentially slow"
  1. ;.W !,"your system performance. Please queue this report to run after normal"
  1. ;.W !,"working hours.",!
  1. ;.S DIR(0)="Y",DIR("A")="Do you wish to continue to report",DIR("B")="Y" KILL DA D ^DIR KILL DIR
  1. ;.I $D(DIRUT) S APCMQUIT=1 Q
  1. ;.I 'Y S APCMQUIT=1 Q
  1. S X=$O(^APCMMUM("B","S1.002.H",0))
  1. S APCMQ=""
  1. 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
  1. .S APCMQ=""
  1. .W !!,"You have chosen to run the Drug Interaction Checks Measure."
  1. .W !,"Warning: Your MU Clean Date for this measure is either blank"
  1. .W !,"or set to a date that is after the beginning date of the report"
  1. .W !,"period. Therefore, you will not meet this measure."
  1. .S DIR(0)="Y",DIR("A")="Do you wish to continue to run this report",DIR("B")="Y" KILL DA D ^DIR KILL DIR
  1. .I $D(DIRUT) S APCMQ=1 Q
  1. .I 'Y S APCMQ=1 Q
  1. PP ;
  1. S APCMWPP=""
  1. I APCMRPTP="A" W !!,"Historical data from the previous federal fiscal year can be included in ",!,"this report."
  1. I APCMRPTP="B" W !!,"Historical data from the 90-days immediately preceding the currently",!,"selected report period can be included."
  1. W !,"IMPORTANT NOTICE: Including previous period data may significantly increase ",!,"run time.",!
  1. S DIR(0)="Y",DIR("A")="Do you wish to include the previous period",DIR("B")="Y" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G TP
  1. S APCMWPP=Y
  1. FAC ;
  1. S APCMFAC=""
  1. 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
  1. G:Y<0 TP
  1. S APCMFAC=+Y
  1. PRV ;
  1. ;S APCMIDED=""
  1. ;S DIR(0)="S^HOS:Hospital or CAH;ID:Inpatient Department;ED:Emergency Room Department"
  1. ;S DIR("A")="Enter Selection" KILL DA D ^DIR KILL DIR
  1. ;I $D(DIRUT) G FAC
  1. ;S APCMPLTY=Y
  1. S APCMQUIT=""
  1. DEMO ;
  1. D DEMOCHK^APCLUTL(.APCMDEMO)
  1. I APCMDEMO=-1 G FAC
  1. ATTEST ;get answers to attestation questions for each provider.
  1. K APCMATTE
  1. F X="S1.009.H","S1.012.H","S1.013.H","S1.014.H","S1.018.H","S1.022.H","S1.023.H","S1.024.H" D
  1. .S Z=$O(^APCMMUM("B",X,0))
  1. .I 'Z Q
  1. .I '$D(APCMIND(Z)) Q
  1. .S Y=APCMFAC S APCMATTE(X,Y)=""
  1. I '$D(APCMATTE) G SUM
  1. W !!,"Several Stage 1 Meaningful Use Performance Measures require an attestation of "
  1. W !,"Yes or No for each provider for which the report is being run.",!
  1. S DIR(0)="Y",DIR("A")="Do you wish to continue",DIR("B")="Y" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G FAC
  1. I 'Y G FAC
  1. S APCMQ=0
  1. S APCMX="" F S APCMX=$O(APCMATTE(APCMX)) Q:APCMX=""!(APCMQ) D
  1. .;WRITE QUESTION
  1. .W !
  1. .S APCMY=$O(^APCMMUM("B",APCMX,0))
  1. .S X=0 F S X=$O(^APCMMUM(APCMY,19,X)) Q:X'=+X W !,^APCMMUM(APCMY,19,X,0)
  1. .D
  1. ..I '$P(^APCMMUM(APCMY,0),U,13) S DIR(0)="Y",DIR("A")="Does "_$E($P(^DIC(4,APCMFAC,0),U,1),1,25)_" attest to this",DIR("B")="Y" KILL DA D ^DIR KILL DIR
  1. ..I $P(^APCMMUM(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")="Y" KILL DA D ^DIR KILL DIR
  1. ..I $D(DIRUT) S APCMQ=1 Q
  1. ..S APCMATTE(APCMX,APCMFAC)=$S(Y="X":"N/A",Y="Y":"Yes",Y="N":"No",Y:"Yes",1:"No")
  1. I APCMQ G DEMO
  1. SUM ;display summary of this report
  1. W:$D(IOF) @IOF
  1. W !,$$CTR("SUMMARY OF 2011 MEANINGFUL USE REPORT TO BE GENERATED")
  1. W !!,"The date ranges for this report are:"
  1. W !?5,"Report Period: ",?31,$$FMTE^XLFDT(APCMBD)," to ",?31,$$FMTE^XLFDT(APCMED)
  1. I $G(APCMWPP) W !?5,"Previous Period: ",?31,$$FMTE^XLFDT(APCMPBD)," to ",?31,$$FMTE^XLFDT(APCMPED)
  1. W !!,"Hospital: ",$P(^DIC(4,APCMFAC,0),U,1)
  1. D PT^APCM11SL
  1. I APCMROT="" G DEMO
  1. ZIS ;call to XBDBQUE
  1. D REPORT^APCM11SL
  1. I $G(APCMQUIT) D XIT Q
  1. I APCMRPT="" D XIT Q
  1. K IOP,%ZIS I APCMROT="D",APCMDELT="F" D NODEV,XIT Q
  1. K IOP,%ZIS W !! S %ZIS=$S(APCMDELT'="S":"PQM",1:"PM") D ^%ZIS
  1. I POP W !,"Report Aborted" S DA=APCMRPT,DIK="^APCMMUDC(" D ^DIK K DIK D XIT Q
  1. I POP W !,"Report Aborted" S DA=APCMRPT,DIK="^APCMMUDP(" D ^DIK K DIK D XIT Q
  1. I $D(IO("Q")) G TSKMN
  1. DRIVER ;
  1. D PROC^APCM11E1
  1. U IO
  1. D ^APCM11EP
  1. D ^%ZISC
  1. D XIT
  1. Q
  1. ;
  1. NODEV ;
  1. S XBRP="",XBRC="NODEV1^APCM11H",XBRX="XIT^APCM11H",XBNS="APCM"
  1. D ^XBDBQUE
  1. Q
  1. ;
  1. NODEV1 ;
  1. D PROC^APCM11E1
  1. D ^APCM11EP
  1. D ^%ZISC
  1. D XIT
  1. Q
  1. TSKMN ;EP ENTRY POINT FROM TASKMAN
  1. S ZTIO=$S($D(ION):ION,1:IO) I $D(IOST)#2,IOST]"" S ZTIO=ZTIO_";"_IOST
  1. I $G(IO("DOC"))]"" S ZTIO=ZTIO_";"_$G(IO("DOC"))
  1. I $D(IOM)#2,IOM S ZTIO=ZTIO_";"_IOM I $D(IOSL)#2,IOSL S ZTIO=ZTIO_";"_IOSL
  1. K ZTSAVE S ZTSAVE("APCM*")=""
  1. S ZTCPU=$G(IOCPU),ZTRTN="DRIVER^APCM11E",ZTDTH="",ZTDESC="2011 MU STAGE 1 REPORT" D ^%ZTLOAD D XIT Q
  1. Q
  1. ;
  1. XIT ;
  1. D ^%ZISC
  1. D EN^XBVK("APCM")
  1. I $D(ZTQUEUED) S ZTREQ="@"
  1. K DIRUT,DUOUT,DIR,DOD
  1. K DIADD,DLAYGO
  1. D KILL^AUPNPAT
  1. K X,X1,X2,X3,X4,X5,X6
  1. 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
  1. K N,N1,N2,N3,N4,N5,N6
  1. K BD,ED
  1. D KILL^AUPNPAT
  1. D ^XBFMK
  1. Q
  1. ;
  1. CTR(X,Y) ;EP - Center X in a field Y wide.
  1. Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
  1. ;----------
  1. EOP ;EP - End of page.
  1. Q:$E(IOST)'="C"
  1. Q:$D(ZTQUEUED)!$D(IO("S"))
  1. NEW DIR
  1. K DIR,DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
  1. S DIR(0)="E" D ^DIR KILL DIR
  1. Q
  1. ;----------
  1. USR() ;EP - Return name of current user from ^VA(200.
  1. Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
  1. ;----------
  1. LOC() ;EP - Return location name from file 4 based on DUZ(2).
  1. Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
  1. ;----------
  1. A ;fiscal year
  1. S (APCMPER,APCMVDT,APCMBD,APCMED)=""
  1. W !!,"Enter the Federal Fiscal Year for which report is to be run. Use a 4 digit",!,"year, e.g. 2011."
  1. S DIR(0)="D^::EP"
  1. S DIR("A")="Enter Year"
  1. S DIR("?")="This report is compiled for a period. Enter a valid year."
  1. D ^DIR KILL DIR
  1. I $D(DIRUT) Q
  1. I $D(DUOUT) S DIRUT=1 Q
  1. S APCMVDT=Y
  1. I $E(Y,4,7)'="0000" W !!,"Please enter a year only!",! G A
  1. S APCMPER=APCMVDT
  1. S APCMBD=($E(APCMPER,1,3)-1)_"1001",APCMED=$E(APCMPER,1,3)_"0930"
  1. S APCMPBD=($E(APCMPER,1,3)-2)_"1001",APCMPED=($E(APCMPER,1,3)-1)_"0930"
  1. Q
  1. B ;
  1. W !!,"IMPORTANT NOTE: This report may be run for any 90-day period. For submission"
  1. W !,"to CMS, the report should not span Federal Fiscal Years."
  1. W !!,"Enter the start date of the 90-day report period.",!
  1. S (APCMPER,APCMVDT,APCMBD,APCMED)=""
  1. W ! K DIR,X,Y S DIR(0)="D^::EP",DIR("A")="Enter Start Date for the 90-Day Report (e.g. 01/01/2011)" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) Q
  1. S (APCMPER,APCMVDT)=Y
  1. S APCMBD=Y,APCMED=$$FMADD^XLFDT(APCMBD,89)
  1. S APCMPED=$$FMADD^XLFDT(APCMBD,-1),APCMPBD=$$FMADD^XLFDT(APCMPED,-89)
  1. Q
  1. C ;
  1. D C^APCM11E
  1. Q