LRRP8B ; IHS/DIR/FJE - WKLD STATS REPORT BY SHIFT ;
;;5.2;LR;**1013**;JUL 15, 2002
;
;;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
LRRP8B ; IHS/DIR/FJE - WKLD STATS REPORT BY SHIFT ;
+1 ;;5.2;LR;**1013**;JUL 15, 2002
+2 ;
+3 ;;5.2;LAB SERVICE;;Sep 27, 1994
+4 WRITE !!,"ENTRY POINT IS AT EN^LRRP8."
HANG 3
QUIT
+5 ;
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