PXRRPRD ;ISL/PKR,ALB/Zoltan - PCE Provider Encounter reports driver.;10/13/2017
;;1.0;PCE PATIENT CARE ENCOUNTER;**3,10,12,18,61,189,211**;Aug 12, 1996;Build 454
MAIN ;
N PXRRIOD,PXRRPRJB,PXRRPRST,PXRROPT,PXRRQUE,PXRRXTMP
S PXRRXTMP=$$XTMPSUB^PXRRGUT("PXRRPR")
S ^XTMP(PXRRXTMP,0)=$$FMADD^XLFDT(DT,7)_U_DT_U_"PXRR Provider 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
;
DR ;Get the date range.
N PXRRBDT,PXRREDT
D PDR^PXRRADUT(.PXRRBDT,.PXRREDT,"ENCOUNTER")
I $D(DTOUT) G EXIT
I $D(DUOUT) G FAC
;
SCAT ;Get the service categories.
N PXRRSCAT
D SCAT^PXRRECSC
I $D(DTOUT) G EXIT
I $D(DUOUT) G DR
;
PRV ;Get the provider list.
N NCL,NPL,PXRRPECL,PXRRPRPL,PXRRPRSC
D PRV^PXRRPRSC
I $D(DTOUT) G EXIT
I $D(DUOUT) G SCAT
;
PRTY ;Get the report type (detailed or summary).
N PXRRPRTY
D PRTYPE^PXRRPRSC
I $D(DTOUT) G EXIT
I $D(DUOUT) G PRV
;
;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"))
;
;Queue the report.
I PXRRQUE D
. N DESC,IODEV,ROUTINE
. S DESC="Provider Encounter Count Report - sort"
. S IODEV=""
. S ROUTINE="SORT^PXRRPRSE"
. S ^XTMP(PXRRXTMP,"SORTZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRPRD")
.;
. S DESC="Provider Encounter Report - print"
. S IODEV=PXRRIOD
. I $P(PXRRPRTY,U,1)="D" S ROUTINE="PXRRPRDP"
. E S ROUTINE="PXRRPRSP"
. S ZTDTH="@"
. S ^XTMP(PXRRXTMP,"PRZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRPRD")
E D SORT^PXRRPRSE
Q
;
;====================
EXIT ;
D EXIT^PXRRGUT
Q
;
;====================
SAVE ;Save the variables.
S ZTSAVE("PXRRBDT")="",ZTSAVE("PXRREDT")=""
S ZTSAVE("PXRRCS(")="",ZTSAVE("NCS")=""
S ZTSAVE("PXRRFAC(")="",ZTSAVE("NFAC")=""
S ZTSAVE("PXRRFACN(")=""
S ZTSAVE("PXRRIOD")=""
S ZTSAVE("PXRRPECL(")="",ZTSAVE("NCL")=""
S ZTSAVE("PXRRPRPL(")="",ZTSAVE("NPL")=""
S ZTSAVE("PXRRPRSC")=""
S ZTSAVE("PXRRPRTY")=""
S ZTSAVE("PXRRQUE")=""
S ZTSAVE("PXRRSCAT")=""
S ZTSAVE("PXRRXTMP")=""
S ZTSAVE("NONVA")=""
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRRPRD 2228 printed Dec 13, 2024@02:31:09 Page 2
PXRRPRD ;ISL/PKR,ALB/Zoltan - PCE Provider Encounter reports driver.;10/13/2017
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**3,10,12,18,61,189,211**;Aug 12, 1996;Build 454
MAIN ;
+1 NEW PXRRIOD,PXRRPRJB,PXRRPRST,PXRROPT,PXRRQUE,PXRRXTMP
+2 SET PXRRXTMP=$$XTMPSUB^PXRRGUT("PXRRPR")
+3 SET ^XTMP(PXRRXTMP,0)=$$FMADD^XLFDT(DT,7)_U_DT_U_"PXRR Provider 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 ;
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 FAC
+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 ;
PRV ;Get the provider list.
+1 NEW NCL,NPL,PXRRPECL,PXRRPRPL,PXRRPRSC
+2 DO PRV^PXRRPRSC
+3 IF $DATA(DTOUT)
GOTO EXIT
+4 IF $DATA(DUOUT)
GOTO SCAT
+5 ;
PRTY ;Get the report type (detailed or summary).
+1 NEW PXRRPRTY
+2 DO PRTYPE^PXRRPRSC
+3 IF $DATA(DTOUT)
GOTO EXIT
+4 IF $DATA(DUOUT)
GOTO PRV
+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 ;Queue the report.
+15 IF PXRRQUE
Begin DoDot:1
+16 NEW DESC,IODEV,ROUTINE
+17 SET DESC="Provider Encounter Count Report - sort"
+18 SET IODEV=""
+19 SET ROUTINE="SORT^PXRRPRSE"
+20 SET ^XTMP(PXRRXTMP,"SORTZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRPRD")
+21 ;
+22 SET DESC="Provider Encounter Report - print"
+23 SET IODEV=PXRRIOD
+24 IF $PIECE(PXRRPRTY,U,1)="D"
SET ROUTINE="PXRRPRDP"
+25 IF '$TEST
SET ROUTINE="PXRRPRSP"
+26 SET ZTDTH="@"
+27 SET ^XTMP(PXRRXTMP,"PRZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRPRD")
End DoDot:1
+28 IF '$TEST
DO SORT^PXRRPRSE
+29 QUIT
+30 ;
+31 ;====================
EXIT ;
+1 DO EXIT^PXRRGUT
+2 QUIT
+3 ;
+4 ;====================
SAVE ;Save the variables.
+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("PXRRPECL(")=""
SET ZTSAVE("NCL")=""
+7 SET ZTSAVE("PXRRPRPL(")=""
SET ZTSAVE("NPL")=""
+8 SET ZTSAVE("PXRRPRSC")=""
+9 SET ZTSAVE("PXRRPRTY")=""
+10 SET ZTSAVE("PXRRQUE")=""
+11 SET ZTSAVE("PXRRSCAT")=""
+12 SET ZTSAVE("PXRRXTMP")=""
+13 SET ZTSAVE("NONVA")=""
+14 QUIT
+15 ;