VistA-WorldVistAEHR/r/LAB_SERVICE-LR-LS/LRRP6B1.m

94 lines
2.8 KiB
Mathematica

LRRP6B1 ;DALISC/J0 - WORKLOAD CODE SUMMARY REPORT-BUILD ;11/27/92
;;5.2;LAB SERVICE;**201**;Sep 27, 1994
EN ;
DQ ;
D INIT S:$D(ZTQUEUED) ZTREQ="@" K ZTSK
D PROCESS
D PRINT
D:$D(ZTQUEUED) WRAPUP^LRRP6
Q
INIT ;
S:$D(ZTQUEUED) ZTREQ="@" K ZTSK U IO
K ^TMP("LR",$J)
S LRDAT=$$Y2K^LRX(DT),(LRPAG,LREND)=0
S LRV657=$$WKLDNAME^LRCAPU(657)
S:'$L(LRV657) LRV657="VENIPUNCTURE -- 657"
S LRV658=$$WKLDNAME^LRCAPU(658)
S:'$L(LRV658) LRV658="VENIPUNCTURE -- 658"
Q
PROCESS ;
I $D(LRDIVSEL) D
. S LRDIV=""
. F S LRDIV=$O(LRDIVSEL(LRDIV)) Q:LRDIV="" D WKLD
I '$D(LRDIVSEL) D
. S LRDIV=0
. F S LRDIV=$O(^LRO(64.1,LRDIV)) Q:'LRDIV D WKLD
Q
WKLD ;
S LRDT=LRSDT
F S LRDT=$O(^LRO(64.1,LRDIV,1,LRDT)) Q:('LRDT)!(LRDT>LREDT) D
. S LRCPN=0
. F S LRCPN=$O(^LRO(64.1,LRDIV,1,LRDT,1,LRCPN)) Q:'LRCPN D
. . S LRCAPNAM=$E($$WKLDNAME^LRCAPU(LRCPN),1,60)
. . Q:('$L(LRCAPNAM))!('LRCAPNUM)
. . S LRCC(LRCAPNAM)=LRCAPNUM
. . D TEST
. D VENI
Q
TEST ;
S LRTST=0
F S LRTST=$O(^LRO(64.1,LRDIV,1,LRDT,1,LRCPN,1,LRTST)) Q:'LRTST D
. S LRTSTREC=$G(^LRO(64.1,LRDIV,1,LRDT,1,LRCPN,1,LRTST,0))
. Q:'$L(LRTSTREC)!($P(LRTSTREC,U,7)'=LRAA)
. S LRTN=$P(LRTSTREC,U,2)
. S LRTNAM=$P($G(^LAB(60,LRTN,0)),U) Q:'$L(LRTNAM)
. S LRTMULT=$S(+$P(LRTSTREC,U,3):+$P(LRTSTREC,U,3),1:1)
. S LRAN=$P(LRTSTREC,U,9)
. D BMPTOTS
Q
BMPTOTS ;
S:'$D(^TMP("LR",$J,"WKLD"))#2 ^("WKLD")=0
S ^("WKLD")=^TMP("LR",$J,"WKLD")+LRTMULT
S:'$D(^TMP("LR",$J,"WKLD",LRCAPNAM))#2 ^(LRCAPNAM)=0
S ^(LRCAPNAM)=^TMP("LR",$J,"WKLD",LRCAPNAM)+LRTMULT
S:'$D(^TMP("LR",$J,"TST"))#2 ^("TST")=0
S ^("TST")=^TMP("LR",$J,"TST")+LRTMULT
S:'$D(^TMP("LR",$J,"TST",LRTNAM))#2 ^(LRTNAM)=0
S ^(LRTNAM)=^TMP("LR",$J,"TST",LRTNAM)+LRTMULT
S:'$D(^TMP("LR",$J,"WKLD/TST",LRCAPNAM))#2 ^(LRCAPNAM)=0
S ^(LRCAPNAM)=^TMP("LR",$J,"WKLD/TST",LRCAPNAM)+LRTMULT
S:'$D(^TMP("LR",$J,"WKLD/TST",LRCAPNAM,LRTNAM))#2 ^(LRTNAM)=0
S ^(LRTNAM)=^TMP("LR",$J,"WKLD/TST",LRCAPNAM,LRTNAM)+LRTMULT
Q
VENI ; ** VENIPUNCTURE SUMMARY **
S LRSUM=+$P($G(^LRO(64.1,LRDIV,1,LRDT,1,657,"S")),U,4)
I LRSUM S LRCAPNAM=LRV657 D BMPVENI
S LRSUM=+$P($G(^LRO(64.1,LRDIV,1,LRDT,1,658,"S")),U,4)
I LRSUM S LRCAPNAM=LRV658 D BMPVENI
Q
BMPVENI ;
S:'$D(^TMP("LR",$J,"VENI"))#2 ^("VENI")=0
S ^("VENI")=^TMP("LR",$J,"VENI")+LRSUM
S:'$D(^TMP("LR",$J,"VENI",LRCAPNAM))#2 ^(LRCAPNAM)=0
S ^(LRCAPNAM)=^TMP("LR",$J,"VENI",LRCAPNAM)+LRSUM
Q
PRINT ;
W:$E(IOST,1,2)="C-" @IOF
S $P(LRDASH,"-",IOM)="",$P(LRSTAR,"*",IOM)=""
I '$D(^TMP("LR",$J)) D NOTHING Q
D:LRREPTYP="D" DET^LRRP6B3 Q:LREND
D COND^LRRP6B2
Q
NOTHING ;
S LRPAG=LRPAG+1
W LRDASH
W !,"Workload Code Summary for ",LRDATRNG
W ?62,LRDAT,?72,"PAGE ",$J(LRPAG,3)
W !!,LRSTAR
W !!?18,"*** NO DATA FOR REPORT OPTIONS SELECTED ***"
I $D(LRDIVSEL) D
. W !!,"DIVISIONS SELECTED",!,$E(LRDASH,1,18)
. S LRDIV=""
. F S LRDIV=$O(LRDIVSEL(LRDIV)) Q:LRDIV="" W !,LRDIVSEL(LRDIV)
Q