LRBLPAB ; IHS/DIR/FJE - ANTIBODIES IDENTIFIED 2/18/93 09:37 ;
;;5.2;LR;;NOV 01, 1997
;
;;5.2;LAB SERVICE;;Sep 27, 1994
W !!?20,"PATIENT ANTIBODIES IDENTIFIED"
I DUZ(0)'["@"&(DUZ(0)'["l") W $C(7),!,"You do not have the proper access to proceed." G END
S ZTRTN="QUE^LRBLPAB" D BEG^LRUTL G:POP!($D(ZTSK)) END
QUE U IO K ^TMP($J) D L^LRU,S^LRU S (LRW,LRC)=0 D H
S LRX=0 F LRD=0:0 S LRX=$O(^DPT("B",LRX)) Q:LRX="" F LRY=0:0 S LRY=$O(^DPT("B",LRX,LRY)) Q:'LRY I $D(^DPT(LRY,"LR")) S LRDFN=^("LR"),LRC=LRC+1 I $O(^LR(LRDFN,1.7,0)) D W
D:$Y>(IOSL-6) H W !,"Patients in lab data file: ",$J(LRC,6),!,"Patients with antibodies: ",$J(LRW,6)
F LRA=0:0 S LRA=$O(^TMP($J,LRA)) Q:'LRA S LRA(1)=^(LRA) D:$Y>(IOSL-6) H W !,$P(^LAB(61.3,LRA,0),"^")," = ",LRA(1)
D END^LRUTL,END Q
W ;S LRW=LRW+1,X=^LR(LRDFN,0),Y=$P(X,"^",3),(LRDPF,X)=$P(X,"^",2),X=^DIC(X,0,"GL"),X=@(X_Y_",0)"),LRP=$P(X,"^"),SSN=$P(X,"^",9) D:$Y>(IOSL-6) H
S LRW=LRW+1,X=^LR(LRDFN,0),(DFN,Y)=$P(X,"^",3),(LRDPF,X)=$P(X,"^",2),X=^DIC(X,0,"GL"),X=@(X_Y_",0)"),LRP=$P(X,"^"),SSN=$P(X,"^",9) D:$Y>(IOSL-6) H D SSN^LRU ;IHS/ANMC/CLS 11/1/95
;W !!,LRP,?35,"ID:",SSN
W !!,LRP,?35,"ID:",HRCN ;IHS/ANMC/CLS 11/1/95
F LRA=0:0 S LRA=$O(^LR(LRDFN,1.7,LRA)) Q:'LRA S:'$D(^TMP($J,LRA)) ^(LRA)=0 S ^(LRA)=^(LRA)+1 D:$Y>(IOSL-6) H1 W !?3,$P(^LAB(61.3,LRA,0),"^")
Q
H S LRQ=LRQ+1,%DT="T",X="N" D ^%DT,D^LRU W @IOF,Y," BLOOD BANK ",LRQ(1),?(IOM-10),"Pg: ",LRQ,!,LR("%") Q
H1 ;D H W !,LRP,?35,"ID:",SSN,?50,"(continued from pg:",LRQ-1,")" Q
D H W !,LRP,?35,"ID:",HRCN,?50,"(continued from pg:",LRQ-1,")" Q ;IHS/ANMC/CLS 11/1/95
END D V^LRU Q
;LRW=count of pts with antibodies
LRBLPAB ; IHS/DIR/FJE - ANTIBODIES IDENTIFIED 2/18/93 09:37 ;
+1 ;;5.2;LR;;NOV 01, 1997
+2 ;
+3 ;;5.2;LAB SERVICE;;Sep 27, 1994
+4 WRITE !!?20,"PATIENT ANTIBODIES IDENTIFIED"
+5 IF DUZ(0)'["@"&(DUZ(0)'["l")
WRITE $CHAR(7),!,"You do not have the proper access to proceed."
GOTO END
+6 SET ZTRTN="QUE^LRBLPAB"
DO BEG^LRUTL
IF POP!($DATA(ZTSK))
GOTO END
QUE USE IO
KILL ^TMP($JOB)
DO L^LRU
DO S^LRU
SET (LRW,LRC)=0
DO H
+1 SET LRX=0
FOR LRD=0:0
SET LRX=$ORDER(^DPT("B",LRX))
IF LRX=""
QUIT
FOR LRY=0:0
SET LRY=$ORDER(^DPT("B",LRX,LRY))
IF 'LRY
QUIT
IF $DATA(^DPT(LRY,"LR"))
SET LRDFN=^("LR")
SET LRC=LRC+1
IF $ORDER(^LR(LRDFN,1.7,0))
DO W
+2 IF $Y>(IOSL-6)
DO H
WRITE !,"Patients in lab data file: ",$JUSTIFY(LRC,6),!,"Patients with antibodies: ",$JUSTIFY(LRW,6)
+3 FOR LRA=0:0
SET LRA=$ORDER(^TMP($JOB,LRA))
IF 'LRA
QUIT
SET LRA(1)=^(LRA)
IF $Y>(IOSL-6)
DO H
WRITE !,$PIECE(^LAB(61.3,LRA,0),"^")," = ",LRA(1)
+4 DO END^LRUTL
DO END
QUIT
W ;S LRW=LRW+1,X=^LR(LRDFN,0),Y=$P(X,"^",3),(LRDPF,X)=$P(X,"^",2),X=^DIC(X,0,"GL"),X=@(X_Y_",0)"),LRP=$P(X,"^"),SSN=$P(X,"^",9) D:$Y>(IOSL-6) H
+1 ;IHS/ANMC/CLS 11/1/95
SET LRW=LRW+1
SET X=^LR(LRDFN,0)
SET (DFN,Y)=$PIECE(X,"^",3)
SET (LRDPF,X)=$PIECE(X,"^",2)
SET X=^DIC(X,0,"GL")
SET X=@(X_Y_",0)")
SET LRP=$PIECE(X,"^")
SET SSN=$PIECE(X,"^",9)
IF $Y>(IOSL-6)
DO H
DO SSN^LRU
+2 ;W !!,LRP,?35,"ID:",SSN
+3 ;IHS/ANMC/CLS 11/1/95
WRITE !!,LRP,?35,"ID:",HRCN
+4 FOR LRA=0:0
SET LRA=$ORDER(^LR(LRDFN,1.7,LRA))
IF 'LRA
QUIT
IF '$DATA(^TMP($JOB,LRA))
SET ^(LRA)=0
SET ^(LRA)=^(LRA)+1
IF $Y>(IOSL-6)
DO H1
WRITE !?3,$PIECE(^LAB(61.3,LRA,0),"^")
+5 QUIT
H SET LRQ=LRQ+1
SET %DT="T"
SET X="N"
DO ^%DT
DO D^LRU
WRITE @IOF,Y," BLOOD BANK ",LRQ(1),?(IOM-10),"Pg: ",LRQ,!,LR("%")
QUIT
H1 ;D H W !,LRP,?35,"ID:",SSN,?50,"(continued from pg:",LRQ-1,")" Q
+1 ;IHS/ANMC/CLS 11/1/95
DO H
WRITE !,LRP,?35,"ID:",HRCN,?50,"(continued from pg:",LRQ-1,")"
QUIT
END DO V^LRU
QUIT
+1 ;LRW=count of pts with antibodies