- BGPMUEH ; IHS/MSC/JSM/SAT - IHS MU HOSPITAL PERFORMANCE MEASURE REPORT FRONT-END ;02-Mar-2011 16:48;DU
- ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
- ;
- ENTRY ;
- 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^BGPMUEP
- 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="H" ; BGPMU Hospital Measures
- 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^BGPMUEP 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=$E(BGPBD),X2=$E(BGPBD,2,3)
- S X2=X2-1
- I $L(X2)=1 S X2="0"_X2
- I X2>$E(BGPBD,2,3) S X1=X1-1
- S BGPPBD=X1_X2_$E(BGPBD,4,7)
- S X1=$E(BGPED),X2=$E(BGPED,2,3)
- S X2=X2-1
- I $L(X2)=1 S X2="0"_X2
- I X2>$E(BGPED,2,3) S X1=X1-1
- S BGPPED=X1_X2_$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 ;
- W !!
- S DIR(0)="ST^HOS:All Hospital 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="S" D SI I '$D(BGPIND) G SETIND
- GI ;gather all measures
- I BGPINDT="H" D HI
- 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 PH^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 ^BGPMUEHD ;gather data
- U IO
- D ^BGPMUPP ;print/export data
- D ^%ZISC
- K ^TMP($J)
- D XIT
- Q
- ;
- NODEV1 ;
- D ^BGPMUEHD ;gather data
- D ^BGPMUPP ;print/export data
- D ^%ZISC
- D XIT
- Q
- HI ;
- S X=0 F S X=$O(^BGPMUIND(BGPMUYF,"AMS","H",X)) Q:X'=+X S BGPIND(X)=""
- D LISTS
- Q
- SI ;
- K BGPIND
- D ENH^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
- 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^BGPMUEH",ZTDTH="",ZTDESC="MU PERF MEASURE REPORT" D ^%ZTLOAD D XIT Q
- Q
- ;
- NODEV ;
- S XBRP="",XBRC="NODEV1^BGPMUEH",XBRX="XIT^BGPMUEH",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 DFN,IOCPU,IOT
- K XBNS,XBRC,XBRP,XBRX
- K ZTCPU,ZTDESC,ZTIO,ZTQUEUED,ZTRTN,ZTREQ
- 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)!'(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")
- ;----------
- ;
- F ;report start date
- S (BGPPER,BGPVDT)=""
- 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
- Q
- ;
- TESTC ;capture input data
- ; call with D:$G(^TMP("BGPMU0028B","TEST")=1 TESTC
- ; DFN = patient code from VA PATIENT file
- ; BGPBDATE = begin date of report
- ; BGPEDATE = end date of report
- ; BGPPROV = provider code from NEW PERSON file
- ; BGPMUTF = timeframe variable - "C"=current year; "P"=previous year; "B"=baseline year
- ;S ^TMP("BGPMU0028B",$J,"DFN")=DFN
- ;S ^TMP("BGPMU0028B",$J,"BGPBDATE")=BGPBDATE
- ;S ^TMP("BGPMU0028B",$J,"BGPEDATE")=BGPEDATE
- ;S ^TMP("BGPMU0028B",$J,"BGPPROV")=BGPPROV
- ;S ^TMP("BGPMU0028B",$J,"BGPMUTF")=BGPMUTF
- Q
- ;
- BGPMUEH ; IHS/MSC/JSM/SAT - IHS MU HOSPITAL PERFORMANCE MEASURE REPORT FRONT-END ;02-Mar-2011 16:48;DU
- +1 ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
- +2 ;
- ENTRY ;
- +1 IF $DATA(IOF)
- WRITE @IOF
- +2 WRITE !!,$$CTR("IHS Meaningful Use Clinical Quality Measure Report",80)
- +3 WRITE !,$$CTR("Report on all Patients regardless of Community of Residence",80),!!
- +4 DO MUCHECK^BGPMUEP
- +5 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 ; BGPMU Hospital Measures
- SET BGPMUT="H"
- 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^BGPMUEP
- 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 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)
- +25 ;I BGPLEN=365 S BGPED=($E(BGPPER,1,3)+1)_$E(BGPPER,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=$EXTRACT(BGPBD)
- SET X2=$EXTRACT(BGPBD,2,3)
- +3 SET X2=X2-1
- +4 IF $LENGTH(X2)=1
- SET X2="0"_X2
- +5 IF X2>$EXTRACT(BGPBD,2,3)
- SET X1=X1-1
- +6 SET BGPPBD=X1_X2_$EXTRACT(BGPBD,4,7)
- +7 SET X1=$EXTRACT(BGPED)
- SET X2=$EXTRACT(BGPED,2,3)
- +8 SET X2=X2-1
- +9 IF $LENGTH(X2)=1
- SET X2="0"_X2
- +10 IF X2>$EXTRACT(BGPED,2,3)
- SET X1=X1-1
- +11 SET BGPPED=X1_X2_$EXTRACT(BGPED,4,7)
- +12 ;get baseline year
- +13 SET BGPVDT=""
- +14 WRITE !!,"Enter the Baseline Year to compare data to.",!,"Use a 4 digit year, e.g. 1999, 2000"
- +15 SET DIR(0)="D^::EP"
- +16 SET DIR("A")="Enter Year (e.g. 2000)"
- +17 DO ^DIR
- KILL DIR
- +18 IF $DATA(DIRUT)
- GOTO TP
- +19 IF $DATA(DUOUT)
- SET DIRUT=1
- GOTO TP
- +20 SET BGPVDT=Y
- +21 IF $EXTRACT(Y,4,7)'="0000"
- WRITE !!,"Please enter a year only!",!
- GOTO BY
- +22 SET X=$EXTRACT(BGPPER,1,3)-$EXTRACT(BGPVDT,1,3)
- +23 SET X=X_"0000"
- +24 SET BGPBBD=BGPBD-X
- SET BGPBBD=$EXTRACT(BGPBBD,1,3)_$EXTRACT(BGPBD,4,7)
- +25 SET BGPBED=BGPED-X
- SET BGPBED=$EXTRACT(BGPBED,1,3)_$EXTRACT(BGPED,4,7)
- +26 WRITE !!,"The date ranges for this report are:"
- +27 WRITE !?5,"Report Period: ",?31,$$FMTE^XLFDT(BGPBD)," to ",?31,$$FMTE^XLFDT(BGPED)
- +28 WRITE !?5,"Previous Year Period: ",?31,$$FMTE^XLFDT(BGPPBD)," to ",?31,$$FMTE^XLFDT(BGPPED)
- +29 WRITE !?5,"Baseline Period: ",?31,$$FMTE^XLFDT(BGPBBD)," to ",?31,$$FMTE^XLFDT(BGPBED)
- EP ;
- +1 WRITE !!
- +2 SET DIR(0)="ST^HOS:All Hospital Measures;SEL:Selected Measures (User Defined)"
- +3 SET DIR("A")="Which set of Measures should be included in this report"
- KILL DA
- DO ^DIR
- KILL DIR
- +4 IF $DATA(DIRUT)
- DO XIT
- QUIT
- +5 SET BGPINDT=$EXTRACT(Y)
- +6 IF BGPINDT="S"
- DO SI
- IF '$DATA(BGPIND)
- GOTO SETIND
- GI ;gather all measures
- +1 IF BGPINDT="H"
- DO HI
- +2 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 PH^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 ^BGPMUEHD
- +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 ^BGPMUEHD
- +2 ;print/export data
- DO ^BGPMUPP
- +3 DO ^%ZISC
- +4 DO XIT
- +5 QUIT
- HI ;
- +1 SET X=0
- FOR
- SET X=$ORDER(^BGPMUIND(BGPMUYF,"AMS","H",X))
- IF X'=+X
- QUIT
- SET BGPIND(X)=""
- +2 DO LISTS
- +3 QUIT
- SI ;
- +1 KILL BGPIND
- +2 DO ENH^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 IF '$DATA(BGPLIST)
- WRITE !!,"No lists selected.",!
- +11 ;get report type for each list
- IF $DATA(BGPLIST)
- DO RT^BGPMUDSL
- IF '$DATA(BGPLIST)!($DATA(BGPQUIT))
- GOTO LISTS
- +12 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^BGPMUEH"
- SET ZTDTH=""
- SET ZTDESC="MU PERF MEASURE REPORT"
- DO ^%ZTLOAD
- DO XIT
- QUIT
- +6 QUIT
- +7 ;
- NODEV ;
- +1 SET XBRP=""
- SET XBRC="NODEV1^BGPMUEH"
- SET XBRX="XIT^BGPMUEH"
- 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 DFN,IOCPU,IOT
- +7 KILL XBNS,XBRC,XBRP,XBRX
- +8 KILL ZTCPU,ZTDESC,ZTIO,ZTQUEUED,ZTRTN,ZTREQ
- +9 KILL X,X1,X2,X3,X4,X5,X6
- +10 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
- +11 KILL N,N1,N2,N3,N4,N5,N6
- +12 KILL BD,ED
- +13 DO KILL^AUPNPAT
- +14 DO ^XBFMK
- +15 QUIT
- +16 ;
- 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 ;
- F ;report start date
- +1 SET (BGPPER,BGPVDT)=""
- +2 WRITE !!,"Enter the reporting period start date."
- +3 SET DIR(0)="D^::EP"
- +4 SET DIR("A")="Enter 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 BGPPER=BGPVDT
- +11 QUIT
- +12 ;
- TESTC ;capture input data
- +1 ; call with D:$G(^TMP("BGPMU0028B","TEST")=1 TESTC
- +2 ; DFN = patient code from VA PATIENT file
- +3 ; BGPBDATE = begin date of report
- +4 ; BGPEDATE = end date of report
- +5 ; BGPPROV = provider code from NEW PERSON file
- +6 ; BGPMUTF = timeframe variable - "C"=current year; "P"=previous year; "B"=baseline year
- +7 ;S ^TMP("BGPMU0028B",$J,"DFN")=DFN
- +8 ;S ^TMP("BGPMU0028B",$J,"BGPBDATE")=BGPBDATE
- +9 ;S ^TMP("BGPMU0028B",$J,"BGPEDATE")=BGPEDATE
- +10 ;S ^TMP("BGPMU0028B",$J,"BGPPROV")=BGPPROV
- +11 ;S ^TMP("BGPMU0028B",$J,"BGPMUTF")=BGPMUTF
- +12 QUIT
- +13 ;