LRARCR3 ; IHS/DIR/AAB - WKLD REP GENERATOR-PRINT 1 ;
;;5.2;LR;**1002**;JUN 01, 1998
;;5.2;LAB SERVICE;**59**;August 31, 1995
;same as LRCAPR3 except references archived files
EN ;
D INIT1
D:('LREND)&(LRANS="D") DET
D:('LREND)&(LRANS="D") INIT2
D:'LREND COND^LRARCR3A
D:'LREND TOTAL
D CLEAN^LRARCR4
Q
INIT1 ;
W:$E(IOST,1,2)="C-" @IOF
S (LREND,LRCONT)=0,(LRPG,LRFL)=1
K LRSTR,LRDSH D NOW^%DTC K %H,%I,X S Y=% D DD^%DT S LRDT=$P(Y,":",1,2)
S $P(LRSTR,"*",80)="*",$P(LRDSH,"-",80)="-"
D BLDHDR^LRARCR4 I 'LRHDRFIT D REPHDR^LRARCR4 Q:LREND
I '$D(^TMP("LRAR",$J,"TST/TOT")) D
. W !!,"*** NO DATA TO REPORT ***"
. D PAUSE^LRARCR4 Q:LREND
. S LREND=1
Q:LREND
S LRSUM=^TMP("LRAR",$J,"TST/TOT")
D NOW^%DTC K %H,%I,X S LRDT=$$DDDATE^LRAFUNC1(%,1)
Q
INIT2 ;
S LRANS="C" ; condense rpt
I $E(IOST,1,2)="C-" D
. S DY=IOSL-3,DX=0
. X:$D(IOXY) IOXY
. W $C(7),!?60,"*** new heading ***"
. D PAUSE^LRARCR4 Q:LREND
W @IOF
Q
DET ;
S LRTST="",K=0
F S LRTST=$O(^TMP("LRAR",$J,"TST",LRTST)) Q:(LRTST="")!(LREND) D
. S LRLC="",LRSUBH=1
. F S LRLC=$O(^TMP("LRAR",$J,"TST",LRTST,LRLC)) Q:(LRLC="")!(LREND) D
. . S LRSUBH=1
. . S LRCAP=""
. . F S LRCAP=$O(^TMP("LRAR",$J,"TST",LRTST,LRLC,LRCAP)) Q:(LRCAP="")!(LREND) S LRCPT=^(LRCAP) D
. . . S LRAA="",J=0,LRSUBH=1
. . . F S LRAA=$O(^TMP("LRAR",$J,"TST",LRTST,LRLC,LRCAP,LRAA)) Q:(LRAA="")!(LREND) D
. . . . S LRCNT=""
. . . . F S LRCNT=$O(^TMP("LRAR",$J,"TST",LRTST,LRLC,LRCAP,LRAA,LRCNT)) Q:(LRCNT="")!(LREND) D
. . . . . S J=J+1
. . . . . I LRFL D HDR^LRARCR4 S LRFL=0
. . . . . S X=^TMP("LRAR",$J,"TST",LRTST,LRLC,LRCAP,LRAA,LRCNT)
. . . . . S LRCODE=$P(X,U,2),LRURGNAM=$S($P(X,U,3)="":"",1:"**")
. . . . . S Y=$P(X,U,1) D DD^%DT S LRVD=Y
. . . . . I LRSUBH D SUBH^LRARCR4 S LRSUBH=0
. . . . . W !,LRURGNAM,?3,LRAA,?36,LRVD
. . . . . S K=K+1 Q:K=LRSUM
. . . . . I $Y+6>IOSL D
. . . . . . D UP^LRARCR4 Q:LREND
. . . . . . W @IOF D HDR^LRARCR4
. . . . . . I J<LRCPT D SUBH^LRARCR4
Q:LREND
I $E(IOST,1,2)="C-" D
. S DY=IOSL-2,DX=0
. X:$D(IOXY) IOXY
. W $C(7),!?56,"*** new sub-heading ***"
. D PAUSE^LRARCR4
Q:LREND
W @IOF D HDR1^LRARCR4
D DATE
Q
DATE ;
S LRSUBH1="TOTAL TESTS by METHODOLOGY by DAY"_" ( "_LRSUM_" )"
W:$D(^TMP("LRAR",$J,"DAY")) !!?15,LRSUBH1,!?15,$E(LRDSH,1,$L(LRSUBH1))
S LRDAT=0
F S LRDAT=$O(^TMP("LRAR",$J,"DAY",LRDAT)) Q:('LRDAT)!(LREND) D
. S LRDATX=^TMP("LRAR",$J,"DAY",LRDAT)
. I $Y+6>IOSL D UP1^LRARCR4 Q:LREND
. S Y=LRDAT D DD^%DT S LRDATD=Y W !!,">>>",?15,LRDATD," = ",LRDATX
. W ?35,$J($FN($S(LRSUM:LRDATX/LRSUM,1:0)*100,"",2),5),"% of Grand Total"
. S LRMAC=""
. F S LRMAC=$O(^TMP("LRAR",$J,"DAY",LRDAT,LRMAC)) Q:(LRMAC="")!(LREND) S LRMCT=^(LRMAC) D
. . I $Y+6>IOSL D UP1^LRARCR4 Q:LREND
. . W !?1,"by ",LRMAC," = ",LRMCT," "
. . W $J($FN($S(LRDATX:LRMCT/LRDATX,1:0)*100,"",2),5)_"% of days workload"
. . S LRTEST=""
. . F I=0:1 S LRTEST=$O(^TMP("LRAR",$J,"DAY",LRDAT,LRMAC,LRTEST)) Q:(LRTEST="")!(LREND) S LRTMTOT=^(LRTEST) D
. . . S X=I#2 W:'X ! W ?X*40+1,LRTEST," = "
. . . W $J(LRTMTOT,4)_" "_$J($FN($S(LRMCT:LRTMTOT/LRMCT,1:0)*100,"",2),5)_"%"
. . . I X,$Y+6>IOSL D UP1^LRARCR4 Q:LREND
Q
TOTAL ;
I $Y+6>IOSL D
. W $C(7)
. D PAUSE^LRARCR4 Q:LREND
. W @IOF D HDR1^LRARCR4
Q:LREND
W !!!?10,"GRAND TOTAL of TESTS DONE = "_LRSUM_" 100.00%"
W !!,?25," ***** end of report *****"
Q
LRARCR3 ; IHS/DIR/AAB - WKLD REP GENERATOR-PRINT 1 ;
+1 ;;5.2;LR;**1002**;JUN 01, 1998
+2 ;;5.2;LAB SERVICE;**59**;August 31, 1995
+3 ;same as LRCAPR3 except references archived files
EN ;
+1 DO INIT1
+2 IF ('LREND)&(LRANS="D")
DO DET
+3 IF ('LREND)&(LRANS="D")
DO INIT2
+4 IF 'LREND
DO COND^LRARCR3A
+5 IF 'LREND
DO TOTAL
+6 DO CLEAN^LRARCR4
+7 QUIT
INIT1 ;
+1 IF $EXTRACT(IOST,1,2)="C-"
WRITE @IOF
+2 SET (LREND,LRCONT)=0
SET (LRPG,LRFL)=1
+3 KILL LRSTR,LRDSH
DO NOW^%DTC
KILL %H,%I,X
SET Y=%
DO DD^%DT
SET LRDT=$PIECE(Y,":",1,2)
+4 SET $PIECE(LRSTR,"*",80)="*"
SET $PIECE(LRDSH,"-",80)="-"
+5 DO BLDHDR^LRARCR4
IF 'LRHDRFIT
DO REPHDR^LRARCR4
IF LREND
QUIT
+6 IF '$DATA(^TMP("LRAR",$JOB,"TST/TOT"))
Begin DoDot:1
+7 WRITE !!,"*** NO DATA TO REPORT ***"
+8 DO PAUSE^LRARCR4
IF LREND
QUIT
+9 SET LREND=1
End DoDot:1
+10 IF LREND
QUIT
+11 SET LRSUM=^TMP("LRAR",$JOB,"TST/TOT")
+12 DO NOW^%DTC
KILL %H,%I,X
SET LRDT=$$DDDATE^LRAFUNC1(%,1)
+13 QUIT
INIT2 ;
+1 ; condense rpt
SET LRANS="C"
+2 IF $EXTRACT(IOST,1,2)="C-"
Begin DoDot:1
+3 SET DY=IOSL-3
SET DX=0
+4 IF $DATA(IOXY)
XECUTE IOXY
+5 WRITE $CHAR(7),!?60,"*** new heading ***"
+6 DO PAUSE^LRARCR4
IF LREND
QUIT
End DoDot:1
+7 WRITE @IOF
+8 QUIT
DET ;
+1 SET LRTST=""
SET K=0
+2 FOR
SET LRTST=$ORDER(^TMP("LRAR",$JOB,"TST",LRTST))
IF (LRTST="")!(LREND)
QUIT
Begin DoDot:1
+3 SET LRLC=""
SET LRSUBH=1
+4 FOR
SET LRLC=$ORDER(^TMP("LRAR",$JOB,"TST",LRTST,LRLC))
IF (LRLC="")!(LREND)
QUIT
Begin DoDot:2
+5 SET LRSUBH=1
+6 SET LRCAP=""
+7 FOR
SET LRCAP=$ORDER(^TMP("LRAR",$JOB,"TST",LRTST,LRLC,LRCAP))
IF (LRCAP="")!(LREND)
QUIT
SET LRCPT=^(LRCAP)
Begin DoDot:3
+8 SET LRAA=""
SET J=0
SET LRSUBH=1
+9 FOR
SET LRAA=$ORDER(^TMP("LRAR",$JOB,"TST",LRTST,LRLC,LRCAP,LRAA))
IF (LRAA="")!(LREND)
QUIT
Begin DoDot:4
+10 SET LRCNT=""
+11 FOR
SET LRCNT=$ORDER(^TMP("LRAR",$JOB,"TST",LRTST,LRLC,LRCAP,LRAA,LRCNT))
IF (LRCNT="")!(LREND)
QUIT
Begin DoDot:5
+12 SET J=J+1
+13 IF LRFL
DO HDR^LRARCR4
SET LRFL=0
+14 SET X=^TMP("LRAR",$JOB,"TST",LRTST,LRLC,LRCAP,LRAA,LRCNT)
+15 SET LRCODE=$PIECE(X,U,2)
SET LRURGNAM=$SELECT($PIECE(X,U,3)="":"",1:"**")
+16 SET Y=$PIECE(X,U,1)
DO DD^%DT
SET LRVD=Y
+17 IF LRSUBH
DO SUBH^LRARCR4
SET LRSUBH=0
+18 WRITE !,LRURGNAM,?3,LRAA,?36,LRVD
+19 SET K=K+1
IF K=LRSUM
QUIT
+20 IF $Y+6>IOSL
Begin DoDot:6
+21 DO UP^LRARCR4
IF LREND
QUIT
+22 WRITE @IOF
DO HDR^LRARCR4
+23 IF J<LRCPT
DO SUBH^LRARCR4
End DoDot:6
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+24 IF LREND
QUIT
+25 IF $EXTRACT(IOST,1,2)="C-"
Begin DoDot:1
+26 SET DY=IOSL-2
SET DX=0
+27 IF $DATA(IOXY)
XECUTE IOXY
+28 WRITE $CHAR(7),!?56,"*** new sub-heading ***"
+29 DO PAUSE^LRARCR4
End DoDot:1
+30 IF LREND
QUIT
+31 WRITE @IOF
DO HDR1^LRARCR4
+32 DO DATE
+33 QUIT
DATE ;
+1 SET LRSUBH1="TOTAL TESTS by METHODOLOGY by DAY"_" ( "_LRSUM_" )"
+2 IF $DATA(^TMP("LRAR",$JOB,"DAY"))
WRITE !!?15,LRSUBH1,!?15,$EXTRACT(LRDSH,1,$LENGTH(LRSUBH1))
+3 SET LRDAT=0
+4 FOR
SET LRDAT=$ORDER(^TMP("LRAR",$JOB,"DAY",LRDAT))
IF ('LRDAT)!(LREND)
QUIT
Begin DoDot:1
+5 SET LRDATX=^TMP("LRAR",$JOB,"DAY",LRDAT)
+6 IF $Y+6>IOSL
DO UP1^LRARCR4
IF LREND
QUIT
+7 SET Y=LRDAT
DO DD^%DT
SET LRDATD=Y
WRITE !!,">>>",?15,LRDATD," = ",LRDATX
+8 WRITE ?35,$JUSTIFY($FNUMBER($SELECT(LRSUM:LRDATX/LRSUM,1:0)*100,"",2),5),"% of Grand Total"
+9 SET LRMAC=""
+10 FOR
SET LRMAC=$ORDER(^TMP("LRAR",$JOB,"DAY",LRDAT,LRMAC))
IF (LRMAC="")!(LREND)
QUIT
SET LRMCT=^(LRMAC)
Begin DoDot:2
+11 IF $Y+6>IOSL
DO UP1^LRARCR4
IF LREND
QUIT
+12 WRITE !?1,"by ",LRMAC," = ",LRMCT," "
+13 WRITE $JUSTIFY($FNUMBER($SELECT(LRDATX:LRMCT/LRDATX,1:0)*100,"",2),5)_"% of days workload"
+14 SET LRTEST=""
+15 FOR I=0:1
SET LRTEST=$ORDER(^TMP("LRAR",$JOB,"DAY",LRDAT,LRMAC,LRTEST))
IF (LRTEST="")!(LREND)
QUIT
SET LRTMTOT=^(LRTEST)
Begin DoDot:3
+16 SET X=I#2
IF 'X
WRITE !
WRITE ?X*40+1,LRTEST," = "
+17 WRITE $JUSTIFY(LRTMTOT,4)_" "_$JUSTIFY($FNUMBER($SELECT(LRMCT:LRTMTOT/LRMCT,1:0)*100,"",2),5)_"%"
+18 IF X
IF $Y+6>IOSL
DO UP1^LRARCR4
IF LREND
QUIT
End DoDot:3
End DoDot:2
End DoDot:1
+19 QUIT
TOTAL ;
+1 IF $Y+6>IOSL
Begin DoDot:1
+2 WRITE $CHAR(7)
+3 DO PAUSE^LRARCR4
IF LREND
QUIT
+4 WRITE @IOF
DO HDR1^LRARCR4
End DoDot:1
+5 IF LREND
QUIT
+6 WRITE !!!?10,"GRAND TOTAL of TESTS DONE = "_LRSUM_" 100.00%"
+7 WRITE !!,?25," ***** end of report *****"
+8 QUIT