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

PXRRPAD.m

Go to the documentation of this file.
  1. PXRRPAD ;ISL/PKR,ALB/Zoltan - Driver for PCE Patient Activity Reports.;10/13/2017
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**18,61,211**;Aug 12, 1996;Build 454
  1. MAIN ;
  1. N PXRRPAJB,PXRRPAST,PXRRIOD,PXRROPT,PXRRQUE,PXRRXTMP
  1. S PXRRXTMP=$$XTMPSUB^PXRRGUT("PXRRPA")
  1. S ^XTMP(PXRRXTMP,0)=$$FMADD^XLFDT(DT,7)_U_DT_U_"PXRR Patient Activity"
  1. ;
  1. ;Establish the selection criteria.
  1. FAC ;Get the facility list.
  1. N NFAC,PXRRFAC,PXRRFACN
  1. D FACILITY^PXRRLCSC
  1. I $D(DTOUT)!$D(DUOUT) G EXIT
  1. ;
  1. LOC ;Get the location list.
  1. N NCS,NHL,PXRRCS,PXRRLCHL,PXRRLCSC
  1. D LOC^PXRRLCSC("Determine patient activity for","HS")
  1. I $D(DTOUT) G EXIT
  1. I $D(DUOUT) G FAC
  1. ;
  1. NEWPAGE ;See if the user wants each location to start a new page.
  1. N PXRRLCNP
  1. S PXRRLCNP=0
  1. I (+$G(NCS)>1)!(+$G(NHL)>1)!($P(PXRRLCSC,U,1)="CA")!($P(PXRRLCSC,U,1)="HA") D
  1. . D NEWPAGE^PXRRLCSC
  1. I $D(DTOUT) G EXIT
  1. I $D(DUOUT) G LOC
  1. ;
  1. APDR ;Get the appointment date range.
  1. N BHT,EHT,PXRRBADT,PXRREADT
  1. S BHT(1)="Enter the beginning date to use for identifying patients"
  1. S BHT(2)="with appointments for a location. This date can be a past"
  1. S BHT(3)="or future date. For example, if you want to include patients"
  1. S BHT(4)="you'll be seeing next week, the date"
  1. S BHT(5)="range might be next Monday's date for the APPOINTMENT"
  1. S BHT(6)="BEGINNING DATE and next Friday's date for the APPOINTMENT"
  1. S BHT(7)="ENDING DATE."
  1. S EHT(1)="Enter the ending date to use for identifying patients"
  1. S EHT(2)=BHT(2)
  1. S EHT(3)=BHT(3)
  1. S EHT(4)=BHT(4)
  1. S EHT(5)=BHT(5)
  1. S EHT(6)=BHT(6)
  1. S EHT(7)=BHT(7)
  1. D GDR^PXRRADUT(.PXRRBADT,.PXRREADT,"PATIENT APPOINTMENT",.BHT,.EHT)
  1. I $D(DTOUT) G EXIT
  1. I $D(DUOUT) G NEWPAGE
  1. ;
  1. ACDR ;Get the activity date range.
  1. N PXRRBCDT,PXRRECDT
  1. K BHT,EHT
  1. S BHT(1)="Enter the beginning date for reporting patient activities."
  1. S BHT(2)="This date cannot be a future date. Patient activities include"
  1. S BHT(3)="inpatient activities, emergency room visits, and critical"
  1. S BHT(4)="lab values. For example, if you want to see the last 90"
  1. S BHT(5)="days of patient activity for patients with appointments"
  1. S BHT(6)="within the appointment date range then this date would be"
  1. S BHT(7)="T-90 and the PATIENT ACTIVITY ENDING DATE would be T (today)."
  1. S EHT(1)="Enter the ending date for reporting patient activities."
  1. S EHT(2)="This date cannot be future date or previous to the beginning"
  1. S EHT(3)="date. For example, if you want to see the last 90"
  1. S EHT(4)="days of patient activity for patients with appointments"
  1. S EHT(5)="within the appointment date range then then the PATIENT"
  1. S EHT(6)="PATIENT ACTIVITY BEGINNING DATE would be T-90"
  1. S EHT(7)="and this date T (today), the default."
  1. D PDR^PXRRADUT(.PXRRBCDT,.PXRRECDT,"PATIENT ACTIVITY",.BHT,.EHT)
  1. I $D(DTOUT) G EXIT
  1. I $D(DUOUT) G APDR
  1. ;
  1. FUTDR ;Get the future appointment date range.
  1. N PXRRBFDT,PXRREFDT
  1. K BHT,EHT
  1. S BHT(1)="Enter the beginning date for searching for future"
  1. S BHT(2)="patient appointments. This cannot be a past date, the"
  1. S BHT(3)="default is T (today)."
  1. S EHT(1)="Enter the ending date for searching for future"
  1. S EHT(2)="patient appointments."
  1. D FDR^PXRRADUT(.PXRRBFDT,.PXRREFDT,"FUTURE APPOINTMENT",.BHT,.EHT)
  1. I $D(DTOUT) G EXIT
  1. I $D(DUOUT) G ACDR
  1. ;
  1. ;Determine whether the report should be queued.
  1. S %ZIS="QM"
  1. W !
  1. D ^%ZIS
  1. I POP G EXIT
  1. S PXRRIOD=ION_";"_IOST_";"_IOM_";"_IOSL
  1. S PXRRQUE=$G(IO("Q"))
  1. ;
  1. I PXRRQUE D
  1. . ;Queue the report.
  1. . N DESC,IODEV,ROUTINE
  1. . S DESC="Patient Activity Report - sort appointments"
  1. . S IODEV=""
  1. . S ROUTINE="SORT^PXRRPASA"
  1. . S ^XTMP(PXRRXTMP,"SORTZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRPAD")
  1. .;
  1. . S DESC="Patient Activity Report - patient activities"
  1. . S IODEV=""
  1. . S ROUTINE="PAT^PXRRPAPI"
  1. . S ZTDTH="@"
  1. . S ^XTMP(PXRRXTMP,"PATZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRPAD")
  1. .;
  1. . S DESC="Patient Activity Report - print"
  1. . S IODEV=PXRRIOD
  1. . S ROUTINE="PXRRPAPR"
  1. . S ZTDTH="@"
  1. . S ^XTMP(PXRRXTMP,"PRZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRPAD")
  1. E D SORT^PXRRPASA
  1. Q
  1. ;
  1. ;====================
  1. EXIT ;
  1. D EXIT^PXRRGUT
  1. Q
  1. ;
  1. ;====================
  1. SAVE ;Save the variables for queing.
  1. S ZTSAVE("PXRRBADT")="",ZTSAVE("PXRREADT")=""
  1. S ZTSAVE("PXRRBCDT")="",ZTSAVE("PXRRECDT")=""
  1. S ZTSAVE("PXRRBFDT")="",ZTSAVE("PXRREFDT")=""
  1. S ZTSAVE("PXRRCS(")="",ZTSAVE("NCS")=""
  1. S ZTSAVE("PXRRFAC(")="",ZTSAVE("NFAC")=""
  1. S ZTSAVE("PXRRFACN(")=""
  1. S ZTSAVE("PXRRIOD")=""
  1. S ZTSAVE("PXRRLCHL(")="",ZTSAVE("NHL")=""
  1. S ZTSAVE("PXRRLCNP")=""
  1. S ZTSAVE("PXRRLCSC")=""
  1. S ZTSAVE("PXRRQUE")=""
  1. S ZTSAVE("PXRRXTMP")=""
  1. Q
  1. ;