source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRBLPTR.m@ 1258

Last change on this file since 1258 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.4 KB
RevLine 
[613]1LRBLPTR ;AVAMC/REG - TRANSFUSION DATA REPORT ;2/18/93 09:47 ;
2 ;;5.2;LAB SERVICE;**247,267**;Sep 27, 1994
3 ;Per VHA Directive 97-033 this routine should not be modified. Medical Device # BK970021
4 D END W !?30,"Transfusion data report"
5 D B^LRBLU G:Y<0 END S LRSDT=LRSDT-.0001,LRLDT=$S(LRLDT'[".":LRLDT+.99,1:LRLDT),LRG=0
6 W !!,"Also print transfusions with hematology results " S %=2 D YN^LRU G:%<1 END S:%=1 LRG=1
7 S ZTRTN="QUE^LRBLPTR" D BEG^LRUTL G:POP!($D(ZTSK)) END
8QUE U IO K ^TMP($J),^TMP("LRBL",$J) D L^LRU,S^LRU,H S LR("F")=1
9 F LRD=LRSDT:0 S LRD=$O(^LRD(65,"AB",LRD)) Q:'LRD!(LRD>LRLDT) F LRI=0:0 S LRI=$O(^LRD(65,"AB",LRD,LRI)) Q:'LRI I $D(^LRD(65,LRI,6)),$P(^(6),"^") S W(6)=^(6),W(4)=^(4),W(0)=^(0),C=$P(W(0),"^",4) D SET
10 F P=0:0 S P=$O(^TMP($J,P)) Q:'P D PT
11 S LRP=0 F S LRP=$O(^TMP($J,"B",LRP)) Q:LRP=""!(LR("Q")) F P=0:0 S P=$O(^TMP($J,"B",LRP,P)) Q:'P!(LR("Q")) S SSN=^(P) D W
12 G:LR("Q") OUT D:$Y>(IOSL-9) H G:LR("Q") OUT W !!,LR("%") F A=0:0 S A=$O(LRC(A)) Q:'A D:$Y>(IOSL-6) H Q:LR("Q") S X=^LAB(66,A,0) W !?2,$P(X,"^",2),?8,"=",$P(X,"^")
13OUT D:LRG&('LR("Q")) ^LRBLPTR1 D END,END^LRUTL Q
14W D:$Y>(IOSL-6) H Q:LR("Q") S (LRE,LRF)="" W !!,"Patient: ",LRP,?41,"SSN: ",SSN D:$O(^LR(P,1.9,0)) B Q:LR("Q")
15 F C=0:0 S C=$O(^TMP($J,P,C)) Q:'C!(LR("Q")) S C(1)=$P(^LAB(66,C,0),"^",2),LRC(C)="",LRD=0 F LRJ=0:1 S LRD=$O(^TMP($J,P,C,LRD)) Q:'LRD!(LR("Q")) S:'LRJ LRE=LRD D W1
16 I LRG S X1=$P(LRE,"."),X2=-1 D C^%DTC S LRE=X,X1=$P(LRF,"."),X2=1 D C^%DTC S ^TMP("LRBL",$J,LRP,P)=LRE_"^"_X
17 Q
18W1 F LRI=0:0 S LRI=$O(^TMP($J,P,C,LRD,LRI)) Q:'LRI!(LR("Q")) S W=^(LRI) D P
19 I LRG S:LRD<LRE LRE=LRD S:LRD>LRF LRF=LRD
20 Q
21P D:$Y>(IOSL-6) H1 Q:LR("Q") W !,$P(W,"^"),?14,C(1),?19,$P(W,"^",8),?24,$P(W,"^",9),?29,$P(W,"^",2),?44,$P(W,"^",4),?47,$P(W,"^",5),?53,$P(W,"^",6),?62,$P(W,"^",3),?77,$P(W,"^",7)
22 W:$D(^LAB(65.4,+$P(W,"^",10),0)) !?2,"Transfusion reaction type: ",$P(^(0),"^")
23 F W=0:0 S W=$O(^LRD(65,LRI,7,W)) Q:'W!(LR("Q")) S W(1)=^(W,0) D:$Y>(IOSL-6) H1 Q:LR("Q") W !?2,W(1)
24 Q
25SET I LRD'=$P(W(4),"^",2) K ^LRD(65,"AB",LRD,LRI) Q
26 S W(3)=$O(^LRD(65,LRI,3,0)) S:W(3) W(3)=^(W(3),0)
27 S J=$P(W(3),"^",2),L=$S($P(W(3),"^",4)]"":$E($P(W(3),"^",4),1,9),1:"??"),Y=+W(3) D D S Y(1)=Y,Y=LRD D D S Y(2)=Y,Y=$P(W(3),"^",3) I Y,$D(^VA(200,Y,0)) S Y=$P(^(0),"^",2)
28 S X=$P(W(6),"^",5),^TMP($J,+W(6),C,LRD,LRI)=$P(W(0),"^")_"^"_Y(1)_"^"_Y(2)_"^"_J_"^"_Y_"^"_L_"^"_$S(X=0:"NO",X=1:"YES",1:"")_"^"_$P(W(4),"^",4)_"^"_$P(W(0),"^",11)_"^"_$P(W(6),"^",8) Q
29PT S X=^LR(P,0),Y=$P(X,"^",3),LRDPF=$P(X,U,2),X=^DIC(LRDPF,0,"GL"),Y=@(X_Y_",0)"),LRP=$P(Y,"^"),SSN=$P(Y,"^",9) D SSN^LRU S ^TMP($J,"B",LRP,P)=SSN Q
30B S A=0 F C=0:1 S A=$O(^LR(P,1.9,A)) Q:'A!(LR("Q")) S LR(1.9)=^(A,0) D:$Y>(IOSL-6) H1 Q:LR("Q") D:'C L S Y=+LR(1.9) D D^LRU S LRK=Y,LRR=$P($G(^LAB(65.4,+$P(LR(1.9),U,2),0)),U) W !,Y,?21,LRR D A
31 Q
32A F B=0:0 S B=$O(^LR(P,1.9,A,1,B)) Q:'B!(LR("Q")) S B(1)=^(B,0) D:$Y>(IOSL-6) H2 Q:LR("Q") W !,B(1)
33 Q
34 ;
35H I $D(LR("F")),IOST?1"C".E D M^LRU Q:LR("Q")
36 D F^LRU W !,"TRANSFUSION DATA REPORT FROM ",LRSTR," TO ",LRLST
37 W !,"Unit ID",?14,"Comp",?20,"(#)",?24,"(ml)",?29,"Relocated",?44,"CK",?47,"By",?53,"Location",?62,"Transfused",?77,"RXN"
38 W !,LR("%") Q
39H1 D H Q:LR("Q") W !!,"Patient: ",LRP,?41,"SSN: ",SSN Q
40H2 D H1 Q:LR("Q") D L W !,LRK,?21,LRR Q
41L W !,"TRANSFUSION REACTIONS WITHOUT UNIT IDENTIFIED" Q
42 ;
43D S:'Y Y="" Q:'Y S Y=Y_"000",Y=$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_$E(Y,2,3)_$S(Y[".":" "_$E(Y,9,10)_":"_$E(Y,11,12),1:"") Q
44END D V^LRU Q
Note: See TracBrowser for help on using the repository browser.