LRARCMA2 ;DALISC/CKA - ARCHIVED WKLD REPORT BY MAJOR SECTION; 6/1/95
;;5.2;LAB SERVICE;**59**;Aug 31, 1995
;same as LRCAPMA2 except archived wkld file
EN ;
TOP ;
N LRCCNT,LRICNT,LROCNT,LRNCNT,LRACNT,LRCST,LRIST,LROST,LRNST,LRAST
S LRHDR="ARCHIVED WORKLOAD STATISTICS BY MAJOR SECTION"
S LRHDR2="REPORT DATE RANGE: "_LRDT1_" - "_LRDT2
D PRTINIT^LRARCU
S LRAGT=0
S LRGTREC=$G(^TMP("LRAR-WL",$J,0))
I $L(LRGTREC) D
. S LRAGT=+$P(LRGTREC,U)
I $E(IOST,1,2)="C-" W @IOF
D:'LRSUMM DET
D:'LREND SUM^LRARCMA3
D:'LREND PRNTMAN^LRARCMR1
D:'LREND COMM^LRARCMR2
Q
DET ;Detailed section
F LRLDIV="AP","CP" D Q:LREND
. S LRHDR3=$S(LRLDIV="AP":"ANATOMIC PATHOLOGY",1:"CLINICAL PATHOLOGY")
. S LRIN=0
. F S LRIN=$O(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN)) Q:('LRIN)!(LREND) D
. . S LRINN=$S($L($G(^LAR(64.19999,LRIN,0))):$P(^(0),U),1:LRIN)
. . S LRIAGT=0
. . S LRGTREC=$G(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,0))
. . I $L(LRGTREC) D
. . . S LRIAGT=+$P(LRGTREC,U)
. . D PRTDET
. . D:('LREND)&(LRIAGT) INSTSUM
Q
PRTDET ;Print details
D HDR^LRARCU
W !,?(80-$L(LRINN)\2),LRINN,!
S LRMAA=0
F S LRMAA=$O(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA)) Q:(LRMAA="")!($G(LREND)) D
. S LRLSSA=""
. F S LRLSSA=$O(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA)) Q:(LRLSSA="")!($G(LREND)) D LSS
Q:LREND
I $Y>(IOSL-5) D NPG^LRARCU Q:LREND W !,?(80-$L(LRINN)\2),LRINN,!!
I 'LRIAGT D
. W !!!,"NO DATA FOR THIS INSTITUTION AND DATE RANGE",!
E D
. W !!!,"GRAND TOTAL",?43,$J(LRIAGT,7)
D:($E(IOST,1,2)="C-")&('LREND) PAUSE^LRARCU W @IOF
Q
INSTSUM ;
S LRLAB="!!,?(80-7\2),""SUMMARY"",!,?(80-$L(LRINN)\2),LRINN,!!,""MAJOR SECTION"",?15,""LAB SUBSECTION"",?43,"" TOTAL"",!"
D HDR^LRARCU W @LRLAB
S LRMAA=""
F S LRMAA=$O(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA)) Q:(LRMAA="")!(LREND) D
. S LRLSSA=""
. F S LRLSSA=$O(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA)) Q:(LRLSSA="")!(LREND) D PSUM
I $Y>(IOSL-4) D NPG^LRARCU Q:LREND W @LRLAB
W !!,"GRAND TOTAL",?43,$J(LRIAGT,7)
D:($E(IOST,1,2)="C-")&('LREND) PAUSE^LRARCU W @IOF
Q
PSUM ;
Q:LREND
Q:'$D(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,0))#2 S LRX=^(0)
I $Y>(IOSL-3) D NPG^LRARCU Q:LREND W @LRLAB
S LRACNT=$P(LRX,U)
W !,$E(LRMAN(LRMAA),1,14),?15,$E(LRLSSN(LRLSSA),1,14),?31,"NUMBER :"
W ?43,$J(LRACNT,7)
W !,?31,"PERCENT :"
W ?43,$J($S(LRIAGT:LRACNT/LRIAGT,1:0)*100,7,1)
W !
Q
LSS ;
S LRLAB="!!,""MAJOR SECTION: "",LRMAN(LRMAA),!,""LAB SUBSECTION: "",LRLSSN(LRLSSA),!!,""CODE"",?11,""PROCEDURE"",?43,"" TOTAL"",!"
I $Y>(IOSL-7) D NPG^LRARCU Q:LREND W !,?(80-$L(LRINN)\2),LRINN,!
W @LRLAB
S (LRAST,LRCC)=0
F S LRCC=$O(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,LRCC)) Q:(LRCC="")!(LREND) D PCC
Q:LREND
S LRX=$G(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,0))
S LRAST=+$P(LRX,U)
I $Y+4>IOSL D NPG^LRARCU Q:LREND W !,?(80-$L(LRINN)\2),LRINN,!,@LRLAB
W !,?11,"SUB TOTAL",?43,$J(LRAST,7),!
Q
PCC ;
S LRX=$G(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,LRCC))
I $Y+3>IOSL D NPG^LRARCU Q:LREND W !,?(80-$L(LRINN)\2),LRINN,!,@LRLAB
S LRACNT=+$P(LRX,U)
W $P(LRX,U,2),?11,$E(LRCC,1,30),?43,$J(LRACNT,7),!
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRARCMA2 3225 printed Dec 13, 2024@02:09:07 Page 2
LRARCMA2 ;DALISC/CKA - ARCHIVED WKLD REPORT BY MAJOR SECTION; 6/1/95
+1 ;;5.2;LAB SERVICE;**59**;Aug 31, 1995
+2 ;same as LRCAPMA2 except archived wkld file
EN ;
TOP ;
+1 NEW LRCCNT,LRICNT,LROCNT,LRNCNT,LRACNT,LRCST,LRIST,LROST,LRNST,LRAST
+2 SET LRHDR="ARCHIVED WORKLOAD STATISTICS BY MAJOR SECTION"
+3 SET LRHDR2="REPORT DATE RANGE: "_LRDT1_" - "_LRDT2
+4 DO PRTINIT^LRARCU
+5 SET LRAGT=0
+6 SET LRGTREC=$GET(^TMP("LRAR-WL",$JOB,0))
+7 IF $LENGTH(LRGTREC)
Begin DoDot:1
+8 SET LRAGT=+$PIECE(LRGTREC,U)
End DoDot:1
+9 IF $EXTRACT(IOST,1,2)="C-"
WRITE @IOF
+10 if 'LRSUMM
DO DET
+11 if 'LREND
DO SUM^LRARCMA3
+12 if 'LREND
DO PRNTMAN^LRARCMR1
+13 if 'LREND
DO COMM^LRARCMR2
+14 QUIT
DET ;Detailed section
+1 FOR LRLDIV="AP","CP"
Begin DoDot:1
+2 SET LRHDR3=$SELECT(LRLDIV="AP":"ANATOMIC PATHOLOGY",1:"CLINICAL PATHOLOGY")
+3 SET LRIN=0
+4 FOR
SET LRIN=$ORDER(^TMP("LRAR-WL",$JOB,"DIV",LRLDIV,LRIN))
if ('LRIN)!(LREND)
QUIT
Begin DoDot:2
+5 SET LRINN=$SELECT($LENGTH($GET(^LAR(64.19999,LRIN,0))):$PIECE(^(0),U),1:LRIN)
+6 SET LRIAGT=0
+7 SET LRGTREC=$GET(^TMP("LRAR-WL",$JOB,"DIV",LRLDIV,LRIN,0))
+8 IF $LENGTH(LRGTREC)
Begin DoDot:3
+9 SET LRIAGT=+$PIECE(LRGTREC,U)
End DoDot:3
+10 DO PRTDET
+11 if ('LREND)&(LRIAGT)
DO INSTSUM
End DoDot:2
End DoDot:1
if LREND
QUIT
+12 QUIT
PRTDET ;Print details
+1 DO HDR^LRARCU
+2 WRITE !,?(80-$LENGTH(LRINN)\2),LRINN,!
+3 SET LRMAA=0
+4 FOR
SET LRMAA=$ORDER(^TMP("LRAR-WL",$JOB,"DIV",LRLDIV,LRIN,LRMAA))
if (LRMAA="")!($GET(LREND))
QUIT
Begin DoDot:1
+5 SET LRLSSA=""
+6 FOR
SET LRLSSA=$ORDER(^TMP("LRAR-WL",$JOB,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA))
if (LRLSSA="")!($GET(LREND))
QUIT
DO LSS
End DoDot:1
+7 if LREND
QUIT
+8 IF $Y>(IOSL-5)
DO NPG^LRARCU
if LREND
QUIT
WRITE !,?(80-$LENGTH(LRINN)\2),LRINN,!!
+9 IF 'LRIAGT
Begin DoDot:1
+10 WRITE !!!,"NO DATA FOR THIS INSTITUTION AND DATE RANGE",!
End DoDot:1
+11 IF '$TEST
Begin DoDot:1
+12 WRITE !!!,"GRAND TOTAL",?43,$JUSTIFY(LRIAGT,7)
End DoDot:1
+13 if ($EXTRACT(IOST,1,2)="C-")&('LREND)
DO PAUSE^LRARCU
WRITE @IOF
+14 QUIT
INSTSUM ;
+1 SET LRLAB="!!,?(80-7\2),""SUMMARY"",!,?(80-$L(LRINN)\2),LRINN,!!,""MAJOR SECTION"",?15,""LAB SUBSECTION"",?43,"" TOTAL"",!"
+2 DO HDR^LRARCU
WRITE @LRLAB
+3 SET LRMAA=""
+4 FOR
SET LRMAA=$ORDER(^TMP("LRAR-WL",$JOB,"DIV",LRLDIV,LRIN,LRMAA))
if (LRMAA="")!(LREND)
QUIT
Begin DoDot:1
+5 SET LRLSSA=""
+6 FOR
SET LRLSSA=$ORDER(^TMP("LRAR-WL",$JOB,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA))
if (LRLSSA="")!(LREND)
QUIT
DO PSUM
End DoDot:1
+7 IF $Y>(IOSL-4)
DO NPG^LRARCU
if LREND
QUIT
WRITE @LRLAB
+8 WRITE !!,"GRAND TOTAL",?43,$JUSTIFY(LRIAGT,7)
+9 if ($EXTRACT(IOST,1,2)="C-")&('LREND)
DO PAUSE^LRARCU
WRITE @IOF
+10 QUIT
PSUM ;
+1 if LREND
QUIT
+2 if '$DATA(^TMP("LRAR-WL",$JOB,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,0))#2
QUIT
SET LRX=^(0)
+3 IF $Y>(IOSL-3)
DO NPG^LRARCU
if LREND
QUIT
WRITE @LRLAB
+4 SET LRACNT=$PIECE(LRX,U)
+5 WRITE !,$EXTRACT(LRMAN(LRMAA),1,14),?15,$EXTRACT(LRLSSN(LRLSSA),1,14),?31,"NUMBER :"
+6 WRITE ?43,$JUSTIFY(LRACNT,7)
+7 WRITE !,?31,"PERCENT :"
+8 WRITE ?43,$JUSTIFY($SELECT(LRIAGT:LRACNT/LRIAGT,1:0)*100,7,1)
+9 WRITE !
+10 QUIT
LSS ;
+1 SET LRLAB="!!,""MAJOR SECTION: "",LRMAN(LRMAA),!,""LAB SUBSECTION: "",LRLSSN(LRLSSA),!!,""CODE"",?11,""PROCEDURE"",?43,"" TOTAL"",!"
+2 IF $Y>(IOSL-7)
DO NPG^LRARCU
if LREND
QUIT
WRITE !,?(80-$LENGTH(LRINN)\2),LRINN,!
+3 WRITE @LRLAB
+4 SET (LRAST,LRCC)=0
+5 FOR
SET LRCC=$ORDER(^TMP("LRAR-WL",$JOB,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,LRCC))
if (LRCC="")!(LREND)
QUIT
DO PCC
+6 if LREND
QUIT
+7 SET LRX=$GET(^TMP("LRAR-WL",$JOB,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,0))
+8 SET LRAST=+$PIECE(LRX,U)
+9 IF $Y+4>IOSL
DO NPG^LRARCU
if LREND
QUIT
WRITE !,?(80-$LENGTH(LRINN)\2),LRINN,!,@LRLAB
+10 WRITE !,?11,"SUB TOTAL",?43,$JUSTIFY(LRAST,7),!
+11 QUIT
PCC ;
+1 SET LRX=$GET(^TMP("LRAR-WL",$JOB,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,LRCC))
+2 IF $Y+3>IOSL
DO NPG^LRARCU
if LREND
QUIT
WRITE !,?(80-$LENGTH(LRINN)\2),LRINN,!,@LRLAB
+3 SET LRACNT=+$PIECE(LRX,U)
+4 WRITE $PIECE(LRX,U,2),?11,$EXTRACT(LRCC,1,30),?43,$JUSTIFY(LRACNT,7),!
+5 QUIT