PXRRPCE ;HIN/MjK - Clinic Specific Workload Reports ;8/28/96
;;1.0;PCE PATIENT CARE ENCOUNTER;**3,146**;Aug 12, 1996
EN D CLEAN^PXRRPCEQ K ^TMP($J) I '$D(PXRRDEMG) S VAUTD=1
CLSTOP ;_._._._._._._._._._._Clinic Vs Stop Code_._._._._._._._._._._.
D HDR^PXRRPCR,MEAN^PXRRPCR:$D(PXRRDEMG) S PXRI=1,DIR(0)="SA^H:HOSPITAL LOCATION;S:CLINIC STOP CODE",DIR("A")="Select clinic(s) by (H)OSPITAL LOCATION or CLINIC (S)TOP CODE: " D ^DIR K DIR G:$D(DIRUT) QT G STOP:Y="S" W !
CLIN ;_._._._._._._._._.Select Clinic for Report_._._._._._._._._.
S DIC="^SC(",DIC(0)="QAENMZ",DIC("S")="I $P(^(0),U,3)=""C""!($P(^(0),U,3)=""Z"")",DIC("A")=$S(PXRI=1:"Select HOSPITAL LOCATION name: ",1:"Another HOSPITAL LOCATION name: ")
D ^DIC I Y>0 S VAUTC=0 S:'$D(PXRI(+Y)) VAUTC(+Y)=+Y S PXRRCLIN(PXRI)=Y(0,0)_U_+Y,PXRI=PXRI+1,PXRI(+Y)="" G CLIN
K DIC G QT:'$D(PXRRCLIN)!($D(DUOUT))
STOP ;_._._._._._._._._.Select Stop Code for Report_._._._._._._._._.
I '$D(PXRRCLIN) W ! S DIC=40.7,DIC(0)="QAENMZ",DIC("A")="Select the CLINIC STOP code: ",DIC("S")="I $P($G(^(0)),U,3)=""""" D ^DIC K DIC G:Y<0 QT S PXRRSC=+Y,PXRSTPNM=Y(0,0)
DTRANGE ;_._._._._._._._._.Select Date Range For Values_._._._._._._._._.
W !! S DIR(0)="DA^2931001:DT:PXEX",DIR("A")="Enter ENCOUNTER BEGINNING DATE: ",DIR("??")="^D BDT^PXRRPCR"
D ^DIR K DIR G:Y'>0 QT S (PXRRBDT,SDBD)=Y+.0001,DIR(0)="DA^"_$P(SDBD,".")_":DT:PXEX",DIR("A")="Enter ENCOUNTER ENDING DATE: ",DIR("B")=$$FMTE^XLFDT(DT),DIR("??")="^D EDT^PXRRPCR" D ^DIR K DIR I Y'>0 G QT
S (PXRREDT,SDED)=Y+.9999
ZIS W ! K IOP,IO("Q") S POP=0,%ZIS="QM" D ^%ZIS K %ZIS,IOP G:POP QT
I $D(IO("Q")) K IOP S ZTRTN=$S($D(PXRRSC):"ST^PXRRPCE",1:"DEMOGR^PXRRPCE"),ZTDESC="PCE CLINICAL DATA REPORTS",ZTSAVE("PXR*")="",ZTSAVE("SD*")="",ZTSAVE("V*")="" D LOAD G QT
STOPCL U IO I $D(PXRRSC) D STPVAUTC
G:$D(PXRRDEMG) DEMOGR
;_._._._._._._._._Clinic Workload Variables_._._._._._._._._._.
ST D:$D(PXRRSC)&('$D(PXRRCLIN)) STPVAUTC
S VAUTD=1
S SDCL="",(SDALL,SDADD,SDPRE)=0,SDF="D",SDRT="E",SDS="C",SDNAM=1
6 S (SDOB,SDPG,SDHR,SD1)=0 F I=0:0 S I=$S(VAUTC:$O(^SC(I)),1:$O(VAUTC(I))) Q:'I D SET^SDCWL3
I '$D(^TMP($J,"CL")),'$D(^("SC")) G NONE
REPORT G QT:'$D(^TMP($J))
VIS ;_._._._._._._._._._._._.Clinic Workload_._._._._._._._._._._._._
I '$D(PXRRCASE)&('$D(PXRRDEMG)) D ^PXRRPCE1,^PXRRPCR1 G QT
ACTIVTY ;_._._._._._._._._._._._Caseload Activity_._._._._._._._._._._._.
I $D(PXRRCASE) D ^PXRRPCE2,^PXRRPCR2 G QT
DEMOGR ;_._._._._._._._._._._._Caseload Demographics_._._._._._._._._._.
I $D(PXRRDEMG) D G QT
. S PXRC=0 F S PXRC=$O(PXRRCLIN(PXRC)) Q:'PXRC S PXRRCLIN=$P(PXRRCLIN(PXRC),U,2) D ^PXRRPCE3,CLEAN^PXRRPCEQ
. D:$D(^TMP($J,"CLINIC TOTALS")) MEAN^PXRRPCE5
. S PXR=0 F S PXR=$O(PXRRCLIN(PXR)) Q:'PXR S PXRRCLIN=$P(PXRRCLIN(PXR),U,2) D ^PXRRPCR3
QT D ^%ZISC,^PXRRPCEQ Q
CQT K PXRRCLIN,PXRRBDT,PXRREDT,PXRSTPNM
NONE D HDR^PXRRPCR W !?5,"o There were no appts for this clinic in this date range",!?5,"o Note: This report is run from patient appts., not clinic enrollment." G QT
LOAD D ^%ZTLOAD
I $D(ZTSK)=0 W !,"Request Cancelled"
E W !,"Request queued, task number "_ZTSK
S:'$D(ZTSK) X="^" I $D(ZTSK),'$D(ZTQUEUED) N POP D ^%ZISC G QT
Q
STPVAUTC ;_._.Set up VAUTC array for Stop Code_._._.
S (VAUTC,X)=0 F S X=$O(^SC("AC","C",X)) Q:'X I $P($G(^SC(X,0)),U,7)=PXRRSC D
. I '$D(^SC(X,"I")) S VAUTC(X)=X,PXRRCLIN(PXRI)=$P(^SC(X,0),U)_U_X,PXRI=PXRI+1 Q
. S Y=$G(^SC(X,"I")) I $P($G(Y),U,2)>$P($G(Y),U) S VAUTC(X)=X,PXRRCLIN(PXRI)=$P(^SC(X,0),U)_U_X,PXRI=PXRI+1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRRPCE 3530 printed Dec 13, 2024@02:30:56 Page 2
PXRRPCE ;HIN/MjK - Clinic Specific Workload Reports ;8/28/96
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**3,146**;Aug 12, 1996
EN DO CLEAN^PXRRPCEQ
KILL ^TMP($JOB)
IF '$DATA(PXRRDEMG)
SET VAUTD=1
CLSTOP ;_._._._._._._._._._._Clinic Vs Stop Code_._._._._._._._._._._.
+1 DO HDR^PXRRPCR
if $DATA(PXRRDEMG)
DO MEAN^PXRRPCR
SET PXRI=1
SET DIR(0)="SA^H:HOSPITAL LOCATION;S:CLINIC STOP CODE"
SET DIR("A")="Select clinic(s) by (H)OSPITAL LOCATION or CLINIC (S)TOP CODE: "
DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO QT
if Y="S"
GOTO STOP
WRITE !
CLIN ;_._._._._._._._._.Select Clinic for Report_._._._._._._._._.
+1 SET DIC="^SC("
SET DIC(0)="QAENMZ"
SET DIC("S")="I $P(^(0),U,3)=""C""!($P(^(0),U,3)=""Z"")"
SET DIC("A")=$SELECT(PXRI=1:"Select HOSPITAL LOCATION name: ",1:"Another HOSPITAL LOCATION name: ")
+2 DO ^DIC
IF Y>0
SET VAUTC=0
if '$DATA(PXRI(+Y))
SET VAUTC(+Y)=+Y
SET PXRRCLIN(PXRI)=Y(0,0)_U_+Y
SET PXRI=PXRI+1
SET PXRI(+Y)=""
GOTO CLIN
+3 KILL DIC
if '$DATA(PXRRCLIN)!($DATA(DUOUT))
GOTO QT
STOP ;_._._._._._._._._.Select Stop Code for Report_._._._._._._._._.
+1 IF '$DATA(PXRRCLIN)
WRITE !
SET DIC=40.7
SET DIC(0)="QAENMZ"
SET DIC("A")="Select the CLINIC STOP code: "
SET DIC("S")="I $P($G(^(0)),U,3)="""""
DO ^DIC
KILL DIC
if Y<0
GOTO QT
SET PXRRSC=+Y
SET PXRSTPNM=Y(0,0)
DTRANGE ;_._._._._._._._._.Select Date Range For Values_._._._._._._._._.
+1 WRITE !!
SET DIR(0)="DA^2931001:DT:PXEX"
SET DIR("A")="Enter ENCOUNTER BEGINNING DATE: "
SET DIR("??")="^D BDT^PXRRPCR"
+2 DO ^DIR
KILL DIR
if Y'>0
GOTO QT
SET (PXRRBDT,SDBD)=Y+.0001
SET DIR(0)="DA^"_$PIECE(SDBD,".")_":DT:PXEX"
SET DIR("A")="Enter ENCOUNTER ENDING DATE: "
SET DIR("B")=$$FMTE^XLFDT(DT)
SET DIR("??")="^D EDT^PXRRPCR"
DO ^DIR
KILL DIR
IF Y'>0
GOTO QT
+3 SET (PXRREDT,SDED)=Y+.9999
ZIS WRITE !
KILL IOP,IO("Q")
SET POP=0
SET %ZIS="QM"
DO ^%ZIS
KILL %ZIS,IOP
if POP
GOTO QT
+1 IF $DATA(IO("Q"))
KILL IOP
SET ZTRTN=$SELECT($DATA(PXRRSC):"ST^PXRRPCE",1:"DEMOGR^PXRRPCE")
SET ZTDESC="PCE CLINICAL DATA REPORTS"
SET ZTSAVE("PXR*")=""
SET ZTSAVE("SD*")=""
SET ZTSAVE("V*")=""
DO LOAD
GOTO QT
STOPCL USE IO
IF $DATA(PXRRSC)
DO STPVAUTC
+1 if $DATA(PXRRDEMG)
GOTO DEMOGR
+2 ;_._._._._._._._._Clinic Workload Variables_._._._._._._._._._.
ST if $DATA(PXRRSC)&('$DATA(PXRRCLIN))
DO STPVAUTC
+1 SET VAUTD=1
+2 SET SDCL=""
SET (SDALL,SDADD,SDPRE)=0
SET SDF="D"
SET SDRT="E"
SET SDS="C"
SET SDNAM=1
6 SET (SDOB,SDPG,SDHR,SD1)=0
FOR I=0:0
SET I=$SELECT(VAUTC:$ORDER(^SC(I)),1:$ORDER(VAUTC(I)))
if 'I
QUIT
DO SET^SDCWL3
+1 IF '$DATA(^TMP($JOB,"CL"))
IF '$DATA(^("SC"))
GOTO NONE
REPORT if '$DATA(^TMP($JOB))
GOTO QT
VIS ;_._._._._._._._._._._._.Clinic Workload_._._._._._._._._._._._._
+1 IF '$DATA(PXRRCASE)&('$DATA(PXRRDEMG))
DO ^PXRRPCE1
DO ^PXRRPCR1
GOTO QT
ACTIVTY ;_._._._._._._._._._._._Caseload Activity_._._._._._._._._._._._.
+1 IF $DATA(PXRRCASE)
DO ^PXRRPCE2
DO ^PXRRPCR2
GOTO QT
DEMOGR ;_._._._._._._._._._._._Caseload Demographics_._._._._._._._._._.
+1 IF $DATA(PXRRDEMG)
Begin DoDot:1
+2 SET PXRC=0
FOR
SET PXRC=$ORDER(PXRRCLIN(PXRC))
if 'PXRC
QUIT
SET PXRRCLIN=$PIECE(PXRRCLIN(PXRC),U,2)
DO ^PXRRPCE3
DO CLEAN^PXRRPCEQ
+3 if $DATA(^TMP($JOB,"CLINIC TOTALS"))
DO MEAN^PXRRPCE5
+4 SET PXR=0
FOR
SET PXR=$ORDER(PXRRCLIN(PXR))
if 'PXR
QUIT
SET PXRRCLIN=$PIECE(PXRRCLIN(PXR),U,2)
DO ^PXRRPCR3
End DoDot:1
GOTO QT
QT DO ^%ZISC
DO ^PXRRPCEQ
QUIT
CQT KILL PXRRCLIN,PXRRBDT,PXRREDT,PXRSTPNM
NONE DO HDR^PXRRPCR
WRITE !?5,"o There were no appts for this clinic in this date range",!?5,"o Note: This report is run from patient appts., not clinic enrollment."
GOTO QT
LOAD DO ^%ZTLOAD
+1 IF $DATA(ZTSK)=0
WRITE !,"Request Cancelled"
+2 IF '$TEST
WRITE !,"Request queued, task number "_ZTSK
+3 if '$DATA(ZTSK)
SET X="^"
IF $DATA(ZTSK)
IF '$DATA(ZTQUEUED)
NEW POP
DO ^%ZISC
GOTO QT
+4 QUIT
STPVAUTC ;_._.Set up VAUTC array for Stop Code_._._.
+1 SET (VAUTC,X)=0
FOR
SET X=$ORDER(^SC("AC","C",X))
if 'X
QUIT
IF $PIECE($GET(^SC(X,0)),U,7)=PXRRSC
Begin DoDot:1
+2 IF '$DATA(^SC(X,"I"))
SET VAUTC(X)=X
SET PXRRCLIN(PXRI)=$PIECE(^SC(X,0),U)_U_X
SET PXRI=PXRI+1
QUIT
+3 SET Y=$GET(^SC(X,"I"))
IF $PIECE($GET(Y),U,2)>$PIECE($GET(Y),U)
SET VAUTC(X)=X
SET PXRRCLIN(PXRI)=$PIECE(^SC(X,0),U)_U_X
SET PXRI=PXRI+1
End DoDot:1
+4 QUIT