[613] | 1 | LRRP6 ;DALISC/J0 - LAB TEST/WORKLOAD CODE REPORTS ;12/07/92
|
---|
| 2 | ;;5.2;LAB SERVICE;**201**;Sep 27, 1994
|
---|
| 3 | EN ;
|
---|
| 4 | S LREND=0
|
---|
| 5 | D SELECT
|
---|
| 6 | D:'LREND DEVICE
|
---|
| 7 | D:'LREND @ZTRTN
|
---|
| 8 | D WRAPUP
|
---|
| 9 | Q
|
---|
| 10 | SELECT ;
|
---|
| 11 | D SITE Q:LREND
|
---|
| 12 | D DIV Q:LREND
|
---|
| 13 | D DATES Q:LREND
|
---|
| 14 | D METHOD Q:LREND
|
---|
| 15 | D ACCAREA Q:LREND
|
---|
| 16 | I ZTRTN="DQ^LRRP6A1" D SETACCN Q:LREND
|
---|
| 17 | D REPTYP Q:LREND
|
---|
| 18 | Q
|
---|
| 19 | SITE ;
|
---|
| 20 | S LRSITNUM=+$P($G(^XMB(1,1,"XUS")),U,17)
|
---|
| 21 | I 'LRSITNUM W !!,"NO SITE DEFINED -- CAN'T REPORT" S LREND=1 Q
|
---|
| 22 | S LRSITE=$P($G(^DIC(4,LRSITNUM,0)),U) S:LRSITE="" LRSITE="UNKNOWN"
|
---|
| 23 | Q
|
---|
| 24 | DIV ;
|
---|
| 25 | S %=2 W !,"Do you want to print a specific DIVISION (YES or NO)"
|
---|
| 26 | D YN^DICN
|
---|
| 27 | I %=-1 S LREND=1 Q
|
---|
| 28 | I %=1 D
|
---|
| 29 | . S DIC("A")="Select a Division:",DIC=4,DIC(0)="AEMQ"
|
---|
| 30 | . F D ^DIC Q:Y=-1 D
|
---|
| 31 | . . S LRDIVSEL=+Y
|
---|
| 32 | . . S LRDIVSEL(+Y)=$S($L($P($G(^DIC(4,+Y,0)),U)):$P(^(0),U),1:"ERROR"_Y)
|
---|
| 33 | I ($D(DTOUT)#2)!(($D(DUOUT)#2)&('$D(LRDIVSEL))) S LREND=1 Q
|
---|
| 34 | Q
|
---|
| 35 | DATES ;
|
---|
| 36 | S %DT="AEX",%DT("A")="BEGIN DATE : "
|
---|
| 37 | D ^%DT I (X=U)!(X="") S LREND=1 Q
|
---|
| 38 | S LRSDT=Y
|
---|
| 39 | S LRSDAT=$$Y2K^LRX(Y)
|
---|
| 40 | S %DT="AEX",%DT("A")="END DATE : "
|
---|
| 41 | D ^%DT I (X=U)!(X="") S LREND=1 Q
|
---|
| 42 | S LREDT=Y
|
---|
| 43 | S LREDAT=$$Y2K^LRX(Y)
|
---|
| 44 | I LREDT<LRSDT S X=LREDT,LREDT=LRSDT,LRSDT=X
|
---|
| 45 | S LRSDT=LRSDT-.000001
|
---|
| 46 | S LRDATRNG=LRSDAT_" to "_LREDAT
|
---|
| 47 | Q
|
---|
| 48 | METHOD ;
|
---|
| 49 | K DIR S DIR("A",1)="TEST AUDIT should not be used for workload reporting."
|
---|
| 50 | S DIR("A",2)="It should ONLY be used for trouble Shooting.",DIR("A",3)=" "
|
---|
| 51 | S DIR(0)="SM^T:TEST AUDIT (File 68);W:WORKLOAD CODE (File 64.1)",DIR("A")="REPORT BY"
|
---|
| 52 | D ^DIR I ($D(DUOUT))!($D(DTOUT)) S LREND=1 Q
|
---|
| 53 | S ZTRTN=$S(Y="T":"DQ^LRRP6A1",Y="W":"DQ^LRRP6B1")
|
---|
| 54 | K DIR
|
---|
| 55 | Q
|
---|
| 56 | ACCAREA ;
|
---|
| 57 | K DIC S DIC=68,DIC(0)="AEMQZ"
|
---|
| 58 | S DIC("A")="Select ACCESSION AREA (required - 1 only): "
|
---|
| 59 | D ^DIC
|
---|
| 60 | I Y=-1 S LREND=1 Q
|
---|
| 61 | S LRX=$P(Y,U,2),LRAA=+Y
|
---|
| 62 | S ACCTRNS=$P(^LRO(68,LRAA,0),U,3)
|
---|
| 63 | Q
|
---|
| 64 | SETACCN ;
|
---|
| 65 | ;S LRANL=+$P(^LRO(68,LRAA,1,LRDT,1,0),U,4)
|
---|
| 66 | K DIR
|
---|
| 67 | S DIR(0)="NO^1:999999"
|
---|
| 68 | S DIR("A")="Start with accession #",DIR("B")=1
|
---|
| 69 | D ^DIR I $D(DUOUT)!($D(DTOUT)) S LREND=1 Q
|
---|
| 70 | S:X>0 LRANF=X-1
|
---|
| 71 | S:ACCTRNS="Y" LRDT=$E(LRSDT,1,3)_"0000"
|
---|
| 72 | S:ACCTRNS'="Y" LRDT=$E(LRSDT,1,3)_"00"
|
---|
| 73 | ;S LAST=$P(^LRO(68,LRAA,1,LRDT,1,0),U,4)
|
---|
| 74 | K DIR
|
---|
| 75 | S DIR(0)="NO^1:999999"
|
---|
| 76 | S DIR("A")="End with accession #",DIR("B")=999999
|
---|
| 77 | D ^DIR I $D(DUOUT)!($D(DTOUT)) S LREND=1 Q
|
---|
| 78 | S LRANL=+X
|
---|
| 79 | Q
|
---|
| 80 | REPTYP ;
|
---|
| 81 | K DIR S DIR(0)="SM^D:DETAILED;C:CONDENSED",DIR("A")="REPORT TYPE"
|
---|
| 82 | D ^DIR I $D(DUOUT)!($D(DTOUT)) S LREND=1 Q
|
---|
| 83 | S LRREPTYP=Y
|
---|
| 84 | K DIR
|
---|
| 85 | Q
|
---|
| 86 | DEVICE ;
|
---|
| 87 | K IOP,IO("Q") S POP=0,%ZIS="QP" D ^%ZIS
|
---|
| 88 | I POP S LREND=1 Q
|
---|
| 89 | I $D(IO("Q")) D QUE S LREND=1 Q
|
---|
| 90 | Q
|
---|
| 91 | WRAPUP ;
|
---|
| 92 | W:'LREND !!,?23,"*** END OF REPORT ***"
|
---|
| 93 | D:($E(IOST,1,2)="C-")&('LREND) PAUSE
|
---|
| 94 | W !! W:$E(IOST,1,2)="P-" @IOF D:'$D(ZTQUEUED) ^%ZISC
|
---|
| 95 | S:$D(ZTQUEUED) ZTREQ="@"
|
---|
| 96 | K ^TMP("LR",$J)
|
---|
| 97 | K DTOUT,DUOUT,DIRUT,DIROUT,X,Y,%,%ZIS,DIC,%Y,%DT,I,POP,DIR
|
---|
| 98 | K ZTIO,ZTRTN,ZTSAVE,ZTDESC,ZTSK,LRAA,LRANN,LRSUM,LRTMULT
|
---|
| 99 | K LREND,LRPAG,LRDT,LRDAT,LRSDT,LREDT,LRSDAT,LREDAT,LRDATRNG,LRX,LRNODE
|
---|
| 100 | K LRTIC,LRANF,LRANL
|
---|
| 101 | K LRDIV,LRDIVNAM,LRDIVSEL,LRFIRST,LRREPTYP,LRTN,LRTST,LRTSTREC,LRTNAM
|
---|
| 102 | K LRSITNUM,LRSITE,LRCC,LRAN,LRCPN,LRDASH,LRSTAR,LRSUBH,LRV657,LRV658
|
---|
| 103 | D WKLDCLN^LRCAPU
|
---|
| 104 | Q
|
---|
| 105 | QUE ;
|
---|
| 106 | K IO("Q") I '$D(ZTIO),$D(ION),ION="" S ZTIO=""
|
---|
| 107 | S ZTDESC="LRRP6_ - TEST/WKLD/VENIPUNCTURE REP"
|
---|
| 108 | S ZTSAVE("LR*")="" D ^%ZTLOAD
|
---|
| 109 | Q
|
---|
| 110 | PAUSE ;
|
---|
| 111 | K DIR S DIR(0)="E" D ^DIR
|
---|
| 112 | S:($D(DTOUT))!($D(DUOUT)) LREND=1
|
---|
| 113 | Q
|
---|