LRBLDEX2 ; IHS/DIR/AAB - EX-BLOOD DONORS 7/3/96 11:30 ;
;;5.2;LR;**1002**;JUN 01, 1998
;;5.2;LAB SERVICE;**1,72**;Sep 27, 1994
T Q:'Y S Y=Y_"0000",Y=$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_$E(Y,2,3)_$S(Y'[".":"",1:"@"_$E(Y,9,10)_":"_$E(Y,11,12)) Q
;
EN ;from LRBLDEX1
S W=0 F B=0:1 S W=$O(^LRE(LRI,5,W)) Q:'W!(LR("Q")) D:$Y>(IOSL-6) EN^LRBLDEX1 Q:LR("Q") S M=^LRE(LRI,5,W,0),Y=+M D T,R
Q:LR("Q") D:$D(^LRE(LRI,99)) W Q:LR("Q") W ! Q
;
R W !,"Donation **",Y,"**" S X=$P(M,"^",6) S:X X=$S($D(^LAB(65.4,X,0)):$P(^(0),"^"),1:"") W:X]"" " Site:",X S X=$P(M,"^",7)
S:X X=$S($D(^LAB(65.4,X,0)):$P(^(0),"^"),1:"") W:X]"" " Group:",X S Y=$P(M,"^",8) W:IOM<($X+9) ! I Y]"" D:Y EN1^LRBLDEX1 Q:LR("Q") W " Edit:",Y
D:$Y>(IOSL-6) EN^LRBLDEX1 Q:LR("Q") S X=$P(M,"^",11) W !,"Donation type:",$$EXTERNAL^DILFD(65.54,1.1,"",X) S X=$P(M,"^",2) W " ",$$EXTERNAL^DILFD(65.54,1,"",X) G:X="N:" O
S X=$P(M,"^",3) I X W:IOM<($X+39) ! W " Reaction:",$E($P(^LAB(65.4,X,0),"^",3),1,30)
I $P(M,"^",9)]"" W:IOM<($X+40) ! W " Taken by:",$P(M,"^",9)
I $P(M,"^",5)]"" W:IOM<($X+43) ! W " Credit for:",$P(M,"^",5)
S X=$P(M,"^",4) Q:X="" D:$Y>(IOSL-6) EN^LRBLDEX1 Q:LR("Q") S ^TMP("LRBL",$J,X)=LRP W !,"UNIT ID: ",X S X=$P(M,"^",10)
I X]"" W " Disposition: ",$$EXTERNAL^DILFD(65.54,6.1,"",X) F B=0:0 S B=$O(^LRE(LRI,5,W,3,B)) Q:'B!(LR("Q")) D:$Y>(IOSL-6) EN^LRBLDEX1 Q:LR("Q") W !,^LRE(LRI,5,W,3,B,0)
Q:LR("Q") K M I $D(^LRE(LRI,5,W,2)) S M=^(2),X=$P(M,U) W:X]"" !,"Primary bag: ",$$EXTERNAL^DILFD(65.54,4.1,"",X) S X=$P(M,U,9) W:X]"" " ",$$EXTERNAL^DILFD(65.54,4.11,"",X)
I $D(M) S X=$P(M,"^",10) W:X]"" " (lot#",X,")" S X=$P(M,"^",5) W:X " tot gm:",X S X=$P(M,"^",6) W:X " empty wt:",X S X=$P(M,"^",7) W:X " ml:",X S Y=$P(M,"^",8) I Y]"" W:IOM<($X+10) ! D:Y EN1^LRBLDEX1 W " tech: ",Y
I $D(M) S Y=$P(M,"^",2) D T W !,"Collection start:",Y S Y=$P(M,"^",3) D T W " stop:",Y S Y=$P(M,"^",4) D T W " process:",Y
I $D(^LRE(LRI,5,W,10))!($D(^(11)))!($D(^(12)))!($D(^(13)))!($D(^(14)))!($D(^(15)))!($D(^(16)))!($D(^(17)))!($D(^(18)))!($D(^(19)))!($D(^(20))) D:$Y>55 EN^LRBLDEX1 W !,"Test",?31,"Tech"
F M=10:1:20 I $D(^LRE(LRI,5,W,M)) S Z=^(M),Z(1)=$P(Z,"^") W !,$E(LR(M),1,15),?16,$$EXTERNAL^DILFD(65.54,M,"",Z(1)),?31 S Y=$P(Z,"^",2) D:Y EN1^LRBLDEX1 W Y,?35,$P(Z,"^",3)
S M(1)=0 D:$Y>(IOSL-6) EN^LRBLDEX1 Q:LR("Q")
F Z=0:1 S M(1)=$O(^LRE(LRI,5,W,66,M(1))) Q:'M(1)!(LR("Q")) D:$Y>(IOSL-6) EN^LRBLDEX1 Q:LR("Q") S M=^(M(1),0) W:'Z !,"Component",?41,"Grams",?47,"Date stored",?62,"Expiration date" W !,$P(^LAB(66,M(1),0),"^"),?41,$P(M,"^",5) D D
Q
D S Y=$P(M,"^",3) D T W ?47,Y S Y=$P(M,"^",4) D T W ?62,Y
S Y=$P(M,U,6) D:Y EN1^LRBLDEX1 W !,"Label tech:",Y
S X=$P(M,U,8) W " Disposition:",$$EXTERNAL^DILFD(65.66,.08,"",X)," date:" S Y=$P(M,"^",2) D T W Y," tech:" S Y=$P(M,"^",7) D:Y EN1^LRBLDEX1 W Y
F E=0:0 S E=$O(^LRE(LRI,5,W,66,M(1),1,E)) Q:'E!(LR("Q")) D:$Y>(IOSL-6) EN^LRBLDEX1 Q:LR("Q") W !,^LRE(LRI,5,W,66,M(1),1,E,0)
Q
;
O S N=0 F C=0:1 S N=$O(^LRE(LRI,5,W,1,N)) Q:'N!(LR("Q")) S M=^(N,0) W:'C !,"Deferral reason:" D:$Y>(IOSL-6) EN^LRBLDEX1 Q:LR("Q") W !,$P(^LAB(65.4,M,0),"^",3)
Q
W W !,"Permanent deferral reason:" K ^UTILITY($J) S DIWR=IOM-5,DIWL=5,DIWF="W" S LRX=0 F LRR=0:1 S LRX=$O(^LRE(LRI,99,LRX)) Q:'LRX!(LR("Q")) D:$Y>(IOSL-6) EN^LRBLDEX1 Q:LR("Q") S X=^LRE(LRI,99,LRX,0) D ^DIWP
Q:LR("Q") D:LRR ^DIWW Q
LRBLDEX2 ; IHS/DIR/AAB - EX-BLOOD DONORS 7/3/96 11:30 ;
+1 ;;5.2;LR;**1002**;JUN 01, 1998
+2 ;;5.2;LAB SERVICE;**1,72**;Sep 27, 1994
T IF 'Y
QUIT
SET Y=Y_"0000"
SET Y=$EXTRACT(Y,4,5)_"/"_$EXTRACT(Y,6,7)_"/"_$EXTRACT(Y,2,3)_$SELECT(Y'[".":"",1:"@"_$EXTRACT(Y,9,10)_":"_$EXTRACT(Y,11,12))
QUIT
+1 ;
EN ;from LRBLDEX1
+1 SET W=0
FOR B=0:1
SET W=$ORDER(^LRE(LRI,5,W))
IF 'W!(LR("Q"))
QUIT
IF $Y>(IOSL-6)
DO EN^LRBLDEX1
IF LR("Q")
QUIT
SET M=^LRE(LRI,5,W,0)
SET Y=+M
DO T
DO R
+2 IF LR("Q")
QUIT
IF $DATA(^LRE(LRI,99))
DO W
IF LR("Q")
QUIT
WRITE !
QUIT
+3 ;
R WRITE !,"Donation **",Y,"**"
SET X=$PIECE(M,"^",6)
IF X
SET X=$SELECT($DATA(^LAB(65.4,X,0)):$PIECE(^(0),"^"),1:"")
IF X]""
WRITE " Site:",X
SET X=$PIECE(M,"^",7)
+1 IF X
SET X=$SELECT($DATA(^LAB(65.4,X,0)):$PIECE(^(0),"^"),1:"")
IF X]""
WRITE " Group:",X
SET Y=$PIECE(M,"^",8)
IF IOM<($X+9)
WRITE !
IF Y]""
IF Y
DO EN1^LRBLDEX1
IF LR("Q")
QUIT
WRITE " Edit:",Y
+2 IF $Y>(IOSL-6)
DO EN^LRBLDEX1
IF LR("Q")
QUIT
SET X=$PIECE(M,"^",11)
WRITE !,"Donation type:",$$EXTERNAL^DILFD(65.54,1.1,"",X)
SET X=$PIECE(M,"^",2)
WRITE " ",$$EXTERNAL^DILFD(65.54,1,"",X)
IF X="N
GOTO O
+3 SET X=$PIECE(M,"^",3)
IF X
IF IOM<($X+39)
WRITE !
WRITE " Reaction:",$EXTRACT($PIECE(^LAB(65.4,X,0),"^",3),1,30)
+4 IF $PIECE(M,"^",9)]""
IF IOM<($X+40)
WRITE !
WRITE " Taken by:",$PIECE(M,"^",9)
+5 IF $PIECE(M,"^",5)]""
IF IOM<($X+43)
WRITE !
WRITE " Credit for:",$PIECE(M,"^",5)
+6 SET X=$PIECE(M,"^",4)
IF X=""
QUIT
IF $Y>(IOSL-6)
DO EN^LRBLDEX1
IF LR("Q")
QUIT
SET ^TMP("LRBL",$JOB,X)=LRP
WRITE !,"UNIT ID: ",X
SET X=$PIECE(M,"^",10)
+7 IF X]""
WRITE " Disposition: ",$$EXTERNAL^DILFD(65.54,6.1,"",X)
FOR B=0:0
SET B=$ORDER(^LRE(LRI,5,W,3,B))
IF 'B!(LR("Q"))
QUIT
IF $Y>(IOSL-6)
DO EN^LRBLDEX1
IF LR("Q")
QUIT
WRITE !,^LRE(LRI,5,W,3,B,0)
+8 IF LR("Q")
QUIT
KILL M
IF $DATA(^LRE(LRI,5,W,2))
SET M=^(2)
SET X=$PIECE(M,U)
IF X]""
WRITE !,"Primary bag: ",$$EXTERNAL^DILFD(65.54,4.1,"",X)
SET X=$PIECE(M,U,9)
IF X]""
WRITE " ",$$EXTERNAL^DILFD(65.54,4.11,"",X)
+9 IF $DATA(M)
SET X=$PIECE(M,"^",10)
IF X]""
WRITE " (lot#",X,")"
SET X=$PIECE(M,"^",5)
IF X
WRITE " tot gm:",X
SET X=$PIECE(M,"^",6)
IF X
WRITE " empty wt:",X
SET X=$PIECE(M,"^",7)
IF X
WRITE " ml:",X
SET Y=$PIECE(M,"^",8)
IF Y]""
IF IOM<($X+10)
WRITE !
IF Y
DO EN1^LRBLDEX1
WRITE " tech: ",Y
+10 IF $DATA(M)
SET Y=$PIECE(M,"^",2)
DO T
WRITE !,"Collection start:",Y
SET Y=$PIECE(M,"^",3)
DO T
WRITE " stop:",Y
SET Y=$PIECE(M,"^",4)
DO T
WRITE " process:",Y
+11 IF $DATA(^LRE(LRI,5,W,10))!($DATA(^(11)))!($DATA(^(12)))!($DATA(^(13)))!($DATA(^(14)))!($DATA(^(15)))!($DATA(^(16)))!($DATA(^(17)))!($DATA(^(18)))!($DATA(^(19)))!($DATA(^(20)))
IF $Y>55
DO EN^LRBLDEX1
WRITE !,"Test",?31,"Tech"
+12 FOR M=10:1:20
IF $DATA(^LRE(LRI,5,W,M))
SET Z=^(M)
SET Z(1)=$PIECE(Z,"^")
WRITE !,$EXTRACT(LR(M),1,15),?16,$$EXTERNAL^DILFD(65.54,M,"",Z(1)),?31
SET Y=$PIECE(Z,"^",2)
IF Y
DO EN1^LRBLDEX1
WRITE Y,?35,$PIECE(Z,"^",3)
+13 SET M(1)=0
IF $Y>(IOSL-6)
DO EN^LRBLDEX1
IF LR("Q")
QUIT
+14 FOR Z=0:1
SET M(1)=$ORDER(^LRE(LRI,5,W,66,M(1)))
IF 'M(1)!(LR("Q"))
QUIT
IF $Y>(IOSL-6)
DO EN^LRBLDEX1
IF LR("Q")
QUIT
SET M=^(M(1),0)
IF 'Z
WRITE !,"Component",?41,"Grams",?47,"Date stored",?62,"Expiration date"
WRITE !,$PIECE(^LAB(66,M(1),0),"^"),?41,$PIECE(M,"^",5)
DO D
+15 QUIT
D SET Y=$PIECE(M,"^",3)
DO T
WRITE ?47,Y
SET Y=$PIECE(M,"^",4)
DO T
WRITE ?62,Y
+1 SET Y=$PIECE(M,U,6)
IF Y
DO EN1^LRBLDEX1
WRITE !,"Label tech:",Y
+2 SET X=$PIECE(M,U,8)
WRITE " Disposition:",$$EXTERNAL^DILFD(65.66,.08,"",X)," date:"
SET Y=$PIECE(M,"^",2)
DO T
WRITE Y," tech:"
SET Y=$PIECE(M,"^",7)
IF Y
DO EN1^LRBLDEX1
WRITE Y
+3 FOR E=0:0
SET E=$ORDER(^LRE(LRI,5,W,66,M(1),1,E))
IF 'E!(LR("Q"))
QUIT
IF $Y>(IOSL-6)
DO EN^LRBLDEX1
IF LR("Q")
QUIT
WRITE !,^LRE(LRI,5,W,66,M(1),1,E,0)
+4 QUIT
+5 ;
O SET N=0
FOR C=0:1
SET N=$ORDER(^LRE(LRI,5,W,1,N))
IF 'N!(LR("Q"))
QUIT
SET M=^(N,0)
IF 'C
WRITE !,"Deferral reason:"
IF $Y>(IOSL-6)
DO EN^LRBLDEX1
IF LR("Q")
QUIT
WRITE !,$PIECE(^LAB(65.4,M,0),"^",3)
+1 QUIT
W WRITE !,"Permanent deferral reason:"
KILL ^UTILITY($JOB)
SET DIWR=IOM-5
SET DIWL=5
SET DIWF="W"
SET LRX=0
FOR LRR=0:1
SET LRX=$ORDER(^LRE(LRI,99,LRX))
IF 'LRX!(LR("Q"))
QUIT
IF $Y>(IOSL-6)
DO EN^LRBLDEX1
IF LR("Q")
QUIT
SET X=^LRE(LRI,99,LRX,0)
DO ^DIWP
+1 IF LR("Q")
QUIT
IF LRR
DO ^DIWW
QUIT