-
Notifications
You must be signed in to change notification settings - Fork 1
/
Elixhauser_ICD9_ICD10_coding.txt
315 lines (265 loc) · 18.6 KB
/
Elixhauser_ICD9_ICD10_coding.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
/*************************************************************************************************************************************************************/
/***************************************Elixhauser index *************************************/
/***********************************************************************************************************************************************************/
** ICD9 coding;
data ICD9_Elixhauser_conditions ;
set DM_all_diag1(keep=numscrssn DX_:);
by numscrssn;
array CONDITIONS (31) ICD9_ELIX_CHF ICD9_ELIX_CA ICD9_ELIX_VD ICD9_ELIX_PCD ICD9_ELIX_PVD
ICD9_ELIX_HU ICD9_ELIX_HC ICD9_ELIX_PARA ICD9_ELIX_OND ICD9_ELIX_CPD
ICD9_ELIX_DIABNC ICD9_ELIX_DIABC ICD9_ELIX_HTHY ICD9_ELIX_RF ICD9_ELIX_LD
ICD9_ELIX_PUD ICD9_ELIX_AIDS ICD9_ELIX_LYM ICD9_ELIX_MC ICD9_ELIX_STWTM
ICD9_ELIX_RACVD ICD9_ELIX_COAG ICD9_ELIX_OBE ICD9_ELIX_WL ICD9_ELIX_FED
ICD9_ELIX_BLA ICD9_ELIX_DA ICD9_ELIX_AA ICD9_ELIX_DAA ICD9_ELIX_PCH
ICD9_ELIX_DEP;
do i= 1 to 31;
if FIRST.numscrssn then CONDITIONS(i)=0;
retain CONDITIONS;
end;
array dxcode DX_1-DX_54;;
do over dxcode;
dx_3=substr(dxcode,1,3);
dx_4=substr(dxcode,1,4);
/*****congestive heart failure*********/
if dxcode in ('39891','40201','40211','40291','40401','40403','40411','40413','40491','40493') | '4254'<=dx_4<='4259' | dx_3='428'
then ICD9_ELIX_CHF=1;if ICD9_ELIX_CHF=. then ICD9_ELIX_CHF=0;
/****cardiac arrhythmias ************* */
if dx_4 in ('4260','4267','4269','7850','V450','V533') | dxcode in ('42613','42610','42612','99601','99604') | '4270'<=dx_4<='4274' | '4276'<=dx_4<='4279'
then ICD9_ELIX_CA=1;if ICD9_ELIX_CA=. then ICD9_ELIX_CA=0;
/**********Valvular disease**************/
if dx_4 in ('0932','V422','V433') | '7463'<=dx_4<='7466' | '394'<=dx_3<='397' | dx_3='424'
then ICD9_ELIX_VD=1;if ICD9_ELIX_VD=. then ICD9_ELIX_VD=0;
/**********Pulmonary circulation Disorder ********/
if dx_4 in ('4150','4151','4170','4178','4179') | dx_3='416'
then ICD9_ELIX_PCD=1;if ICD9_ELIX_PCD=. then ICD9_ELIX_PCD=0;
/**********Peripheral vascular disorders**********/
if dx_4 in ('0930','4373','4471','5571','5579','V434') | '4431'<=dx_4<='4439' |dx_3 in ('440','441')
then ICD9_ELIX_PVD=1;if ICD9_ELIX_PVD=. then ICD9_ELIX_PVD=0;
/**********Hypertension, uncomplicated************/
if dx_3='401' then ICD9_ELIX_HU=1;if ICD9_ELIX_HU=. then ICD9_ELIX_HU=0;
/**********Hypertension, complicated************/
if '402'<=dx_3<='405' then ICD9_ELIX_HC=1;if ICD9_ELIX_HC=. then ICD9_ELIX_HC=0;
/**********Paralysis****************************/
if '342'<=dx_3<='343'|dx_4 in ('3341','3449')|'3440'<=dx_4<='3446' then ICD9_ELIX_PARA=1;if ICD9_ELIX_PARA=. then ICD9_ELIX_PARA=0;
/**********Other Neurological disorder*********/
if dx_4 in ('3319','3320','3321','3334','3335','3362','3481','3483','7803','7843') | dxcode='33392'|dx_3 in ('340','341','345') | '334'<=dx_3<='335'
then ICD9_ELIX_OND=1;if ICD9_ELIX_OND=. then ICD9_ELIX_OND=0;
/**********Chronic pulmonary disease ***********/
if dx_4 in ('4168','4169','5064','5081','5088') | '490'<=dx_3<='505' then ICD9_ELIX_CPD=1;if ICD9_ELIX_CPD=. then ICD9_ELIX_CPD=0;
/******** DIABETES WITHOUT COMPLICATION *****************/
if '2500'<=dx_4<='2503' then ICD9_ELIX_DIABNC=1;if ICD9_ELIX_DIABNC=. then ICD9_ELIX_DIABNC=0;
/********* DIABETES WITH COMPLICATION ****** WEIGHT=2 *********/
if ('2504'<=dx_4<='2509') then ICD9_ELIX_DIABC=1;if ICD9_ELIX_DIABC=. then ICD9_ELIX_DIABC=0;
/********* Hypothyroidism**************************************/
if dx_4 in ('2409','2461','2468') | dx_3 in ('243','244') then ICD9_ELIX_HTHY=1;if ICD9_ELIX_HTHY=. then ICD9_ELIX_HTHY=0;
/********* Renal Failure ***************************************/
if dxcode in ('40301','40311','40391','40402','40403','40412','40413','40492','40493') | dx_3 in ('585','586','V56') | dx_4 in ('5880','V420','V451')
then ICD9_ELIX_RF=1;if ICD9_ELIX_RF=. then ICD9_ELIX_RF=0;
/*********Liver Disease***************************************/
if dxcode in ('07022','07023','07032','07033','07044','07054') | '570'<=dx_3<='571' | dx_4 in ('0706','0709','5733','5734','5738','5739','V427') |
('5722'<=dx_4<='5728')|('4560'<=dx_4<='4561')|dxcode in('4562 ','45620','45621')
then ICD9_ELIX_LD=1;if ICD9_ELIX_LD=. then ICD9_ELIX_LD=0;
/*********Peptic ulver disease excluding bleeding **************/
if dx_4 in ('5317','5319','5327','5329','5337','5339','5347','5349') then ICD9_ELIX_PUD=1;if ICD9_ELIX_PUD=. then ICD9_ELIX_PUD=0;
/*********AIDS/H1V***********************************************/
if '042'<=dx_3<='044' then ICD9_ELIX_AIDS=1;if ICD9_ELIX_AIDS=. then ICD9_ELIX_AIDS=0;
/***********Lymphoma******************/
if '200'<=dx_3<='202' | dx_4 in ('2030','2386') then ICD9_ELIX_LYM=1;if ICD9_ELIX_LYM=. then ICD9_ELIX_LYM=0;
/********************Metastatic cancer ********************/
if '196'<=dx_3<='199' then ICD9_ELIX_MC=1;if ICD9_ELIX_MC=. then ICD9_ELIX_MC=0;
/********************Solid tumor without metastasis***********/
if '140'<=dx_3<='172' | '174'<=dx_3<='195' then ICD9_ELIX_STWTM=1;if ICD9_ELIX_STWTM=. then ICD9_ELIX_STWTM=0;
/*************Rheumatoid arthritis/Collagen vascular disease************/
if dx_3 in ('446','714','720','725') | dx_4 in ('7010', '7108','7109','7112','7193','7285') | '7100'<=dx_4<='7104' |dxcode in ('72889','72930')
then ICD9_ELIX_RACVD=1;if ICD9_ELIX_RACVD=. then ICD9_ELIX_RACVD=0;
/*************Coagulopathy*************************************/
if dx_3='286' | dx_4='2871' |'2873'<=dx_4<='2875' then ICD9_ELIX_COAG=1;if ICD9_ELIX_COAG=. then ICD9_ELIX_COAG=0;
/*************OBesity*****************************************/
if dx_4='2780' then ICD9_ELIX_OBE=1;if ICD9_ELIX_OBE=. then ICD9_ELIX_OBE=0;
/*************Weight LOSS*************************************/
if '260'<=dx_3<='263' | dx_4 in ('7832','7994') then ICD9_ELIX_WL=1;if ICD9_ELIX_WL=. then ICD9_ELIX_WL=0;
/**************Fluid and electrolyte disorders********************/
if dx_4='2536' | dx_3='276' then ICD9_ELIX_FED=1;if ICD9_ELIX_FED=. then ICD9_ELIX_FED=0;
/*************Blood Loss Anemia***********************************/
if dx_4='2880' then ICD9_ELIX_BLA=1;if ICD9_ELIX_BLA=. then ICD9_ELIX_BLA=0;
/*************Deficiency anemia***********************************/
if '2801'<=dx_4<='2809' |dx_3='281' then ICD9_ELIX_DA=1;if ICD9_ELIX_DA=. then ICD9_ELIX_DA=0;
/*************Alcohol Abuse***************************************/
if dx_4 in ('2652','3030','3039','3050','3575','4255','5353','V113') | '2911'<=dx_4<='2913' | '2915'<=dx_4<='2919' | '5710'<=dx_4<='5713'
then ICD9_ELIX_AA=1;if ICD9_ELIX_AA=. then ICD9_ELIX_AA=0;
/*************Drug Abuse******************************************/
if dx_3 in ('292','304') | '3052'<=dx_4<='3059' | dxcode='V6542' then ICD9_ELIX_DAA=1;if ICD9_ELIX_DAA=. then ICD9_ELIX_DAA=0;
/************PSYchoses *******************************************/
if dx_4='2938' | dx_3 in ('295','297','298') | dxcode in ('29604','29614','29644','29654') then ICD9_ELIX_PCH=1;if ICD9_ELIX_PCH=. then ICD9_ELIX_PCH=0;
/************Depression*******************************************/
if dx_4 in ('2962','2963','2965','3004') |dx_3 in ('309','311') then ICD9_ELIX_DEP=1; if ICD9_ELIX_DEP=. then ICD9_ELIX_DEP=0;
if LAST.numscrssn;
end;
drop i dx_3 dx_4;
proc sort ;
by numscrssn;
run;
proc freq data=ICD9_Elixhauser_conditions;table ICD9_ELIX:;run;
*** ICD10 coding;
data ICD10_Elixhauser_conditions ;
set DM_all_diag1(keep=numscrssn DX_:);
by numscrssn;
array CONDITIONS (31) ICD10_ELIX_CHF ICD10_ELIX_CA ICD10_ELIX_VD ICD10_ELIX_PCD ICD10_ELIX_PVD
ICD10_ELIX_HU ICD10_ELIX_HC ICD10_ELIX_PARA ICD10_ELIX_OND ICD10_ELIX_CPD
ICD10_ELIX_DIABNC ICD10_ELIX_DIABC ICD10_ELIX_HTHY ICD10_ELIX_RF ICD10_ELIX_LD
ICD10_ELIX_PUD ICD10_ELIX_AIDS ICD10_ELIX_LYM ICD10_ELIX_MC ICD10_ELIX_STWTM
ICD10_ELIX_RACVD ICD10_ELIX_COAG ICD10_ELIX_OBE ICD10_ELIX_WL ICD10_ELIX_FED
ICD10_ELIX_BLA ICD10_ELIX_DA ICD10_ELIX_AA ICD10_ELIX_DAA ICD10_ELIX_PCH
ICD10_ELIX_DEP;
do i= 1 to 31;
if FIRST.numscrssn then CONDITIONS(i)=0;
retain CONDITIONS;
end;
array dxcode DX_1-DX_54;;
do over dxcode;
dx_3=substr(dxcode,1,3);
dx_4=substr(dxcode,1,4);
/*****congestive heart failure*********/
if dx_4 in ('I099','I110','I130','I132','I255','I420','P290') | 'I425'<=dx_4<='I429' | dx_3 in ('I43', 'I50')
then ICD10_ELIX_CHF=1;if ICD10_ELIX_CHF=. then ICD10_ELIX_CHF=0;
/****cardiac arrhythmias ************* */
if dx_4 in ('I456','I459','R000','R001','R008','T821','Z450','Z950') | 'I441'<=dx_4<='I443' | 'I47'<=dx_3<='I49'
then ICD10_ELIX_CA=1;if ICD10_ELIX_CA=. then ICD10_ELIX_CA=0;
/**********Valvular disease**************/
if dx_4 in ('A520','I091','I098','Z952','Z954') | 'Q230'<=dx_4<='Q233' | 'I05'<=dx_3<='I08' | 'I34'<=dx_3<='I39'
then ICD10_ELIX_VD=1;if ICD10_ELIX_VD=. then ICD10_ELIX_VD=0;
/**********Pulmonary circulation Disorder ********/
if dx_4 in ('I280','I288','I289') | dx_3 in ('I26','I27')
then ICD10_ELIX_PCD=1;if ICD10_ELIX_PCD=. then ICD10_ELIX_PCD=0;
/**********Peripheral vascular disorders**********/
if dx_4 in ('I731','I738','I739','I771','I790','I792','K551','K558','K559','Z958','Z959') | dx_3 in ('I70','I71')
then ICD10_ELIX_PVD=1;if ICD10_ELIX_PVD=. then ICD10_ELIX_PVD=0;
/**********Hypertension, uncomplicated************/
if dx_3='I10' then ICD10_ELIX_HU=1;if ICD10_ELIX_HU=. then ICD10_ELIX_HU=0;
/**********Hypertension, complicated************/
if 'I11'<=dx_3<='I13' |dx_3='I15' then ICD10_ELIX_HC=1;if ICD10_ELIX_HC=. then ICD10_ELIX_HC=0;
/**********Paralysis****************************/
if 'G830'<=dx_4<='G834'|dx_4 in ('G041','G114','G801','G802','G839')|dx_3 in ('G81','G82') then ICD10_ELIX_PARA=1;if ICD10_ELIX_PARA=. then ICD10_ELIX_PARA=0;
/**********Other Neurological disorder*********/
if dx_4 in ('G254','G255','G312','G318','G319','G931','G934','R470')|dx_3 in ('G40','G41','R56') | 'G10'<=dx_3<='G13' | 'G20'<=dx_3<='G22' | 'G35'<=dx_3<='G37'
then ICD10_ELIX_OND=1;if ICD10_ELIX_OND=. then ICD10_ELIX_OND=0;
/**********Chronic pulmonary disease ***********/
if dx_4 in ('I278','I279','J684','J701','J703') | 'J40'<=dx_3<='J47' |'J60'<=dx_3<='J67' then ICD10_ELIX_CPD=1;if ICD10_ELIX_CPD=. then ICD10_ELIX_CPD=0;
/******** DIABETES WITHOUT COMPLICATION *****************/
if dx_4 in ('E100','E101','E109','E110','E111','E119','E120','E121','E129','E130','E131','E139','E140','E141','E149')
then ICD10_ELIX_DIABNC=1;if ICD10_ELIX_DIABNC=. then ICD10_ELIX_DIABNC=0;
/********* DIABETES WITH COMPLICATION ****** WEIGHT=2 *********/
if 'E102'<=dx_4<='E108' | 'E112'<=dx_4<='E118' | 'E122'<=dx_4<='E128' |'E132'<=dx_4<='E138' |'E142'<=dx_4<='E148'
then ICD10_ELIX_DIABC=1;if ICD10_ELIX_DIABC=. then ICD10_ELIX_DIABC=0;
/********* Hypothyroidism**************************************/
if 'E00'<=dx_3<='E03' | dx_4='E890' then ICD10_ELIX_HTHY=1;if ICD10_ELIX_HTHY=. then ICD10_ELIX_HTHY=0;
/********* Renal Failure ***************************************/
if dx_4 in ('I120','I131','N250','Z940','Z992') | dx_3 in ('N18','N19') | 'Z490'<=dx_4<='Z492'
then ICD10_ELIX_RF=1;if ICD10_ELIX_RF=. then ICD10_ELIX_RF=0;
/*********Liver Disease***************************************/
if dx_3 in ('B18','I85','K70') | 'K72'<=dx_3<='K74' | dx_4 in ('I864','I982','K711','K717','K760','Z944')|'K713'<=dx_4<='K715'|'K762'<=dx_4<='K769'
then ICD10_ELIX_LD=1;if ICD10_ELIX_LD=. then ICD10_ELIX_LD=0;
/*********Peptic ulver disease excluding bleeding **************/
if dx_4 in ('K257','K259','K267','K269','K277','K279','K287','K289') then ICD10_ELIX_PUD=1;if ICD10_ELIX_PUD=. then ICD10_ELIX_PUD=0;
/*********AIDS/H1V***********************************************/
if 'B20'<=dx_3<='B22' | dx_3='B24' then ICD10_ELIX_AIDS=1;if ICD10_ELIX_AIDS=. then ICD10_ELIX_AIDS=0;
/***********Lymphoma******************/
if 'C81'<=dx_3<='C85' | dx_3 in ('C88','C96') | dx_4 in ('C900','C902') then ICD10_ELIX_LYM=1;if ICD10_ELIX_LYM=. then ICD10_ELIX_LYM=0;
/********************Metastatic cancer ********************/
if 'C77'<=dx_3<='C80' then ICD10_ELIX_MC=1;if ICD10_ELIX_MC=. then ICD10_ELIX_MC=0;
/********************Solid tumor without metastasis***********/
if 'C00'<=dx_3<='C26' | 'C30'<=dx_3<='C34' | 'C37'<=dx_3<='C41' | 'C45'<=dx_3<='C58'| 'C60'<=dx_3<='C76' | dx_3 in ('C43','C97')
then ICD10_ELIX_STWTM=1;if ICD10_ELIX_STWTM=. then ICD10_ELIX_STWTM=0;
/*************Rheumatoid arthritis/Collagen vascular disease************/
if dx_3 in ('M05','M06','M08','M30','M45') | dx_4 in ('L940', 'L941','L943','M120','M123','M461','M468','M469') | 'M310'<=dx_4<='M313' |'M32'<=dx_3<='M35'
then ICD10_ELIX_RACVD=1;if ICD10_ELIX_RACVD=. then ICD10_ELIX_RACVD=0;
/*************Coagulopathy*************************************/
if 'D65'<=dx_3='D68' | dx_4='D691' |'D693'<=dx_4<='D696' then ICD10_ELIX_COAG=1;if ICD10_ELIX_COAG=. then ICD10_ELIX_COAG=0;
/*************OBesity*****************************************/
if dx_3='E66' then ICD10_ELIX_OBE=1;if ICD10_ELIX_OBE=. then ICD10_ELIX_OBE=0;
/*************Weight LOSS*************************************/
if 'E40'<=dx_3<='E46' | dx_4 ='R634' | dx_3='R64' then ICD10_ELIX_WL=1;if ICD10_ELIX_WL=. then ICD10_ELIX_WL=0;
/**************Fluid and electrolyte disorders********************/
if dx_4='E222' | dx_3 in ('E86','E87') then ICD10_ELIX_FED=1;if ICD10_ELIX_FED=. then ICD10_ELIX_FED=0;
/*************Blood Loss Anemia***********************************/
if dx_4='D500' then ICD10_ELIX_BLA=1;if ICD10_ELIX_BLA=. then ICD10_ELIX_BLA=0;
/*************Deficiency anemia***********************************/
if dx_4 in ('D508','D509') | 'D51'<=dx_3<='D53' then ICD10_ELIX_DA=1;if ICD10_ELIX_DA=. then ICD10_ELIX_DA=0;
/*************Alcohol Abuse***************************************/
if dx_3 in ('F10','E52','T51') | dx_4 in ('G621','I426','K292','K700','K703','K709','Z502','Z714','Z721')
then ICD10_ELIX_AA=1;if ICD10_ELIX_AA=. then ICD10_ELIX_AA=0;
/*************Drug Abuse******************************************/
if dx_3 in ('F18','F19') | 'F11'<=dx_3<='F16' | dx_4 in ('Z715','Z722') then ICD10_ELIX_DAA=1;if ICD10_ELIX_DAA=. then ICD10_ELIX_DAA=0;
/************PSYchoses *******************************************/
if dx_3 in ('F20','F28','F29') | 'F22'<=dx_3<='F25' | dx_4 in ('F302','F312','F315') then ICD10_ELIX_PCH=1;if ICD10_ELIX_PCH=. then ICD10_ELIX_PCH=0;
/************Depression*******************************************/
if dx_4 in ('F204','F341','F412','F432') |dx_3 in ('F32','F33') | 'F313'<=dx_4<='F315' then ICD10_ELIX_DEP=1; if ICD10_ELIX_DEP=. then ICD10_ELIX_DEP=0;
if LAST.numscrssn;
end;
drop i dx_3 dx_4;
proc sort ;
by numscrssn;
run;
proc freq data=ICD10_Elixhauser_conditions;table ICD10_ELIX:;run;
**merge all the Elixhauser indicators from ICD9 and ICD10 together;
proc sort data=data.cohort_8 out=cohort(keep=numscrssn);by numscrssn;
data Elixhauser_conditions;
merge cohort ICD9_Elixhauser_conditions(keep=numscrssn ICD9:) ICD10_Elixhauser_conditions(keep=numscrssn ICD10:);
by numscrssn;
array cond _numeric;
do over cond;
if cond=. then cond=0;
end;
if ICD9_ELIX_CHF=1 or ICD10_ELIX_CHF=1 then ELIX_CHF =1; else ELIX_CHF=0;
if ICD9_ELIX_CA=1 or ICD10_ELIX_CA=1 then ELIX_CA =1; else ELIX_CA=0;
if ICD9_ELIX_VD=1 or ICD10_ELIX_VD=1 then ELIX_VD =1; else ELIX_VD=0;
if ICD9_ELIX_PCD=1 or ICD10_ELIX_PCD=1 then ELIX_PCD =1; else ELIX_PCD=0;
if ICD9_ELIX_PVD=1 or ICD10_ELIX_PVD=1 then ELIX_PVD =1; else ELIX_PVD=0;
if ICD9_ELIX_HU=1 or ICD10_ELIX_HU=1 then ELIX_HU =1; else ELIX_HU=0;
if ICD9_ELIX_HC=1 or ICD10_ELIX_HC=1 then ELIX_HC =1; else ELIX_HC=0;
if ICD9_ELIX_PARA=1 or ICD10_ELIX_PARA=1 then ELIX_PARA =1; else ELIX_PARA=0;
if ICD9_ELIX_OND=1 or ICD10_ELIX_OND=1 then ELIX_OND =1; else ELIX_OND=0;
if ICD9_ELIX_CPD=1 or ICD10_ELIX_CPD=1 then ELIX_CPD =1; else ELIX_CPD=0;
if ICD9_ELIX_DIABNC=1 or ICD10_ELIX_DIABNC=1 then ELIX_DIABNC =1; else ELIX_DIABNC=0;
if ICD9_ELIX_DIABC=1 or ICD10_ELIX_DIABC=1 then ELIX_DIABC =1; else ELIX_DIABC=0;
if ICD9_ELIX_HTHY=1 or ICD10_ELIX_HTHY=1 then ELIX_HTHY =1; else ELIX_HTHY=0;
if ICD9_ELIX_RF=1 or ICD10_ELIX_RF=1 then ELIX_RF =1; else ELIX_RF=0;
if ICD9_ELIX_LD=1 or ICD10_ELIX_LD=1 then ELIX_LD =1; else ELIX_LD=0;
if ICD9_ELIX_PUD=1 or ICD10_ELIX_PUD=1 then ELIX_PUD =1; else ELIX_PUD=0;
if ICD9_ELIX_AIDS=1 or ICD10_ELIX_AIDS=1 then ELIX_AIDS =1; else ELIX_AIDS=0;
if ICD9_ELIX_LYM=1 or ICD10_ELIX_LYM=1 then ELIX_LYM =1; else ELIX_LYM=0;
if ICD9_ELIX_MC=1 or ICD10_ELIX_MC=1 then ELIX_MC =1; else ELIX_MC=0;
if ICD9_ELIX_STWTM=1 or ICD10_ELIX_STWTM=1 then ELIX_STWTM =1; else ELIX_STWTM=0;
if ICD9_ELIX_RACVD=1 or ICD10_ELIX_RACVD=1 then ELIX_RACVD =1; else ELIX_RACVD=0;
if ICD9_ELIX_COAG=1 or ICD10_ELIX_COAG=1 then ELIX_COAG =1; else ELIX_COAG=0;
if ICD9_ELIX_OBE=1 or ICD10_ELIX_OBE=1 then ELIX_OBE =1; else ELIX_OBE=0;
if ICD9_ELIX_WL=1 or ICD10_ELIX_WL=1 then ELIX_WL =1; else ELIX_WL=0;
if ICD9_ELIX_FED=1 or ICD10_ELIX_FED=1 then ELIX_FED =1; else ELIX_FED=0;
if ICD9_ELIX_BLA=1 or ICD10_ELIX_BLA=1 then ELIX_BLA =1; else ELIX_BLA=0;
if ICD9_ELIX_DA=1 or ICD10_ELIX_DA=1 then ELIX_DA =1; else ELIX_DA=0;
if ICD9_ELIX_AA=1 or ICD10_ELIX_AA=1 then ELIX_AA =1; else ELIX_AA=0;
if ICD9_ELIX_DAA=1 or ICD10_ELIX_DAA=1 then ELIX_DAA =1; else ELIX_DAA=0;
if ICD9_ELIX_PCH=1 or ICD10_ELIX_PCH=1 then ELIX_PCH =1; else ELIX_PCH=0;
if ICD9_ELIX_DEP=1 or ICD10_ELIX_DEP=1 then ELIX_DEP =1; else ELIX_DEP=0;
run;
data Elixhauser_index;
set Elixhauser_conditions;
Elixhauser= (ELIX_CHF*7)+ (ELIX_CA*5)+ (ELIX_VD*(-1))+ (ELIX_PCD*4)+(ELIX_PVD*2)
+(ELIX_HU*0)+(ELIX_HC*0)+ (ELIX_PARA*7) + (ELIX_OND*6)+(ELIX_CPD*3)
+(ELIX_DIABNC*0)+ (ELIX_DIABC*0)+ (ELIX_HTHY*0) +(ELIX_RF*5) + (ELIX_LD*11)
+(ELIX_PUD *0) + (ELIX_AIDS*0) + (ELIX_LYM *9) + (ELIX_MC *12) + (ELIX_STWTM*4)
+(ELIX_RACVD*0)+(ELIX_COAG*3) +(ELIX_OBE*(-4))+(ELIX_WL*6)+ (ELIX_FED*5)
+(ELIX_BLA*(-2))+(ELIX_DA*(-2))+ (ELIX_AA*0)+ (ELIX_DAA*(-7))+(ELIX_PCH*0)
+(ELIX_DEP*(-3));
run;
proc sql;
create table Elixhauser_variables as
select numscrssn, ELIX_CHF, ELIX_CA, ELIX_VD, ELIX_PCD, ELIX_PVD, ELIX_HU, ELIX_HC, ELIX_PARA, ELIX_OND, ELIX_CPD, ELIX_DIABNC, ELIX_DIABC,
ELIX_HTHY, ELIX_RF, ELIX_LD, ELIX_PUD, ELIX_AIDS, ELIX_LYM, ELIX_MC, ELIX_STWTM, ELIX_RACVD, ELIX_COAG, ELIX_OBE, ELIX_WL,
ELIX_FED, ELIX_BLA, ELIX_DA, ELIX_AA, ELIX_DAA, ELIX_PCH, ELIX_DEP, Elixhauser
from Elixhauser_index;
quit;
proc freq data=Elixhauser_variables;table Elixhauser;run;
proc means data=Elixhauser_index N Min Mean Median Std Max maxdec=1;
var Elixhauser;
run;