LRULEN ; IHS/DIR/FJE - BYTE COUNT FOR ACCESSIONS 5/9/91 18:19 ;
;;5.2;LR;**1013**;JUL 15, 2002
;
;;5.2;LAB SERVICE;;Sep 27, 1994
W !!?20,"Byte count for accessions"
S DIC=68,DIC(0)="AEMOQZ",DIC("S")="I ""SPCYEM""[$P(^(0),U,2)&($P(^(0),U,2)]"""")" D ^DIC K DIC G:Y<1 END S LRAA(1)=$P(Y,U,2),LRAA=+Y,LRSS=$P(Y(0),U,2) D XR^LRU
D B^LRU G:Y<0 END
S ZTRTN="QUE^LRULEN" D BEG^LRUTL G:POP!($D(ZTSK)) END
QUE U IO S (C,S)=0,LRSDT=LRSDT-.0001,LRLDT=LRLDT+.9
F LRSDT=LRSDT:0 S LRSDT=$O(^LR(LRXR,LRSDT)) Q:'LRSDT!(LRSDT>LRLDT) F LRDFN=0:0 S LRDFN=$O(^LR(LRXR,LRSDT,LRDFN)) Q:'LRDFN F A=0:0 S A=$O(^LR(LRXR,LRSDT,LRDFN,A)) Q:'A D A
W !!,"ACCESSIONS: ",S," BYTES: ",C," AVERAGE BYTES/ACCESSION: ",$S(C:C\S,1:0),!,"From ",LRSTR," to ",LRLST
D END^LRUTL,END Q
A S S=S+1,C=C+$L(^LR(LRDFN,LRSS,A,0))
I $D(^LR(LRDFN,LRSS,A,2,0)) S C=C+$L(^(0)) F T=0:0 S T=$O(^LR(LRDFN,LRSS,A,2,T)) Q:'T S C=C+$L(^(T,0)) D M
Q
M I $D(^LR(LRDFN,LRSS,A,2,T,2,0)) S C=C+$L(^(0)) F M=0:0 S M=$O(^LR(LRDFN,LRSS,A,2,T,2,M)) Q:'M S C=C+$L(^(M,0)) D E
F B=1,3,4 I $D(^LR(LRDFN,LRSS,A,2,T,B,0)) S C=C+$L(^(0)) F M=0:0 S M=$O(^LR(LRDFN,LRSS,A,2,T,B,M)) Q:'M S C=C+$L(^(M,0))
I $D(^LR(LRDFN,LRSS,A,2,T,5,0)) S C=C+$L(^(0)) F M=0:0 S M=$O(^LR(LRDFN,LRSS,A,2,T,5,M)) Q:'M S C=C+$L(^(M,0)) I $D(^LR(LRDFN,LRSS,A,2,T,5,M,1,0)) S C=C+$L(^(0)) D N
Q
E I $D(^LR(LRDFN,LRSS,A,2,T,2,M,1,0)) S C=C+$L(^(0)) F E=0:0 S E=$O(^LR(LRDFN,LRSS,A,2,T,2,M,1,E)) Q:'E S C=C+$L(^(E,0))
Q
N F N=0:0 S N=$O(^LR(LRDFN,LRSS,A,2,T,5,M,1,N)) Q:'N S C=C+$L(^(0))
Q
;
END D V^LRU Q
LRULEN ; IHS/DIR/FJE - BYTE COUNT FOR ACCESSIONS 5/9/91 18:19 ;
+1 ;;5.2;LR;**1013**;JUL 15, 2002
+2 ;
+3 ;;5.2;LAB SERVICE;;Sep 27, 1994
+4 WRITE !!?20,"Byte count for accessions"
+5 SET DIC=68
SET DIC(0)="AEMOQZ"
SET DIC("S")="I ""SPCYEM""[$P(^(0),U,2)&($P(^(0),U,2)]"""")"
DO ^DIC
KILL DIC
IF Y<1
GOTO END
SET LRAA(1)=$PIECE(Y,U,2)
SET LRAA=+Y
SET LRSS=$PIECE(Y(0),U,2)
DO XR^LRU
+6 DO B^LRU
IF Y<0
GOTO END
+7 SET ZTRTN="QUE^LRULEN"
DO BEG^LRUTL
IF POP!($DATA(ZTSK))
GOTO END
QUE USE IO
SET (C,S)=0
SET LRSDT=LRSDT-.0001
SET LRLDT=LRLDT+.9
+1 FOR LRSDT=LRSDT:0
SET LRSDT=$ORDER(^LR(LRXR,LRSDT))
IF 'LRSDT!(LRSDT>LRLDT)
QUIT
FOR LRDFN=0:0
SET LRDFN=$ORDER(^LR(LRXR,LRSDT,LRDFN))
IF 'LRDFN
QUIT
FOR A=0:0
SET A=$ORDER(^LR(LRXR,LRSDT,LRDFN,A))
IF 'A
QUIT
DO A
+2 WRITE !!,"ACCESSIONS: ",S," BYTES: ",C," AVERAGE BYTES/ACCESSION: ",$SELECT(C:C\S,1:0),!,"From ",LRSTR," to ",LRLST
+3 DO END^LRUTL
DO END
QUIT
A SET S=S+1
SET C=C+$LENGTH(^LR(LRDFN,LRSS,A,0))
+1 IF $DATA(^LR(LRDFN,LRSS,A,2,0))
SET C=C+$LENGTH(^(0))
FOR T=0:0
SET T=$ORDER(^LR(LRDFN,LRSS,A,2,T))
IF 'T
QUIT
SET C=C+$LENGTH(^(T,0))
DO M
+2 QUIT
M IF $DATA(^LR(LRDFN,LRSS,A,2,T,2,0))
SET C=C+$LENGTH(^(0))
FOR M=0:0
SET M=$ORDER(^LR(LRDFN,LRSS,A,2,T,2,M))
IF 'M
QUIT
SET C=C+$LENGTH(^(M,0))
DO E
+1 FOR B=1,3,4
IF $DATA(^LR(LRDFN,LRSS,A,2,T,B,0))
SET C=C+$LENGTH(^(0))
FOR M=0:0
SET M=$ORDER(^LR(LRDFN,LRSS,A,2,T,B,M))
IF 'M
QUIT
SET C=C+$LENGTH(^(M,0))
+2 IF $DATA(^LR(LRDFN,LRSS,A,2,T,5,0))
SET C=C+$LENGTH(^(0))
FOR M=0:0
SET M=$ORDER(^LR(LRDFN,LRSS,A,2,T,5,M))
IF 'M
QUIT
SET C=C+$LENGTH(^(M,0))
IF $DATA(^LR(LRDFN,LRSS,A,2,T,5,M,1,0))
SET C=C+$LENGTH(^(0))
DO N
+3 QUIT
E IF $DATA(^LR(LRDFN,LRSS,A,2,T,2,M,1,0))
SET C=C+$LENGTH(^(0))
FOR E=0:0
SET E=$ORDER(^LR(LRDFN,LRSS,A,2,T,2,M,1,E))
IF 'E
QUIT
SET C=C+$LENGTH(^(E,0))
+1 QUIT
N FOR N=0:0
SET N=$ORDER(^LR(LRDFN,LRSS,A,2,T,5,M,1,N))
IF 'N
QUIT
SET C=C+$LENGTH(^(0))
+1 QUIT
+2 ;
END DO V^LRU
QUIT