LRBLAA ; IHS/DIR/AAB - XM:TX BY TREATING SPECIALTY REPORT 9/11/95 14:02 ;
;;5.2;LR;**1002**;JUN 01, 1998
;;5.2;LAB SERVICE;**72**;Sep 27, 1994
D END,CK^LRBLPUS G:Y=-1 END
W !!?5,"Crossmatch:Transfusion Report by Treating Specialty and Physician",!
D B^LRU G:Y<0 END S LRLDT=LRLDT+.99,LRSDT=LRSDT-.0001
W !!,"Print only summary of crossmatches and transfusions " S %=1 D YN^LRU G:%<1 END S LRF=$S(%=1:0,1:1)
S ZTRTN="QUE^LRBLAA" W ! D BEG^LRUTL G:POP!($D(ZTSK)) END
QUE U IO S LR("M")=$P($G(^LAB(69.9,1,8.1,+DUZ(2),0)),U,6),LRQ(2)=$S(LRF:1,1:0) K ^TMP($J) D L^LRU,S^LRU,H S (LRL,LRM)=0 I LRF D B S LR("F")=1
D C Q:LR("Q") I LRF W !!,"ALL TREATING SPECIALTIES",?32,"Total Xm'd:",?43,$J(LRL,4),?52,"Tx'd:",?55,$J(LRM,4),?65,"C/T: " W $S(LRM:$J(LRL/LRM,5,3),1:"NA")
S LRQ(2)=0 D:LRF H Q:LR("Q") D A,^LRBLAA1
W ! W:IOST'?1"C".E @IOF D END^LRUTL,END Q
C F A=LRSDT:0 S A=$O(^LRD(65,"AN",A)) Q:'A!(A>LRLDT) F I=0:0 S I=$O(^LRD(65,"AN",A,I)) Q:'I F P=0:0 S P=$O(^LRD(65,"AN",A,I,P)) Q:'P F B=0:0 S B=$O(^LRD(65,"AN",A,I,P,B)) Q:'B D SET
S A=0 F A(1)=1:1 S A=$O(^TMP($J,A)) Q:A=""!(LR("Q")) S (LRJ,LRT)=0 D:A(1)>1&(LRF) H Q:LR("Q") W:LRF !?20,"TREATING SPECIALTY: ",A D M
Q
M S B=0 F B(1)=0:0 S B=$O(^TMP($J,A,B)) Q:B=""!(LR("Q")) D:$Y>(IOSL-6)&(LRF) H1 Q:LR("Q") S (LRK,LRD)=0 W:LRF !!?29,"PHYSICIAN: ",B D P
Q:LR("Q") S ^TMP($J,A)=LRJ_"^"_LRT I LRF D:$Y>(IOSL-6) H Q:LR("Q") W !!!,A,?32,"Units Xm'd:",?43,$J(LRJ,4),?52,"Tx'd:",?55,$J(LRT,4),?65,"C/T: " W $S(LRT:$J(LRJ/LRT,5,3),1:"NA")
Q
P F LRDFN=0:0 S LRDFN=$O(^TMP($J,A,B,LRDFN)) Q:'LRDFN!(LR("Q")) D:$Y>(IOSL-6)&(LRF) H2 Q:LR("Q") D W
Q:LR("Q") S ^TMP($J,A,B)=LRK_"^"_LRD I LRF W !!,B,?32,"Units Xm'd:",?43,$J(LRK,4),?52,"Tx'd:",?55,$J(LRD,4),?65,"C/T: " W $S(LRD:$J(LRK/LRD,5,3),1:"NA")
Q
W ;I LRF S 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 SSN^LRU W !,LRP,?32,SSN
I LRF S 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 SSN^LRU W !,LRP,?32,HRCN ;IHS/ANMC/CLS 11/1/95
F F=0:0 S F=$O(^TMP($J,A,B,LRDFN,F)) Q:'F!(LR("Q")) S Y=F D DT^LRU S LRY=Y D U
Q
U F G=0:0 S G=$O(^TMP($J,A,B,LRDFN,F,G)) Q:'G!(LR("Q")) S LRE=^(G) D:$Y>(IOSL-6)&(LRF) H3 Q:LR("Q") S X=$P(LRE,"^"),Y=$P(LRE,"^",2) D V
Q
V W:LRF !,LRY,?19,$P(LRE,"^",4),?20,$P(LRE,"^",3),?35,$P(LRE,"^",2),?38,X I LR("M"),LRF W ?60,$E($P($G(^DIC(4,+$P($G(^LRD(65,G,0)),U,16),0)),U),1,19)
I Y="C"!(Y="IG") S LRJ=LRJ+1,LRK=LRK+1,LRL=LRL+1 I X="TRANSFUSED" S LRT=LRT+1,LRD=LRD+1,LRM=LRM+1
Q
SET S X=^LRD(65,I,0),V=$S($D(^(8)):$P(^(8),"^",3),1:0),C=$P(X,"^",4),Z=$P(X,"^"),C=+$P(^LAB(66,C,0),"^",26),X=^LRD(65,I,2,P,1,B,0),Y=$P(X,"^",4),T=$S($P(X,"^",2)]"":$P(X,"^",2),1:"UNKNOWN"),M=$S($P(X,"^",3)]"":$P(X,"^",3),1:"UNKNOWN")
S ^TMP($J,T,M,P,+X,I)=$P(X,"^",10)_"^"_$S(Y]"":Y,1:"?")_"^"_Z_"^"_$S(V="A":"*",1:"")
Q
;
H I $D(LR("F")),IOST?1"C".E D M^LRU Q:LR("Q")
D F^LRU W !,LRO(68)," CROSSMATCH:TRANSFUSIONS (from: ",LRSTR," to ",LRLST,")"
;W:LRQ(2) !,"PATIENT",?19,"* = AUTOLOGOUS",?35,"SSN",!,"BLOOD SAMPLE DATE",?20,"UNIT ID",?35,"XM"
W:LRQ(2) !,"PATIENT",?19,"* = AUTOLOGOUS",?35,"HRCN",!,"BLOOD SAMPLE DATE",?20,"UNIT ID",?35,"XM" ;IHS/ANMC/CLS 11/1/95
W !,LR("%") Q
H1 D H Q:LR("Q") W !?20,"TREATING SPECIALTY: ",A Q
H2 D H1 Q:LR("Q") W !?29,"PHYSICIAN: ",B Q
H3 ;D H2 Q:LR("Q") W !,LRP,?32,SSN,?45,"(Cont'd from pg ",LRQ-1,")" Q
D H2 Q:LR("Q") W !,LRP,?32,HRCN,?45,"(Cont'd from pg ",LRQ-1,")" Q ;IHS/ANMC/CLS 11/1/95
A W !,"This report includes the following administrative categories:",!,"WHOLE BLOOD, RBC, FROZEN RBC, DEGLYC RBC, LEUCODEPLETED RBC, and WASHED RBC." Q
;
B D A W !!,"The following abbreviations are used to indicate crossmatch results:",!,"C=COMPATIBLE",!,"CD=COMPATIBLE, DON'T TRANSFUSE",!,"CF=COMPATIBLE, FURTHER STUDY NEEDED",!,"I=INCOMPATIBLE, UNSAFE TO TRANSFUSE"
W !,"IG=INCOMPATIBLE, GIVE WITH BLOOD BANK DIRECTOR APPROVAL",!,"CD, CF, and I are not included in crossmatch-transfusion calculations.",!,LR("%") Q
END D V^LRU Q
;^TMP($J,Rx Specialty,MD,Patient,Date,Unit)=Tx
LRBLAA ; IHS/DIR/AAB - XM:TX BY TREATING SPECIALTY REPORT 9/11/95 14:02 ;
+1 ;;5.2;LR;**1002**;JUN 01, 1998
+2 ;;5.2;LAB SERVICE;**72**;Sep 27, 1994
+3 DO END
DO CK^LRBLPUS
IF Y=-1
GOTO END
+4 WRITE !!?5,"Crossmatch:Transfusion Report by Treating Specialty and Physician",!
+5 DO B^LRU
IF Y<0
GOTO END
SET LRLDT=LRLDT+.99
SET LRSDT=LRSDT-.0001
+6 WRITE !!,"Print only summary of crossmatches and transfusions "
SET %=1
DO YN^LRU
IF %<1
GOTO END
SET LRF=$SELECT(%=1:0,1:1)
+7 SET ZTRTN="QUE^LRBLAA"
WRITE !
DO BEG^LRUTL
IF POP!($DATA(ZTSK))
GOTO END
QUE USE IO
SET LR("M")=$PIECE($GET(^LAB(69.9,1,8.1,+DUZ(2),0)),U,6)
SET LRQ(2)=$SELECT(LRF:1,1:0)
KILL ^TMP($JOB)
DO L^LRU
DO S^LRU
DO H
SET (LRL,LRM)=0
IF LRF
DO B
SET LR("F")=1
+1 DO C
IF LR("Q")
QUIT
IF LRF
WRITE !!,"ALL TREATING SPECIALTIES",?32,"Total Xm'd:",?43,$JUSTIFY(LRL,4),?52,"Tx'd:",?55,$JUSTIFY(LRM,4),?65,"C/T: "
WRITE $SELECT(LRM:$JUSTIFY(LRL/LRM,5,3),1:"NA")
+2 SET LRQ(2)=0
IF LRF
DO H
IF LR("Q")
QUIT
DO A
DO ^LRBLAA1
+3 WRITE !
IF IOST'?1"C".E
WRITE @IOF
DO END^LRUTL
DO END
QUIT
C FOR A=LRSDT:0
SET A=$ORDER(^LRD(65,"AN",A))
IF 'A!(A>LRLDT)
QUIT
FOR I=0:0
SET I=$ORDER(^LRD(65,"AN",A,I))
IF 'I
QUIT
FOR P=0:0
SET P=$ORDER(^LRD(65,"AN",A,I,P))
IF 'P
QUIT
FOR B=0:0
SET B=$ORDER(^LRD(65,"AN",A,I,P,B))
IF 'B
QUIT
DO SET
+1 SET A=0
FOR A(1)=1:1
SET A=$ORDER(^TMP($JOB,A))
IF A=""!(LR("Q"))
QUIT
SET (LRJ,LRT)=0
IF A(1)>1&(LRF)
DO H
IF LR("Q")
QUIT
IF LRF
WRITE !?20,"TREATING SPECIALTY: ",A
DO M
+2 QUIT
M SET B=0
FOR B(1)=0:0
SET B=$ORDER(^TMP($JOB,A,B))
IF B=""!(LR("Q"))
QUIT
IF $Y>(IOSL-6)&(LRF)
DO H1
IF LR("Q")
QUIT
SET (LRK,LRD)=0
IF LRF
WRITE !!?29,"PHYSICIAN: ",B
DO P
+1 IF LR("Q")
QUIT
SET ^TMP($JOB,A)=LRJ_"^"_LRT
IF LRF
IF $Y>(IOSL-6)
DO H
IF LR("Q")
QUIT
WRITE !!!,A,?32,"Units Xm'd:",?43,$JUSTIFY(LRJ,4),?52,"Tx'd:",?55,$JUSTIFY(LRT,4),?65,"C/T: "
WRITE $SELECT(LRT:$JUSTIFY(LRJ/LRT,5,3),1:"NA")
+2 QUIT
P FOR LRDFN=0:0
SET LRDFN=$ORDER(^TMP($JOB,A,B,LRDFN))
IF 'LRDFN!(LR("Q"))
QUIT
IF $Y>(IOSL-6)&(LRF)
DO H2
IF LR("Q")
QUIT
DO W
+1 IF LR("Q")
QUIT
SET ^TMP($JOB,A,B)=LRK_"^"_LRD
IF LRF
WRITE !!,B,?32,"Units Xm'd:",?43,$JUSTIFY(LRK,4),?52,"Tx'd:",?55,$JUSTIFY(LRD,4),?65,"C/T: "
WRITE $SELECT(LRD:$JUSTIFY(LRK/LRD,5,3),1:"NA")
+2 QUIT
W ;I LRF S X=^LR(LRDFN,0),Y=$P">P">P">P">P">P">P">P(X,"^",3),(LRDP">P">P">P">P">P">P">PF,X)=$P">P">P">P">P">P">P">P(X,"^",2),X=^DIC(X,0,"GL"),X=@(X_Y_",0)"),LRP">P">P">P">P">P">P">P=$P">P">P">P">P">P">P">P(X,"^"),SSN=$P">P">P">P">P">P">P">P(X,"^",9) D SSN^LRU W !,LRP">P">P">P">P">P">P">P,?32,SSN
+1 ;IHS/ANMC/CLS 11/1/95
IF LRF
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)
DO SSN^LRU
WRITE !,LRP,?32,HRCN
+2 FOR F=0:0
SET F=$ORDER(^TMP($JOB,A,B,LRDFN,F))
IF 'F!(LR("Q"))
QUIT
SET Y=F
DO DT^LRU
SET LRY=Y
DO U
+3 QUIT
U FOR G=0:0
SET G=$ORDER(^TMP($JOB,A,B,LRDFN,F,G))
IF 'G!(LR("Q"))
QUIT
SET LRE=^(G)
IF $Y>(IOSL-6)&(LRF)
DO H3
IF LR("Q")
QUIT
SET X=$PIECE(LRE,"^")
SET Y=$PIECE(LRE,"^",2)
DO V
+1 QUIT
V IF LRF
WRITE !,LRY,?19,$PIECE(LRE,"^",4),?20,$PIECE(LRE,"^",3),?35,$PIECE(LRE,"^",2),?38,X
IF LR("M")
IF LRF
WRITE ?60,$EXTRACT($PIECE($GET(^DIC(4,+$PIECE($GET(^LRD(65,G,0)),U,16),0)),U),1,19)
+1 IF Y="C"!(Y="IG")
SET LRJ=LRJ+1
SET LRK=LRK+1
SET LRL=LRL+1
IF X="TRANSFUSED"
SET LRT=LRT+1
SET LRD=LRD+1
SET LRM=LRM+1
+2 QUIT
SET SET X=^LRD(65,I,0)
SET V=$SELECT($DATA(^(8)):$PIECE(^(8),"^",3),1:0)
SET C=$PIECE(X,"^",4)
SET Z=$PIECE(X,"^")
SET C=+$PIECE(^LAB(66,C,0),"^",26)
SET X=^LRD(65,I,2,P,1,B,0)
SET Y=$PIECE(X,"^",4)
SET T=$SELECT($PIECE(X,"^",2)]"":$PIECE(X,"^",2),1:"UNKNOWN")
SET M=$SELECT($PIECE(X,"^",3)]"":$PIECE(X,"^",3),1:"UNKNOWN")
+1 SET ^TMP($JOB,T,M,P,+X,I)=$PIECE(X,"^",10)_"^"_$SELECT(Y]"":Y,1:"?")_"^"_Z_"^"_$SELECT(V="A":"*",1:"")
+2 QUIT
+3 ;
H IF $DATA(LR("F"))
IF IOST?1"C".E
DO M^LRU
IF LR("Q")
QUIT
+1 DO F^LRU
WRITE !,LRO(68)," CROSSMATCH:TRANSFUSIONS (from: ",LRSTR," to ",LRLST,")"
+2 ;W:LRQ(2) !,"PATIENT",?19,"* = AUTOLOGOUS",?35,"SSN",!,"BLOOD SAMPLE DATE",?20,"UNIT ID",?35,"XM"
+3 ;IHS/ANMC/CLS 11/1/95
IF LRQ(2)
WRITE !,"PATIENT",?19,"* = AUTOLOGOUS",?35,"HRCN",!,"BLOOD SAMPLE DATE",?20,"UNIT ID",?35,"XM"
+4 WRITE !,LR("%")
QUIT
H1 DO H
IF LR("Q")
QUIT
WRITE !?20,"TREATING SPECIALTY: ",A
QUIT
H2 DO H1
IF LR("Q")
QUIT
WRITE !?29,"PHYSICIAN: ",B
QUIT
H3 ;D H2 Q:LR("Q") W !,LRP,?32,SSN,?45,"(Cont'd from pg ",LRQ-1,")" Q
+1 ;IHS/ANMC/CLS 11/1/95
DO H2
IF LR("Q")
QUIT
WRITE !,LRP,?32,HRCN,?45,"(Cont'd from pg ",LRQ-1,")"
QUIT
A WRITE !,"This report includes the following administrative categories:",!,"WHOLE BLOOD, RBC, FROZEN RBC, DEGLYC RBC, LEUCODEPLETED RBC, and WASHED RBC."
QUIT
+1 ;
B DO A
WRITE !!,"The following abbreviations are used to indicate crossmatch results:",!,"C=COMPATIBLE",!,"CD=COMPATIBLE, DON'T TRANSFUSE",!,"CF=COMPATIBLE, FURTHER STUDY NEEDED",!,"I=INCOMPATIBLE, UNSAFE TO TRANSFUSE"
+1 WRITE !,"IG=INCOMPATIBLE, GIVE WITH BLOOD BANK DIRECTOR APPROVAL",!,"CD, CF, and I are not included in crossmatch-transfusion calculations.",!,LR("%")
QUIT
END DO V^LRU
QUIT
+1 ;^TMP($J,Rx Specialty,MD,Patient,Date,Unit)=Tx