PXRRLCD ;ISL/PKR,ALB/Zoltan - PCE Location Encounter reports driver. ;9/22/98
;;1.0;PCE PATIENT CARE ENCOUNTER;**3,10,12,18,61**;Aug 12, 1996
MAIN ;
N PXRRIOD,PXRRLCJB,PXRRLCST,PXRROPT,PXRRQUE,PXRRXTMP
S PXRRXTMP=$$PXRRXTMP^PXRRWLD("PXRRLC")
S ^XTMP(PXRRXTMP,0)=$$FMADD^XLFDT(DT,7)_U_DT_U_"PXRR Location Encounter Count"
;
;Establish the selection criteria.
FAC ;Get the facility list.
N NFAC,PXRRFAC,PXRRFACN
D FACILITY^PXRRLCSC
I $D(DTOUT)!$D(DUOUT) G EXIT
;
LOC ;Get the location list.
N NCS,NHL,PXRRCS,PXRRLCHL,PXRRLCSC
D LOC^PXRRLCSC("Determine encounter counts for","HA")
I $D(DTOUT) G EXIT
I $D(DUOUT) G FAC
;
DR ;Get the date range.
N PXRRBDT,PXRREDT
D PDR^PXRRADUT(.PXRRBDT,.PXRREDT,"ENCOUNTER")
I $D(DTOUT) G EXIT
I $D(DUOUT) G LOC
;
SCAT ;Get the service categories.
N PXRRSCAT
D SCAT^PXRRECSC
I $D(DTOUT) G EXIT
I $D(DUOUT) G DR
;
;Determine whether the report should be queued.
S %ZIS="QM"
W !
D ^%ZIS
I POP G EXIT
S PXRRIOD=ION_";"_IOST_";"_IOM_";"_IOSL
S PXRRQUE=$G(IO("Q"))
;
I PXRRQUE D
. ;Queue the report.
. N DESC,IODEV,ROUTINE
. S DESC="Location Encounter Count Report - sort"
. S IODEV=""
. S ROUTINE="SORT^PXRRLCSE"
. S ^XTMP(PXRRXTMP,"SORTZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRLCD")
.;
. S DESC="Location Encounter Count Report - print"
. S IODEV=PXRRIOD
. I $P(PXRRLCSC,U,1)["C" S ROUTINE="PXRRLCCP"
. E S ROUTINE="PXRRLCHP"
. S ZTDTH="@"
. S ^XTMP(PXRRXTMP,"PRZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRLCD")
E D SORT^PXRRLCSE
Q
;=======================================================================
;
EXIT ;
D EXIT^PXRRGUT
Q
;
;=======================================================================
SAVE ;Save the variables for queing.
S ZTSAVE("PXRRBDT")="",ZTSAVE("PXRREDT")=""
S ZTSAVE("PXRRCS(")="",ZTSAVE("NCS")=""
S ZTSAVE("PXRRFAC(")="",ZTSAVE("NFAC")=""
S ZTSAVE("PXRRFACN(")=""
S ZTSAVE("PXRRIOD")=""
S ZTSAVE("PXRRLCHL(")="",ZTSAVE("NHL")=""
S ZTSAVE("PXRRLCSC")=""
S ZTSAVE("PXRRQUE")=""
S ZTSAVE("PXRRSCAT")=""
S ZTSAVE("PXRRXTMP")=""
Q
;
PXRRLCD ;ISL/PKR,ALB/Zoltan - PCE Location Encounter reports driver. ;9/22/98
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**3,10,12,18,61**;Aug 12, 1996
MAIN ;
+1 NEW PXRRIOD,PXRRLCJB,PXRRLCST,PXRROPT,PXRRQUE,PXRRXTMP
+2 SET PXRRXTMP=$$PXRRXTMP^PXRRWLD("PXRRLC")
+3 SET ^XTMP(PXRRXTMP,0)=$$FMADD^XLFDT(DT,7)_U_DT_U_"PXRR Location Encounter Count"
+4 ;
+5 ;Establish the selection criteria.
FAC ;Get the facility list.
+1 NEW NFAC,PXRRFAC,PXRRFACN
+2 DO FACILITY^PXRRLCSC
+3 IF $DATA(DTOUT)!$DATA(DUOUT)
GOTO EXIT
+4 ;
LOC ;Get the location list.
+1 NEW NCS,NHL,PXRRCS,PXRRLCHL,PXRRLCSC
+2 DO LOC^PXRRLCSC("Determine encounter counts for","HA")
+3 IF $DATA(DTOUT)
GOTO EXIT
+4 IF $DATA(DUOUT)
GOTO FAC
+5 ;
DR ;Get the date range.
+1 NEW PXRRBDT,PXRREDT
+2 DO PDR^PXRRADUT(.PXRRBDT,.PXRREDT,"ENCOUNTER")
+3 IF $DATA(DTOUT)
GOTO EXIT
+4 IF $DATA(DUOUT)
GOTO LOC
+5 ;
SCAT ;Get the service categories.
+1 NEW PXRRSCAT
+2 DO SCAT^PXRRECSC
+3 IF $DATA(DTOUT)
GOTO EXIT
+4 IF $DATA(DUOUT)
GOTO DR
+5 ;
+6 ;Determine whether the report should be queued.
+7 SET %ZIS="QM"
+8 WRITE !
+9 DO ^%ZIS
+10 IF POP
GOTO EXIT
+11 SET PXRRIOD=ION_";"_IOST_";"_IOM_";"_IOSL
+12 SET PXRRQUE=$GET(IO("Q"))
+13 ;
+14 IF PXRRQUE
Begin DoDot:1
+15 ;Queue the report.
+16 NEW DESC,IODEV,ROUTINE
+17 SET DESC="Location Encounter Count Report - sort"
+18 SET IODEV=""
+19 SET ROUTINE="SORT^PXRRLCSE"
+20 SET ^XTMP(PXRRXTMP,"SORTZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRLCD")
+21 ;
+22 SET DESC="Location Encounter Count Report - print"
+23 SET IODEV=PXRRIOD
+24 IF $PIECE(PXRRLCSC,U,1)["C"
SET ROUTINE="PXRRLCCP"
+25 IF '$TEST
SET ROUTINE="PXRRLCHP"
+26 SET ZTDTH="@"
+27 SET ^XTMP(PXRRXTMP,"PRZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRLCD")
End DoDot:1
+28 IF '$TEST
DO SORT^PXRRLCSE
+29 QUIT
+30 ;=======================================================================
+31 ;
EXIT ;
+1 DO EXIT^PXRRGUT
+2 QUIT
+3 ;
+4 ;=======================================================================
SAVE ;Save the variables for queing.
+1 SET ZTSAVE("PXRRBDT")=""
SET ZTSAVE("PXRREDT")=""
+2 SET ZTSAVE("PXRRCS(")=""
SET ZTSAVE("NCS")=""
+3 SET ZTSAVE("PXRRFAC(")=""
SET ZTSAVE("NFAC")=""
+4 SET ZTSAVE("PXRRFACN(")=""
+5 SET ZTSAVE("PXRRIOD")=""
+6 SET ZTSAVE("PXRRLCHL(")=""
SET ZTSAVE("NHL")=""
+7 SET ZTSAVE("PXRRLCSC")=""
+8 SET ZTSAVE("PXRRQUE")=""
+9 SET ZTSAVE("PXRRSCAT")=""
+10 SET ZTSAVE("PXRRXTMP")=""
+11 QUIT
+12 ;