LRUPAD ;AVAMC/REG/WTY - LAB ACCESSION LIST BY DATE ;9/25/00
;;5.2;LAB SERVICE;**72,248**;Sep 27, 1994
;
;Reference to ^%DT supported by IA #10003
;Reference to ^DIC supported by IA #10006
;
I '$D(LRAA)!('$D(LRAA(1))) D ^LRUBYDIV G:'$D(Y) END
K C S %DT="",X="T" D ^%DT S (Q(1),Q(2),Z(4))=0 D D^LRU,EN^LRUTL S Z(1)=Y
S:'$D(LRO(68)) LRO(68)=LRAA(1) W !!?20,LRO(68)," ACCESSION LIST"
D B^LRU G:Y<0 END
S LRLDT=LRLDT+.99,X=$P(^LRO(68,LRAA,0),U,3),V(1)=$S(X="Y":$E(LRSDT,1,3)_"0000",1:LRSDT),V=$S(X="Y":$E(LRLDT,1,3)_"0000",1:LRLDT)
L W !!,"List by (A)ccession number (P)atient ",$S("CHMI"[LRSS:"(C)ollection Sample ",1:""),": " R X:DTIME G:X=""!(X[U) END I $A(X)'=65&($A(X)'=67)&($A(X)'=80) D S G L
I "AP"'[$E(X)&(X?1"C".E&("CHMI"'[LRSS)) D H G L
W:$L(X)=1 $S(X="P":"atient",X="A":"ccession number",1:"ollection Sample") G:X?1"P".E ^LRUPAD2
I X?1"C".E S DIC="62",DIC(0)="AEMOQ",DIC("A")="Select COLLECTION SAMPLE: " D ^DIC K DIC G:Y<1 END S C(1)=+Y,C=$P(Y,U,2)
S ZTRTN="QUE^LRUPAD" D BEG^LRUTL G:POP!($D(ZTSK)) END
QUE U IO S LRU(1)=+$O(^LAB(62,"B","UNKNOWN",0)) D L^LRU,S^LRU,H S LR("F")=1
S V(1)=V(1)-1
F I=V(1):0 S I=$O(^LRO(68,LRAA,1,I)) Q:'I!(I>V)!(LR("Q")) S LRSA=LRSDT-.01 F B=LRSA:0 S B=$O(^LRO(68,LRAA,1,I,1,"E",B)) Q:'B!(B>LRLDT)!(LR("Q")) I $P(B,".")=I!($E(I,6,7)="00") D O
I 'LR("Q"),LRSS="CY" D:$Y>(IOSL-8) H Q:LR("Q") W !?72,"-----",!,"Cell block (b) count: ",Q(1),?58,"Slide count:",?72,$J(Q(2),5)
W:IOST'?1"C".E&($E(IOST,1,2)'="P-"!($D(LR("FORM")))) @IOF
D END^LRUTL,END Q
O F N=0:0 S N=$O(^LRO(68,LRAA,1,I,1,"E",B,N)) Q:'N!(LR("Q")) S LRC(5)=$S($D(^LRO(68,LRAA,1,I,1,N,3)):$P(^(3),"^",6),1:"") D ^LRUPAD1
Q
H ;from LRUPAD1
I $D(LR("F")),IOST?1"C".E D M^LRU Q:LR("Q")
D F^LRU
W !,LRO(68)," (",LRSTR,"-",LRLST,")",! W:$D(C)#2 "Collection Sample: ",C,!
W "# = Not VA patient ",$S(LRSS="CY":"* = Reviewed by pathologist",1:""),?57,$S("AUSPCYEMMI"[LRSS:"% =Incomplete",1:"")
W ?60,$S("CH"[LRSS:"%=Test not verified",1:"") I LRSS="CY" W ?72,"Slide"
W !,"Acc #",?8,"Date",?14,$S(LRSS="MI":"Patient/Source",1:"Patient"),?34,"ID",?40,"Loc" W:LRSS'="AU" ?46,$S("SPCYEM"[LRSS:"Physician",1:"Spec/sample") I LRSS="CY" W ?72,"Count"
I "CHMI"[LRSS W ?62,"Test",?76,"Tech",!,LR("%") Q
W:LRSS="AU" ?46,"Date/time of Autopsy" W !,LR("%") Q
S W !!,"Enter following letter for appropriate listing:"
W !?5,"'A' for listing by accession number"
W !?5,"'P' for listing by patient"
W:"AUCYEMSP"'[LRSS !?5,"'C' for listing by collection sample"
Q
;
END D V^LRU Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRUPAD 2534 printed Dec 13, 2024@02:21:56 Page 2
LRUPAD ;AVAMC/REG/WTY - LAB ACCESSION LIST BY DATE ;9/25/00
+1 ;;5.2;LAB SERVICE;**72,248**;Sep 27, 1994
+2 ;
+3 ;Reference to ^%DT supported by IA #10003
+4 ;Reference to ^DIC supported by IA #10006
+5 ;
+6 IF '$DATA(LRAA)!('$DATA(LRAA(1)))
DO ^LRUBYDIV
if '$DATA(Y)
GOTO END
+7 KILL C
SET %DT=""
SET X="T"
DO ^%DT
SET (Q(1),Q(2),Z(4))=0
DO D^LRU
DO EN^LRUTL
SET Z(1)=Y
+8 if '$DATA(LRO(68))
SET LRO(68)=LRAA(1)
WRITE !!?20,LRO(68)," ACCESSION LIST"
+9 DO B^LRU
if Y<0
GOTO END
+10 SET LRLDT=LRLDT+.99
SET X=$PIECE(^LRO(68,LRAA,0),U,3)
SET V(1)=$SELECT(X="Y":$EXTRACT(LRSDT,1,3)_"0000",1:LRSDT)
SET V=$SELECT(X="Y":$EXTRACT(LRLDT,1,3)_"0000",1:LRLDT)
L WRITE !!,"List by (A)ccession number (P)atient ",$SELECT("CHMI"[LRSS:"(C)ollection Sample ",1:""),": "
READ X:DTIME
if X=""!(X[U)
GOTO END
IF $ASCII(X)'=65&($ASCII(X)'=67)&($ASCII(X)'=80)
DO S
GOTO L
+1 IF "AP"'[$EXTRACT(X)&(X?1"C".E&("CHMI"'[LRSS))
DO H
GOTO L
+2 if $LENGTH(X)=1
WRITE $SELECT(X="P":"atient",X="A":"ccession number",1:"ollection Sample")
if X?1"P".E
GOTO ^LRUPAD2
+3 IF X?1"C".E
SET DIC="62"
SET DIC(0)="AEMOQ"
SET DIC("A")="Select COLLECTION SAMPLE: "
DO ^DIC
KILL DIC
if Y<1
GOTO END
SET C(1)=+Y
SET C=$PIECE(Y,U,2)
+4 SET ZTRTN="QUE^LRUPAD"
DO BEG^LRUTL
if POP!($DATA(ZTSK))
GOTO END
QUE USE IO
SET LRU(1)=+$ORDER(^LAB(62,"B","UNKNOWN",0))
DO L^LRU
DO S^LRU
DO H
SET LR("F")=1
+1 SET V(1)=V(1)-1
+2 FOR I=V(1):0
SET I=$ORDER(^LRO(68,LRAA,1,I))
if 'I!(I>V)!(LR("Q"))
QUIT
SET LRSA=LRSDT-.01
FOR B=LRSA:0
SET B=$ORDER(^LRO(68,LRAA,1,I,1,"E",B))
if 'B!(B>LRLDT)!(LR("Q"))
QUIT
IF $PIECE(B,".")=I!($EXTRACT(I,6,7)="00")
DO O
+3 IF 'LR("Q")
IF LRSS="CY"
if $Y>(IOSL-8)
DO H
if LR("Q")
QUIT
WRITE !?72,"-----",!,"Cell block (b) count: ",Q(1),?58,"Slide count:",?72,$JUSTIFY(Q(2),5)
+4 if IOST'?1"C".E&($EXTRACT(IOST,1,2)'="P-"!($DATA(LR("FORM"))))
WRITE @IOF
+5 DO END^LRUTL
DO END
QUIT
O FOR N=0:0
SET N=$ORDER(^LRO(68,LRAA,1,I,1,"E",B,N))
if 'N!(LR("Q"))
QUIT
SET LRC(5)=$SELECT($DATA(^LRO(68,LRAA,1,I,1,N,3)):$PIECE(^(3),"^",6),1:"")
DO ^LRUPAD1
+1 QUIT
H ;from LRUPAD1
+1 IF $DATA(LR("F"))
IF IOST?1"C".E
DO M^LRU
if LR("Q")
QUIT
+2 DO F^LRU
+3 WRITE !,LRO(68)," (",LRSTR,"-",LRLST,")",!
if $DATA(C)#2
WRITE "Collection Sample: ",C,!
+4 WRITE "# = Not VA patient ",$SELECT(LRSS="CY":"* = Reviewed by pathologist",1:""),?57,$SELECT("AUSPCYEMMI"[LRSS:"% =Incomplete",1:"")
+5 WRITE ?60,$SELECT("CH"[LRSS:"%=Test not verified",1:"")
IF LRSS="CY"
WRITE ?72,"Slide"
+6 WRITE !,"Acc #",?8,"Date",?14,$SELECT(LRSS="MI":"Patient/Source",1:"Patient"),?34,"ID",?40,"Loc"
if LRSS'="AU"
WRITE ?46,$SELECT("SPCYEM"[LRSS:"Physician",1:"Spec/sample")
IF LRSS="CY"
WRITE ?72,"Count"
+7 IF "CHMI"[LRSS
WRITE ?62,"Test",?76,"Tech",!,LR("%")
QUIT
+8 if LRSS="AU"
WRITE ?46,"Date/time of Autopsy"
WRITE !,LR("%")
QUIT
S WRITE !!,"Enter following letter for appropriate listing:"
+1 WRITE !?5,"'A' for listing by accession number"
+2 WRITE !?5,"'P' for listing by patient"
+3 if "AUCYEMSP"'[LRSS
WRITE !?5,"'C' for listing by collection sample"
+4 QUIT
+5 ;
END DO V^LRU
QUIT