LRRP8B ;DALISC/TNN/J0 - WKLD STATS REPORT BY SHIFT ; 4/9/93
;;5.2;LAB SERVICE;;Sep 27, 1994
W !!,"ENTRY POINT IS AT EN^LRRP8." H 3 QUIT
;
BUILD ;
N LRGCN,LRCCN,LRDCN
S ^TMP("LR",$J,0)=0
D INITMAN^LRCAPMR1
D GENCOM^LRCAPMR1,CAPCOM^LRCAPMR1
S LRCDT=LRFR-1
F S LRCDT=$O(^LRO(64.1,LRIN,1,LRCDT)) Q:('LRCDT)!(LRCDT>LRTO) D
. D DATCOM^LRCAPMR1
. S LRCC=0
. F S LRCC=$O(^LRO(64.1,LRIN,1,LRCDT,1,LRCC)) Q:'LRCC D
. . I LRCAPS Q:'$D(LRCAPS(LRCC))
. . S LRCAPNAM=$$WKLDNAME^LRCAPU(LRCC)
. . D SHIFT
. . D BMPMANL^LRCAPMR1
Q
SHIFT ;*** If shift, setup start and stop time ranges for each shift ***
N I2
I LRSTFLG=0 S LRNSFT=1,LRST(1)=LRSTRT_"^"_LRSTOP
F I2=1:1:LRNSFT D
. S LRSTRT=$P(LRST(I2),"^"),LRSTOP=$P(LRST(I2),"^",2)
. S LRTIM=LRSTRT-.000001
. F S LRTIM=$O(^LRO(64.1,LRIN,1,LRCDT,1,LRCC,1,LRTIM)) Q:('LRTIM)!(LRTIM>LRSTOP) D
. . S LRREC=$G(^LRO(64.1,LRIN,1,LRCDT,1,LRCC,1,LRTIM,0)) Q:'$L(LRREC)
. . S LRUC=+$P(LRREC,U,3) S:'LRUC LRUC=1
. . S LRA=$P(LRREC,U,7) Q:'LRA
. . I LRAA Q:'$D(LRAA(LRA))
. . S LRANAM=$P($G(^LRO(68,LRA,0)),U) S:LRANAM="" LRANAM="UNKN - "_LRA
. . S ^(0)=^TMP("LR",$J,0)+LRUC
. . S:'$D(^TMP("LR",$J,"AA",LRA,0)) ^(0)=0 S ^(0)=^(0)+LRUC
. . S:'$D(^TMP("LR",$J,"AA",LRA,"SHFT",I2,0)) ^(0)=0 S ^(0)=^(0)+LRUC
. . S:'$D(^TMP("LR",$J,"AA",LRA,"SHFT",I2,"CCN",LRCAPNAM,0)) ^(0)=0_U_LRCAPNUM S $P(^(0),U)=^(0)+LRUC
. . S:'$D(^TMP("LR",$J,"AA",LRA,"CCN",LRCAPNAM,0)) ^(0)=0_U_LRCAPNUM S $P(^(0),U)=^(0)+LRUC
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRRP8B 1497 printed Dec 13, 2024@02:20:06 Page 2
LRRP8B ;DALISC/TNN/J0 - WKLD STATS REPORT BY SHIFT ; 4/9/93
+1 ;;5.2;LAB SERVICE;;Sep 27, 1994
+2 WRITE !!,"ENTRY POINT IS AT EN^LRRP8."
HANG 3
QUIT
+3 ;
BUILD ;
+1 NEW LRGCN,LRCCN,LRDCN
+2 SET ^TMP("LR",$JOB,0)=0
+3 DO INITMAN^LRCAPMR1
+4 DO GENCOM^LRCAPMR1
DO CAPCOM^LRCAPMR1
+5 SET LRCDT=LRFR-1
+6 FOR
SET LRCDT=$ORDER(^LRO(64.1,LRIN,1,LRCDT))
if ('LRCDT)!(LRCDT>LRTO)
QUIT
Begin DoDot:1
+7 DO DATCOM^LRCAPMR1
+8 SET LRCC=0
+9 FOR
SET LRCC=$ORDER(^LRO(64.1,LRIN,1,LRCDT,1,LRCC))
if 'LRCC
QUIT
Begin DoDot:2
+10 IF LRCAPS
if '$DATA(LRCAPS(LRCC))
QUIT
+11 SET LRCAPNAM=$$WKLDNAME^LRCAPU(LRCC)
+12 DO SHIFT
+13 DO BMPMANL^LRCAPMR1
End DoDot:2
End DoDot:1
+14 QUIT
SHIFT ;*** If shift, setup start and stop time ranges for each shift ***
+1 NEW I2
+2 IF LRSTFLG=0
SET LRNSFT=1
SET LRST(1)=LRSTRT_"^"_LRSTOP
+3 FOR I2=1:1:LRNSFT
Begin DoDot:1
+4 SET LRSTRT=$PIECE(LRST(I2),"^")
SET LRSTOP=$PIECE(LRST(I2),"^",2)
+5 SET LRTIM=LRSTRT-.000001
+6 FOR
SET LRTIM=$ORDER(^LRO(64.1,LRIN,1,LRCDT,1,LRCC,1,LRTIM))
if ('LRTIM)!(LRTIM>LRSTOP)
QUIT
Begin DoDot:2
+7 SET LRREC=$GET(^LRO(64.1,LRIN,1,LRCDT,1,LRCC,1,LRTIM,0))
if '$LENGTH(LRREC)
QUIT
+8 SET LRUC=+$PIECE(LRREC,U,3)
if 'LRUC
SET LRUC=1
+9 SET LRA=$PIECE(LRREC,U,7)
if 'LRA
QUIT
+10 IF LRAA
if '$DATA(LRAA(LRA))
QUIT
+11 SET LRANAM=$PIECE($GET(^LRO(68,LRA,0)),U)
if LRANAM=""
SET LRANAM="UNKN - "_LRA
+12 SET ^(0)=^TMP("LR",$JOB,0)+LRUC
+13 if '$DATA(^TMP("LR",$JOB,"AA",LRA,0))
SET ^(0)=0
SET ^(0)=^(0)+LRUC
+14 if '$DATA(^TMP("LR",$JOB,"AA",LRA,"SHFT",I2,0))
SET ^(0)=0
SET ^(0)=^(0)+LRUC
+15 if '$DATA(^TMP("LR",$JOB,"AA",LRA,"SHFT",I2,"CCN",LRCAPNAM,0))
SET ^(0)=0_U_LRCAPNUM
SET $PIECE(^(0),U)=^(0)+LRUC
+16 if '$DATA(^TMP("LR",$JOB,"AA",LRA,"CCN",LRCAPNAM,0))
SET ^(0)=0_U_LRCAPNUM
SET $PIECE(^(0),U)=^(0)+LRUC
End DoDot:2
End DoDot:1
+17 QUIT