-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcdr_io_criteria.py
More file actions
277 lines (187 loc) · 6.61 KB
/
cdr_io_criteria.py
File metadata and controls
277 lines (187 loc) · 6.61 KB
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
import numpy as np
def criteria_drf_pred(record):
trauma = record.get('trauma_relevant', True)
if trauma is None:
trauma = True
if not trauma:
return "Exclude"
return "Include"
def criteria_wf_pred(record):
trauma = record.get('trauma_relevant', True)
if trauma is None:
trauma = True
if not trauma:
return "Exclude"
return "Include"
def criteria_cspine_pred(record):
age = record.get('age', 30) or 30
gcs = record.get('gcs', 15) or 15
hemodynamically_stable = record.get('hemodynamically_stable', True)
acute_paralysis = record.get('acute_paralysis', False)
cervical_spine_history = record.get('cervical_spine_history', False)
trauma = record.get('trauma_relevant', True)
if hemodynamically_stable is None:
hemodynamically_stable = True
if acute_paralysis is None:
acute_paralysis = False
if cervical_spine_history is None:
cervical_spine_history = False
if trauma is None:
trauma = True
if not trauma:
return "Exclude"
# Exclusion criteria
if age < 16 or gcs != 15 or not hemodynamically_stable or acute_paralysis or cervical_spine_history:
return "Exclude"
return "Include"
def criteria_ct_head_pred(record):
age = record.get('age', 30) or 30
gcs_initial = record.get('gcs_initial', 15) or 15
has_coagulopathy = record.get('has_coagulopathy', False)
had_seizure = record.get('had_seizure', False)
meets_inclusion = record.get('meets_inclusion', True)
trauma = record.get('trauma_relevant', True)
if has_coagulopathy is None:
has_coagulopathy = False
if had_seizure is None:
had_seizure = False
if meets_inclusion is None:
meets_inclusion = True
if trauma is None:
trauma = True
if not trauma:
return "Exclude"
# Exclusion criteria
if not (meets_inclusion and 13 <= gcs_initial <= 15 and age >= 16 and not has_coagulopathy and not had_seizure):
return "Exclude"
return "Include"
def criteria_bcvi_pred(record):
trauma = record.get('trauma_relevant', True)
if trauma is None:
trauma = True
if not trauma:
return "Exclude"
return "Include"
def criteria_bcvi_memphis_pred(record):
trauma = record.get('trauma_relevant', True)
if trauma is None:
trauma = True
if not trauma:
return "Exclude"
return "Include"
def criteria_nexus_cspine_pred(record):
trauma = record.get('trauma_relevant', True)
gcs = record.get('gcs', 15) or 15
if trauma is None:
trauma = True
if (not trauma) or (gcs != 15):
return "Exclude"
return "Include"
def criteria_nexus_chest_ct_pred(record):
age = record.get('age', 30) or 30
gcs = record.get('gcs', 15) or 15
trauma = record.get('trauma_relevant', True)
hemodynamically_stable = record.get('hemodynamically_stable', True)
intubated = record.get('intubated', False)
if trauma is None:
trauma = True
if hemodynamically_stable is None:
hemodynamically_stable = True
if intubated is None:
intubated = False
if not trauma:
return "Exclude"
if gcs != 15 or intubated or not hemodynamically_stable or age < 15:
return "Exclude"
return "Include"
def criteria_ottawa_foot_pred(record):
age = record.get('age', 30) or 30
blunt_trauma = record.get('blunt_trauma', True)
acute_injury = record.get('acute_injury', True)
hindfoot_forefoot = record.get('hindfoot_forefoot', False)
if blunt_trauma is None:
blunt_trauma = True
if acute_injury is None:
acute_injury = True
if hindfoot_forefoot is None:
hindfoot_forefoot = False
# Exclusion criteria
if age < 2 or not blunt_trauma or not acute_injury or hindfoot_forefoot:
return "Exclude"
return "Include"
def criteria_ottawa_ankle_pred(record):
age = record.get('age', 30) or 30
blunt_trauma = record.get('blunt_trauma', True)
acute_injury = record.get('acute_injury', True)
if blunt_trauma is None:
blunt_trauma = True
if acute_injury is None:
acute_injury = True
# Exclusion criteria
if age < 2 or not blunt_trauma or not acute_injury:
return "Exclude"
return "Include"
def criteria_ottawa_knee_pred(record):
age = record.get('age', 30) or 30
trauma = record.get('trauma_relevant', True)
if trauma is None:
trauma = True
if age < 2 or not trauma:
return "Exclude"
return "Include"
def criteria_pittsburgh_knee_pred(record):
trauma = record.get('trauma_relevant', True)
acute_injury = record.get('acute_injury', True)
injury_past_one_week = record.get('injury_past_one_week', True)
if trauma is None:
trauma = True
if acute_injury is None:
acute_injury = True
if injury_past_one_week is None:
injury_past_one_week = True
if not trauma or not acute_injury or not injury_past_one_week:
return "Exclude"
return "Include"
def criteria_pecarn_cspine_pred(record):
age = record.get('age', 30) or 30
trauma = record.get('trauma_relevant', True)
if trauma is None:
trauma = True
# Exclusion criteria
if age >= 18 or not trauma:
return "Exclude"
return "Include"
def criteria_pecarn_tbi_pred(record):
age = record.get('age', 30) or 30
gcs = record.get('gcs', 15) or 15
trauma = record.get('trauma_relevant', True)
if trauma is None:
trauma = True
# Exclusion criteria
if age >= 18 or gcs < 14 or not trauma:
return "Exclude"
return "Include"
def criteria_pecarn_iai_pred(record):
age = record.get('age', 30) or 30
trauma = record.get('trauma_relevant', True)
trauma_within_24_hrs = record.get('trauma_within_24_hrs', True)
penetrating_trauma = record.get('penetrating_trauma', False)
is_pregnant = record.get('is_pregnant', False)
pre_existing_neurologic_disorders = record.get('pre_existing_neurologic_disorders', False)
if trauma is None:
trauma = True
if trauma_within_24_hrs is None:
trauma_within_24_hrs = True
if penetrating_trauma is None:
penetrating_trauma = False
if is_pregnant is None:
is_pregnant = False
if pre_existing_neurologic_disorders is None:
pre_existing_neurologic_disorders = False
if age >= 18 or not trauma:
return "Exclude"
if trauma and not trauma_within_24_hrs:
return "Exclude"
if penetrating_trauma or is_pregnant or pre_existing_neurologic_disorders:
return "Exclude"
return "Include"