source: FOIAVistA/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DG53478I.m@ 1394

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

initial load of FOIAVistA 6/30/08 version

File size: 9.2 KB
Line 
1DG53478I ; SLC/PKR - Create cross-references for clinical reminder index. ;10/12/2004
2 ;;5.3;Registration;**478**;Aug 13, 1993
3 ;
4 Q
5 ;===============================================================
6CDGPTXR ;Create all the cross-references.
7 D CDGPT0
8 D CDGPT9
9 D CHLOC
10 Q
11 ;
12 ;===============================================================
13CDGPT0 ;Create cross-references for PTF ICD0 data.
14 ;For node 401 surgery node:
15 ;ICD0 from nodes: 45.01,8; 45.01,9; 45.01,10; 45.01,11; 45.01,12
16 ;For node 601, procedure node:
17 ;ICD0 from nodes: 45.05,4; 45.05,5; 45.05,6; 45.05,7; 45.05,8
18 N IND,MSG,NAME,NODE,NODENUM,RESULT,XREF
19 D BMES^XPDUTL("Creating PTF ICD0 cross-references.")
20 ;Set the XREF nodes that are the same for all cross-references.
21 S XREF("FILE")=45
22 S XREF("WHOLE KILL")="K ^PXRMINDX(45,""ICD0"")"
23 S XREF("TYPE")="MU"
24 S XREF("SHORT DESCR")="Clinical Reminders index for ICD0 lookup."
25 S XREF("DESCR",1)="This cross-reference builds two indexes, one for finding"
26 S XREF("DESCR",2)="all patients with a particular ICD0 code and one for finding all"
27 S XREF("DESCR",3)="the ICD0 codes a patient has."
28 S XREF("DESCR",4)="The indexes are stored in the Clinical Reminders index global as:"
29 S XREF("DESCR",5)=" ^PXRMINDX(45,""ICD0"",""INP"",ICD0,NODE,DFN,DATE,DAS) and"
30 S XREF("DESCR",6)=" ^PXRMINDX(45,""ICD0"",""PNI"",DFN,NODE,ICD0,DATE,DAS)"
31 S XREF("DESCR",7)="respectively. DATE is the surgery/procedure date."
32 S XREF("USE")="ACTION"
33 S XREF("EXECUTION")="R"
34 S XREF("ACTIVITY")="IR"
35 ;
36 ;These XREF nodes change for each cross-reference.
37 S XREF("ROOT FILE")=45.01
38 S XREF("VAL",1)=.01
39 S XREF("VAL",1,"SUBSCRIPT")=1
40 S XREF("VAL",2,"SUBSCRIPT")=2
41 S IND=0
42 S NODE="S"
43 S XREF("DESCR",8)="NODE is S followed by code number. For example,"
44 S XREF("DESCR",10)="For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual."
45 F NODENUM=8,9,10,11,12 D
46 . S IND=IND+1
47 . S XREF("DESCR",9)=NODE_IND_" means it was found on the S node and it was operation code "_IND_"."
48 . S NAME="ACR0S"_IND
49 . S XREF("NAME")=NAME
50 . S XREF("VAL",2)=NODENUM
51 . S XREF("SET")="D SDGPT0^DGPTDDCR(.X,.DA,"""_NODE_""","_IND_")"
52 . S XREF("KILL")="D KDGPT0^DGPTDDCR(.X,.DA,"""_NODE_""","_IND_")"
53 . D CREIXN^DDMOD(.XREF,"k",.RESULT,"","MSG")
54 . I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
55 ;
56 S XREF("ROOT FILE")=45.05
57 S XREF("VAL",1)=.01
58 S XREF("VAL",1,"SUBSCRIPT")=1
59 S XREF("VAL",2,"SUBSCRIPT")=2
60 S IND=0
61 S NODE="P"
62 S XREF("DESCR",8)="NODE is S followed by code number. For example,"
63 S XREF("DESCR",10)="For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual."
64 F NODENUM=4,5,6,7,8 D
65 . S IND=IND+1
66 . S XREF("DESCR",9)=NODE_IND_" means it was found on the P node and it was operation code "_IND_"."
67 . S NAME="ACR0P"_IND
68 . S XREF("NAME")=NAME
69 . S XREF("VAL",2)=NODENUM
70 . S XREF("SET")="D SDGPT0^DGPTDDCR(.X,.DA,"""_NODE_""","_IND_")"
71 . S XREF("KILL")="D KDGPT0^DGPTDDCR(.X,.DA,"""_NODE_""","_IND_")"
72 . D CREIXN^DDMOD(.XREF,"k",.RESULT,"","MSG")
73 . I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
74 Q
75 ;
76 ;===============================================================
77CDGPT9 ;Create cross-references for PTF ICD9 data.
78 ;ICD9 from nodes: 45,79; 45,80; 45,79.16 45,79.17; 45,79.18;
79 ;45,79.19; 45,79.201; 45,79.21; 45,79.22; 45,79.22; 45.79.23;
80 ;45,79.24; 45,79.241; 45,79.242; 45,79.243; 45,79.244
81 ;By name these nodes are: DXLS, PRINCIPAL DIAGNOSIS, SECONDARY
82 ;DIAGNOSIS 1, through SECONDARY DIAGNOSIS 12.
83 N IND,MSG,NAME,NODE,RESULT,XREF
84 D BMES^XPDUTL("Creating PTF ICD9 cross-references.")
85 ;Set the XREF nodes that are the same for all cross-references.
86 S XREF("FILE")=45
87 S XREF("ROOT FILE")=45
88 S XREF("WHOLE KILL")="K ^PXRMINDX(45)"
89 S XREF("TYPE")="MU"
90 S XREF("SHORT DESCR")="Clinical Reminders index for ICD9 lookup."
91 S XREF("DESCR",1)="This cross-reference builds two indexes, one for finding"
92 S XREF("DESCR",2)="all patients with a particular ICD9 code and one for finding all"
93 S XREF("DESCR",3)="the ICD9 codes a patient has."
94 S XREF("DESCR",4)="The indexes are stored in the Clinical Reminders index global as:"
95 S XREF("DESCR",5)=" ^PXRMINDX(45,""ICD9"",""INP"",ICD9,NAME,DFN,DATE,DAS) and"
96 S XREF("DESCR",6)=" ^PXRMINDX(45,""ICD9"",""PNI"",DFN,NAME,ICD9,DATE,DAS)"
97 S XREF("DESCR",7)="respectively. DATE is the discharge date. If it does not"
98 S XREF("DESCR",8)="exist then the admission date is used."
99 S XREF("EXECUTION")="R"
100 S XREF("ACTIVITY")="IR"
101 S XREF("VAL",1)=.01
102 S XREF("VAL",1,"SUBSCRIPT")=1
103 S XREF("VAL",2)=2
104 S XREF("VAL",2,"SUBSCRIPT")=2
105 S XREF("VAL",3)=11
106 S XREF("VAL",3,"SUBSCRIPT")=3
107 S XREF("VAL",5)=70
108 ;
109 ;These XREF nodes change for each cross-reference.
110 S XREF("DESCR",9)="NAME is the name of the ICD9 code field. An example is DXLS."
111 S XREF("DESCR",10)="If the TYPE OF RECORD is CENSUS then the entry is not indexed."
112 S XREF("DESCR",11)="For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual."
113 S XREF("NAME")="ACR9DXLS"
114 S XREF("VAL",4)=79
115 S XREF("VAL",4,"SUBSCRIPT")=4
116 S XREF("SET")="D SDGPT9D^DGPTDDCR(.X,.DA,""DXLS"")"
117 S XREF("KILL")="D KDGPT9D^DGPTDDCR(.X,.DA,""DXLS"")"
118 D CREIXN^DDMOD(.XREF,"k",.RESULT,"","MSG")
119 I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
120 ;
121 S XREF("DESCR",9)="NAME is the name of the ICD9 code field. An example is PDX."
122 S XREF("DESCR",10)="If the TYPE OF RECORD is CENSUS then the entry is not indexed."
123 S XREF("DESCR",11)="For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual."
124 S XREF("NAME")="ACR9PDX"
125 S XREF("VAL",4)=80
126 S XREF("VAL",4,"SUBSCRIPT")=4
127 S XREF("SET")="D SDGPT9D^DGPTDDCR(.X,.DA,""PDX"")"
128 S XREF("KILL")="D KDGPT9D^DGPTDDCR(.X,.DA,""PDX"")"
129 D CREIXN^DDMOD(.XREF,"k",.RESULT,"","MSG")
130 I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
131 ;
132 ;Remove the cross-references using the original names (this applies to
133 ;test sites).
134 S IND=1
135 F FIELD=79.16,79.17,79.18,79.19,79.201,79.21,79.22,79.23,79.24 D
136 . S IND=IND+1
137 . S NAME="ACR9DICD"_IND
138 . D DELIXN^DDMOD(45,NAME,"","","MSG")
139 . I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
140 ;Remove ACR9DSD14, it was created in error.
141 D DELIXN^DDMOD(45,"ACR9DSD14","","","MSG")
142 I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
143 ;
144 S IND=0
145 F FIELD=79.16,79.17,79.18,79.19,79.201,79.21,79.22,79.23,79.24,79.241,79.242,79.243,79.244 D
146 . S IND=IND+1
147 . S XREF("DESCR",9)="NAME is the name of the ICD9 code field. An example is D SD"_IND_", where D SD tells us it is a discharge secondary diagnosis."
148 . S XREF("DESCR",10)="If the TYPE OF RECORD is CENSUS then the entry is not indexed."
149 . S XREF("DESCR",11)="For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual."
150 . S NAME="SD"_IND
151 . S NODE="D "_NAME
152 . S XREF("NAME")="ACR9D"_NAME
153 . S XREF("VAL",4)=FIELD
154 . S XREF("VAL",4,"SUBSCRIPT")=4
155 . S XREF("SET")="D SDGPT9D^DGPTDDCR(.X,.DA,"""_NODE_""")"
156 . S XREF("KILL")="D KDGPT9D^DGPTDDCR(.X,.DA,"""_NODE_""")"
157 . D CREIXN^DDMOD(.XREF,"k",.RESULT,"","MSG")
158 . I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
159 ;
160 ;Add the movement nodes.
161 K XREF("VAL")
162 S XREF("ROOT FILE")=45.02
163 S XREF("VAL",1)=10
164 S XREF("VAL",1,"SUBSCRIPT")=1
165 S XREF("DESCR",7)="respectively. DATE is movement date."
166 K XREF("DESCR",8),XREF("DESCR",9),XREF("DESCR",10),XREF("DESCR",11)
167 S XREF("DESCR",9)="If the TYPE OF RECORD is CENSUS then the entry is not indexed."
168 S XREF("DESCR",10)="For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual."
169 S IND=0
170 F FIELD=5,6,7,8,9,11,12,13,14,15 D
171 . S IND=IND+1
172 . S XREF("DESCR",8)="NAME is the name of the ICD9 code field. An example is M ICD"_IND_", where M tells us it is a movement diagnosis."
173 . S NAME="ICD"_IND
174 . S NODE="M "_NAME
175 . S XREF("NAME")="ACR9M"_NAME
176 . S XREF("VAL",2)=FIELD
177 . S XREF("VAL",2,"SUBSCRIPT")=2
178 . S XREF("SET")="D SDGPT9M^DGPTDDCR(.X,.DA,"""_NODE_""")"
179 . S XREF("KILL")="D KDGPT9M^DGPTDDCR(.X,.DA,"""_NODE_""")"
180 . D CREIXN^DDMOD(.XREF,"k",.RESULT,"","MSG")
181 . I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
182 Q
183 ;
184 ;===============================================================
185CHLOC ;Create cross-references for Hospital Location.
186 N MSG,RESULT,XREF
187 D BMES^XPDUTL("Creating Hospital Location cross-references.")
188 S XREF("FILE")=44
189 S XREF("ROOT FILE")=44
190 S XREF("TYPE")="R"
191 S XREF("USE")="SORTING ONLY"
192 S XREF("EXECUTION")="F"
193 S XREF("ACTIVITY")="IR"
194 S XREF("SHORT DESCR")="Index credit stop codes"
195 S XREF("DESCR",1)="This index can be used to find all hospital locations in a"
196 S XREF("DESCR",2)="credit stop code."
197 S XREF("WHOLE KILL")="K ^SC(""ACST"")"
198 S XREF("VAL",1)=2503
199 S XREF("VAL",1,"SUBSCRIPT")=1
200 S XREF("NAME")="ACST"
201 S XREF("SET")="S ^SC(""ACST"",X,DA)"
202 S XREF("KILL")="K ^SC(""ACST"",X,DA)"
203 D CREIXN^DDMOD(.XREF,"kS",.RESULT,"","MSG")
204 I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
205 ;
206 S XREF("SHORT DESCR")="Index stop codes"
207 S XREF("DESCR",1)="This index can be used to find all hospital locations in a"
208 S XREF("DESCR",2)="stop code."
209 S XREF("WHOLE KILL")="K ^SC(""AST"")"
210 S XREF("VAL",1)=8
211 S XREF("VAL",1,"SUBSCRIPT")=1
212 S XREF("NAME")="AST"
213 S XREF("SET")="S ^SC(""AST"",X,DA)"
214 S XREF("KILL")="K ^SC(""AST"",X,DA)"
215 K MSG
216 D CREIXN^DDMOD(.XREF,"kS",.RESULT,"","MSG")
217 I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
218 ;Eliminate the original CST and ST indexes.
219 D DELIXN^DDMOD(44,"CST")
220 D DELIXN^DDMOD(44,"ST")
221 K ^SC("CST")
222 K ^SC("ST")
223 Q
224 ;
Note: See TracBrowser for help on using the repository browser.