source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORWDXVB1.m@ 1396

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

revised back to 6/30/08 version

File size: 7.4 KB
Line 
1ORWDXVB1 ;slc/dcm - Order dialog utilities for Blood Bank Cont.;3/2/04 09:31 ;12/7/05 17:20
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**215**;Dec 17 1997
3 ;
4PTINFO ;Format patient BB info
5 N GCNT,CCNT,GIOSL,GIOM,I,TYPE,ORUA,VBERROR,ABFND,LINE1,LINE2,NOABO,NOPAT,TREQFND
6 S (GCNT,NOPAT,NOABO)=0,CCNT=1,GIOSL=999999,GIOM=80
7 S OROOT=$NA(^TMP("ORVBEC",$J))
8 K ^TMP("ORVBEC",$J)
9 ;
10 I +$G(ORX("ERROR")) D ERROR^ORWDXVB2 Q
11 ; Patient Demographics
12 D LN
13 I '$D(ORX("PATIENT")) D Q
14 . D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
15 . S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(10,CCNT,"There is no previous record of this patient in VBECS.",.CCNT) Q
16 ;
17 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT,"Name",.CCNT)_$$S^ORU4(27,CCNT,"SSN",.CCNT)_$$S^ORU4(42,CCNT,"ABO/Rh",.CCNT)
18 D LN
19 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT,"----",.CCNT)_$$S^ORU4(27,CCNT,"---",.CCNT)_$$S^ORU4(42,CCNT,"------",.CCNT) D
20 . D LN
21 . S X=ORX("PATIENT"),^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT,$P(X,"^",3)_", "_$P(X,"^",2),.CCNT)_$$S^ORU4(27,CCNT,$P(X,"^",4),.CCNT)
22 . I $P(ORX("ABORH"),"^")']"" S ^TMP("ORVBEC",$J,GCNT,0)=^TMP("ORVBEC",$J,GCNT,0)_$$S^ORU4(42,CCNT,"unknown",.CCNT) Q
23 . S X=ORX("ABORH"),^TMP("ORVBEC",$J,GCNT,0)=^TMP("ORVBEC",$J,GCNT,0)_$$S^ORU4(42,CCNT,$$STRIP^XLFSTR($P(X,"^")," ")_" "_$S($$STRIP^XLFSTR($P(X,"^",2)," ")="P":"Pos",$$STRIP^XLFSTR($P(X,"^",2)," ")="N":"Neg",1:"unknown"),.CCNT) Q
24 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
25 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
26 ;
27 ; Available Specimens
28 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT,"Available Specimen UID",.CCNT)_$$S^ORU4(27,CCNT,"Expiration Date",.CCNT)
29 D LN
30 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT,"----------------------",.CCNT)_$$S^ORU4(27,CCNT,"---------------",.CCNT) D
31 . I '$D(ORX("SPECIMEN")) D LN S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT," none",.CCNT) Q
32 . D LN
33 . S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(2,CCNT,$P(ORX("SPECIMEN"),"^",2),.CCNT)_$$S^ORU4(27,CCNT,$$DATETIME^ORCHTAB($P(ORX("SPECIMEN"),"^")),.CCNT) Q
34 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
35 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
36 ;
37 ; Antibodies Identified section
38 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT,"Antibodies Identified",.CCNT)
39 D LN
40 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT,"---------------------",.CCNT) D
41 . I '$O(ORX("ABHIS",0)) D LN S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT," none",.CCNT) Q
42 . D LN
43 . S ABFND=0
44 . S I=0 F S I=$O(ORX("ABHIS",I)) Q:I<1 D
45 . . S X=ORX("ABHIS",I)
46 . . I ABFND S ^TMP("ORVBEC",$J,GCNT,0)=^TMP("ORVBEC",$J,GCNT,0)_$$S^ORU4(2,CCNT,", "_$P(X,"^"),.CCNT) Q
47 . . S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(2,CCNT,$P(X,"^"),.CCNT),ABFND=1
48 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
49 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
50 ;
51 ; Transfusion Requirements section
52 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT,"Transfusion Requirements",.CCNT)
53 D LN
54 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT,"------------------------",.CCNT) D
55 . I '$O(ORX("TRREQ",0)) D LN S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT," none",.CCNT) Q
56 . D LN
57 . S TREQFND=0
58 . S I=0 F S I=$O(ORX("TRREQ",I)) Q:I<1 D
59 . . S X=ORX("TRREQ",I)
60 . . I TREQFND S ^TMP("ORVBEC",$J,GCNT,0)=^TMP("ORVBEC",$J,GCNT,0)_$$S^ORU4(2,CCNT,", "_X,.CCNT) Q
61 . . S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(2,CCNT,X,.CCNT),TREQFND=1
62 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
63 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
64 ;
65 ; Transfusion Reactions section
66 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT,"Transfusion Reactions",.CCNT)_$$S^ORU4(27,CCNT,"Date/Time",.CCNT)
67 D LN
68 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT,"---------------------",.CCNT)_$$S^ORU4(27,CCNT,"---------",.CCNT) D
69 . I '$O(ORX("TRHX",0)) D LN S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT," none",.CCNT) Q
70 . S I=0 F S I=$O(ORX("TRHX",I)) Q:I<1 D
71 . . D LN
72 . . S X=ORX("TRHX",I),^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(2,CCNT,$P(X,"^"),.CCNT)_$$S^ORU4(27,CCNT,$$DATETIME($P(X,"^",2)),.CCNT)
73 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
74 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
75 ;
76 ; Units section
77 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT,"Units Available",.CCNT)
78 D LN
79 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(1,CCNT,"---------------",.CCNT)
80 D LN
81 ; Autologous Units
82 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(2,CCNT,"Autologous",.CCNT)
83 D LN
84 I $O(ORX("UNIT","A",0)) D
85 . S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT,"Unit ID",.CCNT)_$$S^ORU4(13,CCNT,"Component",.CCNT)_$$S^ORU4(27,CCNT,"Expiration Date Division",.CCNT)
86 . D LN
87 . S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT,"-------",.CCNT)_$$S^ORU4(13,CCNT,"---------",.CCNT)_$$S^ORU4(27,CCNT,"--------------- --------",.CCNT) D
88 . . S I=0 F S I=$O(ORX("UNIT","A",I)) Q:I<1 D
89 . . . D LN
90 . . . S X=ORX("UNIT","A",I),^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT,$P(X,"^"),.CCNT)_$$S^ORU4(13,CCNT,$P(X,"^",2),.CCNT)_$$S^ORU4(27,CCNT,$$DATETIME($P(X,"^",4)),.CCNT)_$$S^ORU4(44,CCNT,$P(X,"^",3),.CCNT)
91 E S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT," none",.CCNT)
92 ;
93 ; Directed Units
94 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
95 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(2,CCNT,"Directed",.CCNT)
96 D LN
97 I $O(ORX("UNIT","D",0)) D
98 . S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT,"Unit ID",.CCNT)_$$S^ORU4(13,CCNT,"Component",.CCNT)_$$S^ORU4(27,CCNT,"Expiration Date Division",.CCNT)
99 . D LN
100 . S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT,"-------",.CCNT)_$$S^ORU4(13,CCNT,"---------",.CCNT)_$$S^ORU4(27,CCNT,"--------------- --------",.CCNT) D
101 . . S I=0 F S I=$O(ORX("UNIT","D",I)) Q:I<1 D
102 . . . D LN
103 . . . S X=ORX("UNIT","D",I),^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT,$P(X,"^"),.CCNT)_$$S^ORU4(13,CCNT,$P(X,"^",2),.CCNT)_$$S^ORU4(27,CCNT,$$DATETIME($P(X,"^",4)),.CCNT)_$$S^ORU4(44,CCNT,$P(X,"^",3),.CCNT)
104 E S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT," none",.CCNT)
105 ;
106 ; Crossmatched Units
107 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
108 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(2,CCNT,"Crossmatched",.CCNT)
109 D LN
110 I $O(ORX("UNIT","C",0)) D
111 . S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT,"Unit ID",.CCNT)_$$S^ORU4(13,CCNT,"Component",.CCNT)_$$S^ORU4(27,CCNT,"Available Until Division",.CCNT)
112 . D LN
113 . S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT,"-------",.CCNT)_$$S^ORU4(13,CCNT,"---------",.CCNT)_$$S^ORU4(27,CCNT,"--------------- --------",.CCNT) D
114 . . S I=0 F S I=$O(ORX("UNIT","C",I)) Q:I<1 D
115 . . . D LN
116 . . . S X=ORX("UNIT","C",I),^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT,$P(X,"^"),.CCNT)_$$S^ORU4(13,CCNT,$P(X,"^",2),.CCNT)_$$S^ORU4(27,CCNT,$$DATETIME($P(X,"^",4)),.CCNT)_$$S^ORU4(44,CCNT,$P(X,"^",3),.CCNT)
117 E S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT," none",.CCNT)
118 ;
119 ; Assigned Units
120 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
121 S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(2,CCNT,"Assigned",.CCNT)
122 D LN
123 I $O(ORX("UNIT","S",0)) D
124 . S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT,"Unit ID",.CCNT)_$$S^ORU4(13,CCNT,"Component",.CCNT)_$$S^ORU4(27,CCNT,"Available Until Division",.CCNT)
125 . D LN
126 . S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT,"-------",.CCNT)_$$S^ORU4(13,CCNT,"---------",.CCNT)_$$S^ORU4(27,CCNT,"--------------- --------",.CCNT) D
127 . . S I=0 F S I=$O(ORX("UNIT","S",I)) Q:I<1 D
128 . . . D LN
129 . . . S X=ORX("UNIT","S",I),^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT,$P(X,"^"),.CCNT)_$$S^ORU4(13,CCNT,$P(X,"^",2),.CCNT)_$$S^ORU4(27,CCNT,$$DATETIME($P(X,"^",4)),.CCNT)_$$S^ORU4(44,CCNT,$P(X,"^",3),.CCNT)
130 E S ^TMP("ORVBEC",$J,GCNT,0)=$$S^ORU4(3,CCNT," none",.CCNT)
131 D LINE^ORU4("^TMP(""ORVBEC"",$J)",GIOM),LN
132 ;
133 Q
134LN ;Increment counts
135 S GCNT=GCNT+1,CCNT=1
136 Q
137DATETIME(X) ; -- Return external form of YYYYMMDDHHNNSS date
138 N Y S Y=$$HL7TFM^XLFDT(X),Y=$$DATETIME^ORCHTAB(Y)
139 Q Y
Note: See TracBrowser for help on using the repository browser.