source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LR7OSBR1.m@ 1789

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

initial load of WorldVistAEHR

File size: 6.6 KB
Line 
1LR7OSBR1 ;slc/dcm - Silent BB rpt cont. ;8/11/97
2 ;;5.2;LAB SERVICE;**121,201,228,230,292**;Sep 27, 1994
3 ;from LRBLPBR
4 ;Reference to GETS^DIQ supported by IA #2056
5EN ;
6 N A,B,J,LRMD,LRI,X,X0
7 S LR(2)=0,LRMD=$P(LR,"^",5)
8 D H
9 S LR("F")=1
10 I $D(^LR(LRDFN,1.7)) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(4,CCNT,"Antibodies identified: ") F LR(9)=0:0 S LR(9)=$O(^LR(LRDFN,1.7,LR(9))) Q:'LR(9) D
11 . I CCNT>(GIOM-15) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT," ")
12 . S ^TMP("LRC",$J,GCNT,0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(CCNT,CCNT,$P(^LAB(61.3,LR(9),0),"^")_"; ")
13 I $O(^LR("AB",LRDFN,0)) D
14 . D LINE^LR7OSUM4
15 . S J=0
16 . F S J=$O(^LR("AB",LRDFN,J)) Q:'J S A=0 F S A=$O(^LR("AB",LRDFN,J,A)) Q:'A D
17 .. S LR(1.9)=$G(^LR(LRDFN,1.6,A,0))
18 .. I LR(1.9)="" K ^LR("AB",LRDFN,J,A) Q
19 .. S Y=+LR(1.9)
20 .. D D^LRU
21 .. D LN
22 .. S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(0,CCNT,"TRANSFUSION REACTIONS WITH UNIT IDENTIFIED")_$$S^LR7OS(51,CCNT,"UNIT ID")_$$S^LR7OS(66,CCNT,"COMPONENT")
23 .. D LN
24 .. S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(0,CCNT,Y)_$$S^LR7OS(21,CCNT,$P($G(^LAB(65.4,J,0)),U))_$$S^LR7OS(51,CCNT,$P(LR(1.9),U,3))_$$S^LR7OS(69,CCNT,$P($G(^LAB(66,+$P(LR(1.9),U,2),0)),U,2))
25 .. F B(1)=0:0 S B(1)=$O(^LR(LRDFN,1.6,A,1,B(1))) Q:'B(1) S B(2)=^(B(1),0) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(0,CCNT,B(2))
26 I $O(^LR(LRDFN,1.9,0)) D
27 . D LINE^LR7OSUM4
28 . S A=0
29 . F B=0:1 S A=$O(^LR(LRDFN,1.9,A)) Q:'A S LR(1.9)=^(A,0) D
30 .. I 'B D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(0,CCNT,"TRANSFUSION REACTIONS WITHOUT UNIT IDENTIFIED:")
31 .. S Y=+LR(1.9)
32 .. D D^LRU
33 .. D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(0,CCNT,Y)_$$S^LR7OS(21,CCNT,$P($G(^LAB(65.4,+$P(LR(1.9),U,2),0)),U))
34 .. F B=0:0 S B=$O(^LR(LRDFN,1.9,A,1,B)) Q:'B S X0=^(B,0) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(0,CCNT,X0)
35 D LINE^LR7OSUM4
36 I $D(LRN(2)) D C
37 D DT
38 S LRI=LRIN
39 F A=1:1 S LRI=$O(^LR(LRDFN,LRSS,LRI)) Q:'LRI!(CT1>COUNT)!(LRI>LROUT) S LR(5)=^(LRI,0) I $P(LR(5),"^",3) D
40 . S T=+LR(5),CT1=CT1+1
41 . D T,LN
42 . S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(4,CCNT,T)
43 . D W
44 Q
45W ;
46 S X=$G(^LR(LRDFN,LRSS,LRI,10)),LRN(10.3,3)=$P(X,"^",3)
47 S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(21,CCNT,$J($P(X,"^"),2))
48 S X=$G(^LR(LRDFN,LRSS,LRI,11)),LRN(11.3,3)=$P(X,"^",3),^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(24,CCNT,$P(X,"^"))
49 S X=$G(^LR(LRDFN,LRSS,LRI,2)),LRN(2.91,3)=$P(X,"^",10)
50 F H=1,4,6,9 S Y=$P(X,"^",H) S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS((30+$S(H=4:5,H=6:10,H=9:15,1:0)),CCNT,$S(Y="N":"Neg",Y="P":"Pos",H=9&(Y="I"):"Invalid",1:Y))
51 S X=$G(^LR(LRDFN,LRSS,LRI,6)),Y=$P(X,"^"),^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(62,CCNT,$S(Y="N":"Neg",Y="P":"Pos",1:Y))
52 F X=10.3,11.3,2.91 I LRN(X,3)]"" D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,LRN(X)_":"_LRN(X,3))
53 S J=0 F S J=$O(^LR(LRDFN,LRSS,LRI,"EA",J)) Q:'J D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"ELUATE ANTIBODY: "_$S($D(^LAB(61.3,J,0)):$P(^(0),"^"),1:J))
54 S J=0 F S J=$O(^LR(LRDFN,LRSS,LRI,5,J)) Q:'J D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"SERUM ANTIBODY IDENTIFIED: "_$S($D(^LAB(61.3,J,0)):$P(^(0),"^"),1:J))
55 S J=0 F S J=$O(^LR(LRDFN,LRSS,LRI,4,J)) Q:'J S J(1)=^(J,0) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,LRN(8)_":"_J(1))
56 S J=0 F S J=$O(^LR(LRDFN,LRSS,LRI,99,J)) Q:'J S J(1)=^(J,0) D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(8,CCNT,J(1))
57 Q
58T ;
59 S T=T_"000",T=$$FMTE^XLFDT($P(T,"."),"5Z")_$S(T[".":" "_$E(T,9,10)_":"_$E(T,11,12),1:"")
60 Q
61C ;
62 S A=0 F B=1:1 S A=$O(^LRD(65,"AP",LRDFN,A)) Q:'A D N
63 I B=1 D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"No UNITS assigned/xmatched")
64 D LINE^LR7OSUM4
65 S A=0 F B=0:1 S A=$O(^LR(LRDFN,1.8,A)) Q:'A S F=^(A,0) I $P(F,"^",3)>(9999999-LROUT),$P(F,"^",3)<(9999999-LRIN) D:'B R D L
66 I 'B D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"No component requests")
67 Q
68N ;
69 I B=1 D LINE^LR7OSUM4,LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(6,CCNT,"Unit assigned/xmatched:")_$$S^LR7OS(46,CCNT,"Exp date")_$$S^LR7OS(64,CCNT,"Loc")
70 I '$D(^LRD(65,A,0)) K ^LRD(65,"AP",LRDFN,A) Q
71 S F=^LRD(65,A,0),L=$O(^(3,0)) I L S L=$P(^(L,0),"^",4)
72 E D LOCAT
73 I $P(F,"^",5)<(9999999-LROUT)!($P(F,"^",5)>(9999999-LRIN)) Q
74 S M=^LAB(66,$P(F,"^",4),0)
75 D LN
76 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,$J(B,2)_")")_$$S^LR7OS(6,CCNT,$P(F,"^"))_$$S^LR7OS(17,CCNT,$E($P(M,"^"),1,19))_$$S^LR7OS(38,CCNT,$P(F,"^",7)_" "_$P(F,"^",8))
77 S Y=$P(F,"^",6)
78 D D^LRU
79 D:'(L]"") LOCAT
80 S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(45,CCNT,Y)_$$S^LR7OS(64,CCNT,L)
81 Q
82LOCAT ;Determine the Institution (file 4) where the unit resides if no
83 ;location is listed in 65.03,.04
84 S L=$P(^LRD(65,A,0),"^",16)
85 I L]"" K LERROR D GETS^DIQ(4,L,.01,,"L","LERROR") D
86 . I L]"",L'=-1 S L="BB-"_$G(L(4,L_",",.01))
87 . K L(4) Q
88 ;S L=$P(^DIC(4,L,0),"^") ;Convert to FileMan reference
89 I L=""!((L=-1)!($D(LERROR))) S L="???????????"
90 Q
91L ;
92 I '$D(^LAB(66,+F,0)) L +^LR(LRDFN,1.8):360 G:'$T L K ^LR(LRDFN,1.8,+F) S X=^LR(LRDFN,1.8,0),X(1)=$O(^LR(LRDFN,1.8,0)),^LR(LRDFN,1.8,0)=$P(X,"^",1,2)_"^"_X(1)_"^"_$S(X(1)="":"",1:($P(X,"^",4)-1)) L -^LR(LRDFN,1.8) Q
93 S T=$P(F,"^",3)
94 D T,LN
95 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,$E($P(^LAB(66,+F,0),"^"),1,25))_$$S^LR7OS(26,CCNT,$J($P(F,"^",4),3))_$$S^LR7OS(32,CCNT,T)
96 S T=$P(F,"^",5)
97 D T
98 S ^TMP("LRC",$J,GCNT,0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(49,CCNT,T)_$$S^LR7OS(65,CCNT,$E($P(F,"^",9),1,10))_$$S^LR7OS(77,CCNT,$S($P(F,"^",8)="":"",$D(^VA(200,$P(F,"^",8),0)):$P(^(0),"^",2),1:$P(F,"^",8)))
99 Q
100H ;
101 D LN
102 S X=GIOM/2-(10/2+5),^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(X,CCNT,"---- BLOOD BANK ----"),^TMP("LRH",$J,"BLOOD BANK")=GCNT
103 D LN
104 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"ABO Rh: "_$J($P(LR,"^",3),2)_" "_$P(LR,"^",4))
105 Q
106DT ;
107 D LINE^LR7OSUM4,LN
108 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(30,CCNT,"|---")_$$S^LR7OS(39,CCNT,"AHG(direct)")_$$S^LR7OS(55,CCNT,"---|")_$$S^LR7OS(62,CCNT,"|-AHG(indirect)-|")
109 D LN
110 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(4,CCNT,"Date/time")_$$S^LR7OS(20,CCNT,"ABO")_$$S^LR7OS(24,CCNT,"Rh")_$$S^LR7OS(30,CCNT,"POLY")_$$S^LR7OS(35,CCNT,"IgG")_$$S^LR7OS(40,CCNT,"C3")
111 S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(45,CCNT,"Interpretation")_$$S^LR7OS(62,CCNT,"(Antibody screen)")
112 D LN
113 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(4,CCNT,"---------")_$$S^LR7OS(20,CCNT,"---")_$$S^LR7OS(24,CCNT,"--")_$$S^LR7OS(30,CCNT,"----")_$$S^LR7OS(35,CCNT,"---")
114 S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(40,CCNT,"---")_$$S^LR7OS(45,CCNT,"--------------")_$$S^LR7OS(62,CCNT,"-----------------")
115 Q
116H3 ;
117 D H,LINE^LR7OSUM4,LN
118 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(6,CCNT,"Unit assigned/xmatched:")_$$S^LR7OS(46,CCNT,"Exp date")_$$S^LR7OS(64,CCNT,"Loc")
119 Q
120R ;
121 D LN
122 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Component requests")_$$S^LR7OS(26,CCNT,"Units")_$$S^LR7OS(32,CCNT,"Request date")_$$S^LR7OS(49,CCNT,"Date wanted")_$$S^LR7OS(65,CCNT,"Requestor")_$$S^LR7OS(77,CCNT,"By")
123 Q
124LN ;
125 S GCNT=GCNT+1,CCNT=1
126 Q
Note: See TracBrowser for help on using the repository browser.