Skip to content

Commit 0d6839b

Browse files
committed
fix(model): add stroke mortality parameter for stroke other LOS sampling (#6)
1 parent 0dcd306 commit 0d6839b

File tree

10 files changed

+481
-496
lines changed

10 files changed

+481
-496
lines changed

notebooks/analysis.ipynb

Lines changed: 434 additions & 464 deletions
Large diffs are not rendered by default.

outputs/figure1_asu.png

-538 Bytes
Loading

outputs/figure1_rehab.png

1.07 KB
Loading

outputs/figure3_asu.png

-223 Bytes
Loading

outputs/figure3_rehab.png

-19 Bytes
Loading

outputs/suptable1.csv

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
unit,beds,prob_delay_current,1_in_n_delay_current,prob_delay_no_complex_neuro,1_in_n_delay_no_complex_neuro
2-
asu,10,0.14,7.0,0.09,11.0
3-
asu,11,0.09,11.0,0.06,18.0
4-
asu,12,0.06,16.0,0.03,31.0
5-
asu,13,0.04,26.0,0.02,55.0
6-
asu,14,0.02,45.0,0.01,111.0
7-
asu,15,0.01,79.0,0.0,225.0
8-
rehab,12,0.11,9.0,0.05,20.0
2+
asu,10,0.13,8.0,0.08,12.0
3+
asu,11,0.09,12.0,0.05,20.0
4+
asu,12,0.06,18.0,0.03,36.0
5+
asu,13,0.03,30.0,0.01,67.0
6+
asu,14,0.02,52.0,0.01,131.0
7+
asu,15,0.01,95.0,0.0,277.0
8+
rehab,12,0.11,9.0,0.05,19.0
99
rehab,13,0.08,13.0,0.03,32.0
1010
rehab,14,0.05,20.0,0.02,57.0
11-
rehab,15,0.03,31.0,0.01,101.0
12-
rehab,16,0.02,52.0,0.0,212.0
11+
rehab,15,0.03,32.0,0.01,110.0
12+
rehab,16,0.02,51.0,0.0,205.0

outputs/table2.csv

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
unit,beds,prob_delay_current,1_in_n_delay_current,prob_delay_5%,1_in_n_delay_5%
2-
asu,9,0.19,5.0,,
3-
asu,10,0.14,7.0,0.16,6.0
4-
asu,11,0.09,11.0,0.11,9.0
5-
asu,12,0.06,16.0,0.08,13.0
6-
asu,13,0.04,26.0,0.05,20.0
7-
asu,14,0.02,45.0,0.03,33.0
8-
rehab,10,0.2,5.0,,
2+
asu,9,0.18,6.0,,
3+
asu,10,0.13,8.0,0.15,7.0
4+
asu,11,0.09,12.0,0.1,10.0
5+
asu,12,0.06,18.0,0.07,14.0
6+
asu,13,0.03,30.0,0.04,23.0
7+
asu,14,0.02,52.0,0.03,39.0
8+
rehab,10,0.21,5.0,,
99
rehab,12,0.11,9.0,0.13,8.0
1010
rehab,13,0.08,13.0,0.09,11.0
11-
rehab,14,0.05,20.0,0.06,15.0
12-
rehab,15,0.03,31.0,0.04,23.0
13-
rehab,16,0.02,52.0,0.03,37.0
11+
rehab,14,0.05,20.0,0.06,16.0
12+
rehab,15,0.03,32.0,0.04,24.0
13+
rehab,16,0.02,51.0,0.03,37.0

outputs/table3.csv

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
dedicated_acute,dedicated_rehab,pooled,pdelay_acute,pdelay_rehab,1_in_n_delay_acute,1_in_n_delay_rehab
2-
0,0,22,0.069,0.069,15,15
3-
0,0,26,0.018,0.018,55,55
4-
14,12,0,0.022,0.111,45,9
5-
11,11,4,0.051,0.092,20,11
6-
11,10,5,0.043,0.094,23,11
7-
10,10,6,0.047,0.07,21,14
8-
10,9,7,0.044,0.07,23,14
9-
9,9,8,0.047,0.058,21,17
10-
9,8,9,0.046,0.058,22,17
2+
0,0,22,0.063,0.063,16,16
3+
0,0,26,0.016,0.016,61,61
4+
14,12,0,0.019,0.11,52,9
5+
11,11,4,0.044,0.089,23,11
6+
11,10,5,0.037,0.09,27,11
7+
10,10,6,0.041,0.066,24,15
8+
10,9,7,0.039,0.066,26,15
9+
9,9,8,0.042,0.053,24,19
10+
9,8,9,0.041,0.053,25,19

simulation/model.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def create_distributions(self, asu_param, rehab_param, distribution_type):
165165
# Get a list of the patients in that unit (ignore other attributes)
166166
patient_types = [attr for attr in dir(unit_param) if attr in
167167
["stroke", "stroke_esd", "stroke_noesd",
168-
"tia", "neuro", "other"]]
168+
"stroke_mortality", "tia", "neuro", "other"]]
169169

170170
# For each patient type...
171171
for patient_type in patient_types:
@@ -253,13 +253,19 @@ def acute_stroke_unit(self, patient):
253253
msg=(f"Patient {patient.patient_id} ({patient.patient_type}) " +
254254
f"post-ASU: {patient.post_asu_destination}"))
255255

256-
# If it is a stroke patient,find out if they are going to the ESD
257-
# (stroke_esd) or not (stroke_noesd) - else, just same as patient_type
256+
# If it is a stroke patient, find out if they are going to the ESD
257+
# (stroke_esd) or not (stroke_noesd) or if they pass away
258+
# (stroke_mortality). For other patients, just same as patient_type.
258259
if patient.patient_type == "stroke":
259260
if patient.post_asu_destination == "esd":
260261
routing_type = "stroke_esd"
261-
else:
262+
elif patient.post_asu_destination == "rehab":
262263
routing_type = "stroke_noesd"
264+
elif patient.post_asu_destination == "other":
265+
routing_type = "stroke_mortality"
266+
else:
267+
raise ValueError("Stroke post-asu destination '" +
268+
f"{patient.post_asu_destination}' invalid")
263269
else:
264270
routing_type = patient.patient_type
265271

simulation/parameters.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def __init__(
137137
self,
138138
stroke_no_esd_mean=7.4, stroke_no_esd_sd=8.61,
139139
stroke_esd_mean=4.6, stroke_esd_sd=4.8,
140+
stroke_mortality_mean=7.0, stroke_mortality_sd=8.7,
140141
tia_mean=1.8, tia_sd=2.3,
141142
neuro_mean=4.0, neuro_sd=5.0,
142143
other_mean=3.8, other_sd=5.2
@@ -153,6 +154,10 @@ def __init__(
153154
Mean LOS for stroke patients with ESD.
154155
stroke_esd_sd: float
155156
SD of LOS for stroke patients with ESD.
157+
stroke_mortality_mean: float
158+
Mean LOS for stroke patients who pass away.
159+
stroke_mortality_sd: float
160+
SD of LOS for stroke patients who pass away.
156161
tia_mean: float
157162
Mean LOS for TIA patients.
158163
tia_sd: float
@@ -174,6 +179,10 @@ def __init__(
174179
"mean": stroke_esd_mean,
175180
"sd": stroke_esd_sd
176181
}
182+
self.stroke_mortality = {
183+
"mean": stroke_mortality_mean,
184+
"sd": stroke_mortality_sd
185+
}
177186
self.tia = {
178187
"mean": tia_mean,
179188
"sd": tia_sd

0 commit comments

Comments
 (0)