source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAIPST4.m@ 1361

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

initial load of WorldVistAEHR

File size: 7.2 KB
Line 
1RAIPST4 ;HIRMFO/GJC - Post-init number four ;12/18/97 09:08
2VERSION ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
3 ;
4EN1 ; Add Exam Statuses with an Imaging Type of 'Mammography'.
5 ; Exam Statuses created: Cancelled; Waiting For Exam; Called
6 ; For Exam; Examined; Transcribed and Complete.
7 N RAERR,RAFDA,RAITY,RATXT S RATXT(1)=" "
8 S RAITY=+$O(^RA(79.2,"B","MAMMOGRAPHY",0))
9 I RAITY=0 D Q ; mammography missing as an i-type
10 . S RATXT(1)=" ",RATXT(2)="Error, 'MAMMOGRAPHY' missing from the Imaging Type (79.2) file.",RATXT(3)="IRM and the Radiology/Nuclear Medicine ADPAC should investigate."
11 . D MES^XPDUTL(.RATXT)
12 . Q
13 S RATXT(1)=" "
14 S RATXT(2)="Add Exam Statuses with an Imaging Type of 'Mammography'."
15 S RATXT(3)="Exam Statuses created: Cancelled; Waiting For Exam; Called"
16 S RATXT(4)="For Exam; Examined; Transcribed and Complete."
17 D MES^XPDUTL(.RATXT) K RATXT
18 ;-------------------- Exam Status: Cancelled --------------------------
19 I '($D(^RA(72,"AA","MAMMOGRAPHY",0))\10) D ; Cancelled not filed.
20 . S RAFDA(72,"+1,",.01)="CANCELLED",RAFDA(72,"+1,",3)=0
21 . S RAFDA(72,"+1,",6)="y",RAFDA(72,"+1,",7)=RAITY
22 . D UPDATE^DIE("","RAFDA","","RAERR")
23 . I $D(RAERR("DIERR")) D ERMSG72("CANCELLED")
24 . Q
25 ;------------------ Exam Status: Waiting For Exam ---------------------
26 I '($D(^RA(72,"AA","MAMMOGRAPHY",1))\10) D ; Waiting For Xam not filed.
27 . K RAERR,RAFDA
28 . S RAFDA(72,"+1,",.01)="WAITING FOR EXAM",RAFDA(72,"+1,",3)=1
29 . S RAFDA(72,"+1,",5)="Y",RAFDA(72,"+1,",6)="y"
30 . S RAFDA(72,"+1,",7)=RAITY
31 . F RAI=.31,.32,.33,.34,.35,.36,.37,.38,.39,.311,.312,.313,.314,.315 S RAFDA(72,"+1,",RAI)="y"
32 . D UPDATE^DIE("","RAFDA","","RAERR")
33 . I $D(RAERR("DIERR")) D ERMSG72("WAITING FOR EXAM")
34 . Q
35 ;------------------ Exam Status: Called For Exam ----------------------
36 I '$$XIST("CALLED FOR EXAM",RAITY) D ; Called For Exam not filed.
37 . K RAERR,RAFDA
38 . S RAFDA(72,"+1,",.01)="CALLED FOR EXAM",RAFDA(72,"+1,",6)="y"
39 . S RAFDA(72,"+1,",7)=RAITY
40 . F RAI=.11,.21 S RAFDA(72,"+1,",RAI)="Y"
41 . F RAI=.31,.32,.33,.34,.35,.36,.37,.38,.39,.311,.312,.313,.314,.315 S RAFDA(72,"+1,",RAI)="y"
42 . D UPDATE^DIE("","RAFDA","","RAERR")
43 . I $D(RAERR("DIERR")) D ERMSG72("CALLED FOR EXAM")
44 . Q
45 ;------------------ Exam Status: Examined -----------------------------
46 I '$$XIST("EXAMINED",RAITY) D ; Examined not filed.
47 . K RAERR,RAFDA
48 . S RAFDA(72,"+1,",.01)="EXAMINED",RAFDA(72,"+1,",7)=RAITY
49 . F RAI=.11,.13,.14 S RAFDA(72,"+1,",RAI)="Y"
50 . F RAI=.21,.23,.24,.26 S RAFDA(72,"+1,",RAI)="Y"
51 . F RAI=.31,.32,.33,.34,.35,.36,.37,.38,.39,.311,.312,.313,.314,.315 S RAFDA(72,"+1,",RAI)="y"
52 . D UPDATE^DIE("","RAFDA","","RAERR")
53 . I $D(RAERR("DIERR")) D ERMSG72("EXAMINED")
54 . Q
55 ;------------------ Exam Status: Transcribed --------------------------
56 I '$$XIST("TRANSCRIBED",RAITY) D ; Transcribed not filed.
57 . K RAERR,RAFDA
58 . S RAFDA(72,"+1,",.01)="TRANSCRIBED",RAFDA(72,"+1,",7)=RAITY
59 . F RAI=.11,.12,.13,.14,.15,.16,.111 S RAFDA(72,"+1,",RAI)="Y"
60 . F RAI=.22,.25 S RAFDA(72,"+1,",RAI)="Y"
61 . F RAI=.31,.32,.33,.34,.35,.36,.37,.38,.39,.311,.312,.313,.314,.315 S RAFDA(72,"+1,",RAI)="y"
62 . D UPDATE^DIE("","RAFDA","","RAERR")
63 . I $D(RAERR("DIERR")) D ERMSG72("TRANSCRIBED")
64 . Q
65 ;------------------ Exam Status: Complete -----------------------------
66 I '($D(^RA(72,"AA","MAMMOGRAPHY",9))\10) D ; Complete not filed.
67 . K RAERR,RAFDA
68 . S RAFDA(72,"+1,",.01)="COMPLETE"
69 . S RAFDA(72,"+1,",3)=9,RAFDA(72,"+1,",7)=RAITY
70 . F RAI=.11,.12,.13,.14,.15,.16 S RAFDA(72,"+1,",RAI)="Y"
71 . F RAI=.111,.112,.116 S RAFDA(72,"+1,",RAI)="Y"
72 . F RAI=.31,.32,.33,.34,.35,.36,.37,.38,.39,.311,.312,.313,.314 S RAFDA(72,"+1,",RAI)="y"
73 . D UPDATE^DIE("","RAFDA","","RAERR")
74 . I $D(RAERR("DIERR")) D ERMSG72("COMPLETE")
75 . Q
76 Q
77 ;
78ERMSG72(X) ; Display error message when an Exam Status is not filed.
79 N Y
80 S Y(1)=" ",Y(2)="Error filing `"_X_"' in the Examination Status (72) file.",Y(3)="IRM and the Radiology/Nuclear Medicine ADPAC should investigate."
81 D MES^XPDUTL(.Y)
82 Q
83 ;
84XIST(X,Y) ; Check if an Exam Status for a particular imaging type exists
85 ; in file 72.
86 ; Input: X-Exam Status, Y-imaging type (pointer)
87 N I,XIT S (I,XIT)=0
88 F S I=$O(^RA(72,"B",X,I)) Q:I'>0 D Q:XIT
89 . S:$P($G(^RA(72,I,0)),"^",7)=Y XIT=1
90 . Q
91 Q XIT
92 ;
93EN2 ; For the HL7 Application Parameter (file 771) 'Radiology',
94 ; change the 'ORU' HL7 Message processing routine from RAHLO
95 ; to the new bridge routine RAHLBKVR.
96 N %,D,D0,DA,DI,DIC,DIE,DQ,DR,RA771,RA77106,RATXT,X
97 S RA771=+$$FIND1^DIC(771,"","X","RADIOLOGY")
98 I 'RA771 D Q ; Can't find 'Radiology' in file 771. Add to 771
99 . S RATXT(1)=""
100 . S RATXT(2)="Adding 'Radiology' to the HL7 Application Parameter file."
101 . S RATXT(3)="Set the 'ORU' HL7 Message Processing Routine field to the"
102 . S RATXT(4)="new bridge routine RAHLBKVR. Set the 'QRY' HL7 Message"
103 . S RATXT(5)="Processing Routine field to the new bridge routine"
104 . S RATXT(6)="RAHLBKVQ." D MES^XPDUTL(.RATXT)
105 . N RA771,RAFDA S RAFDA(771,"+1,",.01)="RADIOLOGY"
106 . S RAFDA(771,"+1,",2)="INACTIVE"
107 . S RAFDA(771.06,"+2,+1,",.01)="ACK"
108 . S RAFDA(771.06,"+3,+1,",.01)="ORF"
109 . S RAFDA(771.06,"+4,+1,",.01)="ORU"
110 . S RAFDA(771.06,"+4,+1,",1)="RAHLBKVR"
111 . S RAFDA(771.06,"+5,+1,",.01)="QRY"
112 . S RAFDA(771.06,"+5,+1,",1)="RAHLBKVQ"
113 . D UPDATE^DIE("E","RAFDA")
114 . S RA771=+$$FIND1^DIC(771,"","X","RADIOLOGY")
115 . I RA771 D Q
116 .. S ^HL(771,RA771,"EC")="~|\&" ; hard set the encoding char field
117 .. S ^HL(771,RA771,"FS")="^" ; hard set the field seperator field
118 .. Q
119 . ; Display error message, 'RADIOLOGY' was not filed!
120 . K RATXT S RATXT(1)=""
121 . S RATXT(2)="'RADIOLOGY' could not be added as a HL7 Application"
122 . S RATXT(3)="Parameter. IRM should investigate." D MES^XPDUTL(.RATXT)
123 . Q
124 ; The 'RADIOLOGY' entry exists, make sure the right fields are
125 ; populated with the right data.
126 S:$G(^HL(771,RA771,"EC"))'="~|\&" ^("EC")="~|\&" ; set encoding chars
127 S:$G(^HL(771,RA771,"FS"))'="~|\&" ^("FS")="^" ; set field seperator
128 S RA77106("ACK")=$$FIND("ACK")
129 I 'RA77106("ACK") D ADD("ACK")
130 I RA77106("ACK") D
131 . N RAFDA
132 . S RAFDA(771.06,RA77106("ACK")_","_RA771_",",1)="@" ;no processing rou
133 . D FILE^DIE("","RAFDA","")
134 . Q
135 ;
136 S RA77106("ORF")=$$FIND("ORF")
137 I 'RA77106("ORF") D ADD("ORF")
138 I RA77106("ORF") D
139 . N RAFDA
140 . S RAFDA(771.06,RA77106("ORF")_","_RA771_",",1)="@" ;no processing rou
141 . D FILE^DIE("","RAFDA","")
142 . Q
143 S RA77106("ORU")=+$$FIND1^DIC(771.06,","_RA771_",","X","ORU")
144 I 'RA77106("ORU") D ADD("ORU")
145 I RA77106("ORU") D
146 . N RAFDA S RAFDA(771.06,RA77106("ORU")_","_RA771_",",1)="RAHLBKVR"
147 . D FILE^DIE("","RAFDA","")
148 . Q
149 S RA77106("QRY")=+$$FIND1^DIC(771.06,","_RA771_",","X","QRY")
150 I 'RA77106("QRY") D ADD("QRY")
151 I RA77106("QRY") D
152 . N RAFDA S RAFDA(771.06,RA77106("QRY")_","_RA771_",",1)="RAHLBKVQ"
153 . D FILE^DIE("","RAFDA","")
154 . Q
155 Q
156ADD(X) ; Add the HL7 Message to the 'RADIOLOGY' entry on the HL7 Application
157 ; Parameter file.
158 ; Input: 'X'-the HL7 Message we are trying to add
159 ; Sets: RA77106('X')=the ien of the newly added HL7 Message
160 N RAFDA S RAFDA(771.06,"+1,"_RA771_",",.01)=X
161 D UPDATE^DIE("E","RAFDA") S RA77106(X)=$$FIND(X)
162 Q
163FIND(X) ; Find the ien of the various HL7 Messages used by our HL7 Application
164 ; Input: 'X'-the HL7 Message we are trying to find.
165 ; Output: ien of the HL7 Message entry (if exists), else 0
166 Q +$$FIND1^DIC(771.06,","_RA771_",","X",X)
Note: See TracBrowser for help on using the repository browser.