DGDIST1 ;ALB/MRL - DISPOSITION TIME STUDY, CONTINUED ; 13 MAY 1987
;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
S DGPG=0,(DGL,DGL1)="",$P(DGL,"=",131)="",$P(DGL1,"-",131)="",DGF=""
F I=0:0 S DGF=$O(^UTILITY($J,"DGT","D",DGF)),DGH="" Q:DGF="" I +^(DGF)>0 D H F I1=0:0 S DGH=$O(^UTILITY($J,"DGT","D",DGF,"H",DGH)) D:DGH="" D Q:DGH="" S DGW=0,DGD=^(DGH) D W
G NC:DGDIV S DGW=2,DGF="" D H F I=0:0 S DGF=$O(^UTILITY($J,"DGT","D",DGF)) Q:DGF="" S DGD=^(DGF) D W
S DGW=3,DGD=^UTILITY($J,"DGT") W !,DGL1,!,DGL1 D W S DGN=+^UTILITY($J,"DGT","NC") D C
NC D:$D(^UTILITY($J,"DGT","ND")) LIST G Q^DGDIST
W Q:'$P(DGD,"^",1) I $Y>$S($D(IOSL):(IOSL-6),1:60) D H
W1 S X=+$P(DGD,"^",1),X1=$S(X>0:($P(DGD,"^",2)\X),1:0) I X1>0 S X2=X1\60,X3=X1-(X2*60),X3=$E($S(X3<10:"0"_X3,1:X3)_"00",1,2),X1=X2_":"_X3
E S X1="00:00"
W !,$S('DGW:DGH,DGW=1:"DIVISION SUB-TOTAL",DGW=2:DGF_" DIVISION",1:"MEDICAL CENTER TOTAL"),?35,$J(X,8),?45,$J(X1,9),?57,"|" S DGX=60 F DGY=3:1:11 W ?DGX,$J(+$P(DGD,"^",DGY),6) S DGX=DGX+8
S DGN=0 I DGW=1 S DGN=+^UTILITY($J,"DGT","D",DGF,"NC") D C
Q
H S DGPG=DGPG+1 W @IOF,!,$S(DGW=2:"MEDICAL CENTER TOTAL",1:DGF)_", "_DGHD
W !,DGL,!?57,"|",?85,"# PATIENTS DISPOSITIONED WITHIN",!?57,"|",?126,"Over",!?34,"Number of",?47,"Average",?57,"|",?69,"2",?77,"8",?85,"24",?93,"48",?101,"72",?118,"30",?126,"30"
W !,$S(DGW'=2:"Type of Disposition",1:"Division"),?35,"Patients",?50,"Time",?57,"|",?60,"1 Hour",?69,"Hours",?77,"Hours",?85,"Hours",?93,"Hours",?101,"Hours",?108,"7 days",?118,"days",?126,"Days",!,DGL Q
D S DGW=$S(DGDIV:2,1:1),DGD=^UTILITY($J,"DGT","D",DGF) W !,DGL1,!,DGL1 D W Q
C D LF W !,"NOTE(S)",!,"-------",!,"'Average Time per Disposition' is in HOURS:MINUTES format.",!,"NOTE: Applications without examination are not included in this report."
W !,"Applications for Nursing Home, Domiciliary and Dental Care are not included in this report."
I DGN W !,"There are '",DGN,"' registrations which have not been dispositioned which are not included in the above totals." I 'DGU W " See attached Listing."
TR W !!,DGL,!,DGPR,?120,"Page: ",DGPG Q
LF F DGA=$Y:1:$S($D(IOSL):(IOSL-14),1:52) W !
Q
LIST D H1 S DGP="" F I=0:0 S DGP=$O(^UTILITY($J,"DGT","ND",DGP)) Q:DGP="" F I1=0:0 S I1=$O(^UTILITY($J,"DGT","ND",DGP,I1)) Q:'I1 S DGD=^(I1) D LW
D LF,TR Q
LW I $Y>$S($D(IOSL):(IOSL-6),1:60) D LF,TR,H1
W !,DGP,?45,$P(DGD,"^",1),?60,$P(DGD,"^",2),?100,$P(DGD,"^",3) Q
H1 S DGPG=DGPG+1 W @IOF,!,DGHD,", Undispositioned Registrations",!,DGL,!,"Patient Name",?45,"PT ID",?60,"Division",?100,"Registration Date/Time",!,DGL Q
DGDIST1 ;ALB/MRL - DISPOSITION TIME STUDY, CONTINUED ; 13 MAY 1987
+1 ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
+2 SET DGPG=0
SET (DGL,DGL1)=""
SET $PIECE(DGL,"=",131)=""
SET $PIECE(DGL1,"-",131)=""
SET DGF=""
+3 FOR I=0:0
SET DGF=$ORDER(^UTILITY($JOB,"DGT","D",DGF))
SET DGH=""
IF DGF=""
QUIT
IF +^(DGF)>0
DO H
FOR I1=0:0
SET DGH=$ORDER(^UTILITY($JOB,"DGT","D",DGF,"H",DGH))
IF DGH=""
DO D
IF DGH=""
QUIT
SET DGW=0
SET DGD=^(DGH)
DO W
+4 IF DGDIV
GOTO NC
SET DGW=2
SET DGF=""
DO H
FOR I=0:0
SET DGF=$ORDER(^UTILITY($JOB,"DGT","D",DGF))
IF DGF=""
QUIT
SET DGD=^(DGF)
DO W
+5 SET DGW=3
SET DGD=^UTILITY($JOB,"DGT")
WRITE !,DGL1,!,DGL1
DO W
SET DGN=+^UTILITY($JOB,"DGT","NC")
DO C
NC IF $DATA(^UTILITY($JOB,"DGT","ND"))
DO LIST
GOTO Q^DGDIST
W IF '$PIECE(DGD,"^",1)
QUIT
IF $Y>$SELECT($DATA(IOSL):(IOSL-6),1:60)
DO H
W1 SET X=+$PIECE(DGD,"^",1)
SET X1=$SELECT(X>0:($PIECE(DGD,"^",2)\X),1:0)
IF X1>0
SET X2=X1\60
SET X3=X1-(X2*60)
SET X3=$EXTRACT($SELECT(X3<10:"0"_X3,1:X3)_"00",1,2)
SET X1=X2_":"_X3
+1 IF '$TEST
SET X1="00:00"
+2 WRITE !,$SELECT('DGW:DGH,DGW=1:"DIVISION SUB-TOTAL",DGW=2:DGF_" DIVISION",1:"MEDICAL CENTER TOTAL"),?35,$JUSTIFY(X,8),?45,$JUSTIFY(X1,9),?57,"|"
SET DGX=60
FOR DGY=3:1:11
WRITE ?DGX,$JUSTIFY(+$PIECE(DGD,"^",DGY),6)
SET DGX=DGX+8
+3 SET DGN=0
IF DGW=1
SET DGN=+^UTILITY($JOB,"DGT","D",DGF,"NC")
DO C
+4 QUIT
H SET DGPG=DGPG+1
WRITE @IOF,!,$SELECT(DGW=2:"MEDICAL CENTER TOTAL",1:DGF)_", "_DGHD
+1 WRITE !,DGL,!?57,"|",?85,"# PATIENTS DISPOSITIONED WITHIN",!?57,"|",?126,"Over",!?34,"Number of",?47,"Average",?57,"|",?69,"2",?77,"8",?85,"24",?93,"48",?101,"72",?118,"30",?126,"30"
+2 WRITE !,$SELECT(DGW'=2:"Type of Disposition",1:"Division"),?35,"Patients",?50,"Time",?57,"|",?60,"1 Hour",?69,"Hours",?77,"Hours",?85,"Hours",?93,"Hours",?101,"Hours",?108,"7 days",?118,"days",?126,"Days",!,DGL
QUIT
D SET DGW=$SELECT(DGDIV:2,1:1)
SET DGD=^UTILITY($JOB,"DGT","D",DGF)
WRITE !,DGL1,!,DGL1
DO W
QUIT
C DO LF
WRITE !,"NOTE(S)",!,"-------",!,"'Average Time per Disposition' is in HOURS:MINUTES format.",!,"NOTE: Applications without examination are not included in this report."
+1 WRITE !,"Applications for Nursing Home, Domiciliary and Dental Care are not included in this report."
+2 IF DGN
WRITE !,"There are '",DGN,"' registrations which have not been dispositioned which are not included in the above totals."
IF 'DGU
WRITE " See attached Listing."
TR WRITE !!,DGL,!,DGPR,?120,"Page: ",DGPG
QUIT
LF FOR DGA=$Y:1:$SELECT($DATA(IOSL):(IOSL-14),1:52)
WRITE !
+1 QUIT
LIST DO H1
SET DGP=""
FOR I=0:0
SET DGP=$ORDER(^UTILITY($JOB,"DGT","ND",DGP))
IF DGP=""
QUIT
FOR I1=0:0
SET I1=$ORDER(^UTILITY($JOB,"DGT","ND",DGP,I1))
IF 'I1
QUIT
SET DGD=^(I1)
DO LW
+1 DO LF
DO TR
QUIT
LW IF $Y>$SELECT($DATA(IOSL):(IOSL-6),1:60)
DO LF
DO TR
DO H1
+1 WRITE !,DGP,?45,$PIECE(DGD,"^",1),?60,$PIECE(DGD,"^",2),?100,$PIECE(DGD,"^",3)
QUIT
H1 SET DGPG=DGPG+1
WRITE @IOF,!,DGHD,", Undispositioned Registrations",!,DGL,!,"Patient Name",?45,"PT ID",?60,"Division",?100,"Registration Date/Time",!,DGL
QUIT