[613] | 1 | PXRRPAD ;ISL/PKR,ALB/Zoltan - Driver for PCE Patient Activity Reports.;9/22/98
|
---|
| 2 | ;;1.0;PCE PATIENT CARE ENCOUNTER;**18,61**;Aug 12, 1996
|
---|
| 3 | MAIN ;
|
---|
| 4 | N PXRRPAJB,PXRRPAST,PXRRIOD,PXRROPT,PXRRQUE,PXRRXTMP
|
---|
| 5 | S PXRRXTMP=$$PXRRXTMP^PXRRWLD("PXRRPA")
|
---|
| 6 | S ^XTMP(PXRRXTMP,0)=$$FMADD^XLFDT(DT,7)_U_DT_U_"PXRR Patient Activity"
|
---|
| 7 | ;
|
---|
| 8 | ;Establish the selection criteria.
|
---|
| 9 | FAC ;Get the facility list.
|
---|
| 10 | N NFAC,PXRRFAC,PXRRFACN
|
---|
| 11 | D FACILITY^PXRRLCSC
|
---|
| 12 | I $D(DTOUT)!$D(DUOUT) G EXIT
|
---|
| 13 | ;
|
---|
| 14 | LOC ;Get the location list.
|
---|
| 15 | N NCS,NHL,PXRRCS,PXRRLCHL,PXRRLCSC
|
---|
| 16 | D LOC^PXRRLCSC("Determine patient activity for","HS")
|
---|
| 17 | I $D(DTOUT) G EXIT
|
---|
| 18 | I $D(DUOUT) G FAC
|
---|
| 19 | ;
|
---|
| 20 | NEWPAGE ;See if the user wants each location to start a new page.
|
---|
| 21 | N PXRRLCNP
|
---|
| 22 | S PXRRLCNP=0
|
---|
| 23 | I (+$G(NCS)>1)!(+$G(NHL)>1)!($P(PXRRLCSC,U,1)="CA")!($P(PXRRLCSC,U,1)="HA") D
|
---|
| 24 | . D NEWPAGE^PXRRLCSC
|
---|
| 25 | I $D(DTOUT) G EXIT
|
---|
| 26 | I $D(DUOUT) G LOC
|
---|
| 27 | ;
|
---|
| 28 | APDR ;Get the appointment date range.
|
---|
| 29 | N BHT,EHT,PXRRBADT,PXRREADT
|
---|
| 30 | S BHT(1)="Enter the beginning date to use for identifying patients"
|
---|
| 31 | S BHT(2)="with appointments for a location. This date can be a past"
|
---|
| 32 | S BHT(3)="or future date. For example, if you want to include patients"
|
---|
| 33 | S BHT(4)="you'll be seeing next week, the date"
|
---|
| 34 | S BHT(5)="range might be next Monday's date for the APPOINTMENT"
|
---|
| 35 | S BHT(6)="BEGINNING DATE and next Friday's date for the APPOINTMENT"
|
---|
| 36 | S BHT(7)="ENDING DATE."
|
---|
| 37 | S EHT(1)="Enter the ending date to use for identifying patients"
|
---|
| 38 | S EHT(2)=BHT(2)
|
---|
| 39 | S EHT(3)=BHT(3)
|
---|
| 40 | S EHT(4)=BHT(4)
|
---|
| 41 | S EHT(5)=BHT(5)
|
---|
| 42 | S EHT(6)=BHT(6)
|
---|
| 43 | S EHT(7)=BHT(7)
|
---|
| 44 | D GDR^PXRRADUT(.PXRRBADT,.PXRREADT,"PATIENT APPOINTMENT",.BHT,.EHT)
|
---|
| 45 | I $D(DTOUT) G EXIT
|
---|
| 46 | I $D(DUOUT) G NEWPAGE
|
---|
| 47 | ;
|
---|
| 48 | ACDR ;Get the activity date range.
|
---|
| 49 | N PXRRBCDT,PXRRECDT
|
---|
| 50 | K BHT,EHT
|
---|
| 51 | S BHT(1)="Enter the beginning date for reporting patient activities."
|
---|
| 52 | S BHT(2)="This date cannot be a future date. Patient activities include"
|
---|
| 53 | S BHT(3)="inpatient activities, emergency room visits, and critical"
|
---|
| 54 | S BHT(4)="lab values. For example, if you want to see the last 90"
|
---|
| 55 | S BHT(5)="days of patient activity for patients with appointments"
|
---|
| 56 | S BHT(6)="within the appointment date range then this date would be"
|
---|
| 57 | S BHT(7)="T-90 and the PATIENT ACTIVITY ENDING DATE would be T (today)."
|
---|
| 58 | S EHT(1)="Enter the ending date for reporting patient activities."
|
---|
| 59 | S EHT(2)="This date cannot be future date or previous to the beginning"
|
---|
| 60 | S EHT(3)="date. For example, if you want to see the last 90"
|
---|
| 61 | S EHT(4)="days of patient activity for patients with appointments"
|
---|
| 62 | S EHT(5)="within the appointment date range then then the PATIENT"
|
---|
| 63 | S EHT(6)="PATIENT ACTIVITY BEGINNING DATE would be T-90"
|
---|
| 64 | S EHT(7)="and this date T (today), the default."
|
---|
| 65 | D PDR^PXRRADUT(.PXRRBCDT,.PXRRECDT,"PATIENT ACTIVITY",.BHT,.EHT)
|
---|
| 66 | I $D(DTOUT) G EXIT
|
---|
| 67 | I $D(DUOUT) G APDR
|
---|
| 68 | ;
|
---|
| 69 | FUTDR ;Get the future appointment date range.
|
---|
| 70 | N PXRRBFDT,PXRREFDT
|
---|
| 71 | K BHT,EHT
|
---|
| 72 | S BHT(1)="Enter the beginning date for searching for future"
|
---|
| 73 | S BHT(2)="patient appointments. This cannot be a past date, the"
|
---|
| 74 | S BHT(3)="default is T (today)."
|
---|
| 75 | S EHT(1)="Enter the ending date for searching for future"
|
---|
| 76 | S EHT(2)="patient appointments."
|
---|
| 77 | D FDR^PXRRADUT(.PXRRBFDT,.PXRREFDT,"FUTURE APPOINTMENT",.BHT,.EHT)
|
---|
| 78 | I $D(DTOUT) G EXIT
|
---|
| 79 | I $D(DUOUT) G ACDR
|
---|
| 80 | ;
|
---|
| 81 | ;Determine whether the report should be queued.
|
---|
| 82 | S %ZIS="QM"
|
---|
| 83 | W !
|
---|
| 84 | D ^%ZIS
|
---|
| 85 | I POP G EXIT
|
---|
| 86 | S PXRRIOD=ION_";"_IOST_";"_IOM_";"_IOSL
|
---|
| 87 | S PXRRQUE=$G(IO("Q"))
|
---|
| 88 | ;
|
---|
| 89 | I PXRRQUE D
|
---|
| 90 | . ;Queue the report.
|
---|
| 91 | . N DESC,IODEV,ROUTINE
|
---|
| 92 | . S DESC="Patient Activity Report - sort appointments"
|
---|
| 93 | . S IODEV=""
|
---|
| 94 | . S ROUTINE="SORT^PXRRPASA"
|
---|
| 95 | . S ^XTMP(PXRRXTMP,"SORTZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRPAD")
|
---|
| 96 | .;
|
---|
| 97 | . S DESC="Patient Activity Report - patient activities"
|
---|
| 98 | . S IODEV=""
|
---|
| 99 | . S ROUTINE="PAT^PXRRPAPI"
|
---|
| 100 | . S ZTDTH="@"
|
---|
| 101 | . S ^XTMP(PXRRXTMP,"PATZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRPAD")
|
---|
| 102 | .;
|
---|
| 103 | . S DESC="Patient Activity Report - print"
|
---|
| 104 | . S IODEV=PXRRIOD
|
---|
| 105 | . S ROUTINE="PXRRPAPR"
|
---|
| 106 | . S ZTDTH="@"
|
---|
| 107 | . S ^XTMP(PXRRXTMP,"PRZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRPAD")
|
---|
| 108 | E D SORT^PXRRPASA
|
---|
| 109 | Q
|
---|
| 110 | ;
|
---|
| 111 | ;=======================================================================
|
---|
| 112 | EXIT ;
|
---|
| 113 | D EXIT^PXRRGUT
|
---|
| 114 | Q
|
---|
| 115 | ;
|
---|
| 116 | ;=======================================================================
|
---|
| 117 | SAVE ;Save the variables for queing.
|
---|
| 118 | S ZTSAVE("PXRRBADT")="",ZTSAVE("PXRREADT")=""
|
---|
| 119 | S ZTSAVE("PXRRBCDT")="",ZTSAVE("PXRRECDT")=""
|
---|
| 120 | S ZTSAVE("PXRRBFDT")="",ZTSAVE("PXRREFDT")=""
|
---|
| 121 | S ZTSAVE("PXRRCS(")="",ZTSAVE("NCS")=""
|
---|
| 122 | S ZTSAVE("PXRRFAC(")="",ZTSAVE("NFAC")=""
|
---|
| 123 | S ZTSAVE("PXRRFACN(")=""
|
---|
| 124 | S ZTSAVE("PXRRIOD")=""
|
---|
| 125 | S ZTSAVE("PXRRLCHL(")="",ZTSAVE("NHL")=""
|
---|
| 126 | S ZTSAVE("PXRRLCNP")=""
|
---|
| 127 | S ZTSAVE("PXRRLCSC")=""
|
---|
| 128 | S ZTSAVE("PXRRQUE")=""
|
---|
| 129 | S ZTSAVE("PXRRXTMP")=""
|
---|
| 130 | Q
|
---|
| 131 | ;
|
---|