Reference
Representation of an individual patient within the simulation.
A Patient object stores all clinical, pathway, and state-related
attributes required for modelling flow through the stroke care
process.
Several characteristics (onset type, MRS score, diagnosis
category, admission likelihood) are randomly generated on creation
(or at the start of assessment) using parameters defined in the global
configuration class g.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p_id
|
int or str
|
Unique identifier for the patient. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int or str
|
Patient identifier. |
q_time_nurse |
float
|
Time spent waiting for nursing assessment or consultation. |
q_time_ward |
float
|
Time spent waiting for an inpatient ward bed. |
onset_type |
int or float
|
Categorisation of onset information (initialized as NaN): - 0 : Known onset - 1 : Unknown onset but within CTP window - 2 : Unknown onset and outside CTP window |
mrs_type |
int or float
|
Modified Rankin Scale score at presentation (0–5). Drawn from an exponential distribution and capped at 5. |
mrs_discharge |
int or float
|
Modified Rankin Scale score at discharge. |
diagnosis |
int or float
|
Raw randomised diagnostic value (0–100). Used to map to a clinical
category based on thresholds defined in |
patient_diagnosis |
int or float
|
Encoded diagnosis category: - 0 : Intracerebral haemorrhage (ICH) - 1 : Ischaemic stroke (I) - 2 : Transient ischaemic attack (TIA) - 3 : Stroke mimic - 4 : Non-stroke |
patient_diagnosis_type |
str or None
|
String representation or specific subtype of the diagnosis. |
priority |
int
|
Triage priority level (used for queue ordering). Default is 1. |
non_admission |
int or float
|
Randomised admission likelihood score (0–100). |
advanced_ct_pathway |
bool or None
|
Whether the patient enters an advanced CT imaging pathway. |
sdec_pathway |
bool or None
|
Whether the patient is routed through SDEC. |
thrombolysis |
bool or None
|
Whether the patient receives thrombolysis. |
thrombolysis_contraindicated |
bool or None
|
Whether a patient who has a known onset within a thrombolysable period, or has a CTP scan that shows saveable brain tissue, is not treated with thrombolysis due to other contraindications. |
thrombectomy |
bool or None
|
Whether the patient receives thrombectomy. |
admission_avoidance |
bool or None
|
Whether the patient avoids an admission by being seen in SDEC instead. |
admission_avoidance_because_of_therapy |
bool or None
|
Whether the patient avoids an admission by being seen in SDEC instead and would not have avoided admission if therapy had not been available (True). Set to false if an avoided admission that still would have been avoided even if the therapy provision was not running. |
non_admitted_tia_ns_sm |
bool or None
|
Flag indicating if a TIA, Non-Stroke, or Stroke Mimic patient was not admitted. |
ward_los |
float
|
Total length of stay in the ward. |
ward_los_thrombolysis |
float
|
Specific length of stay component related to thrombolysis treatment. |
sdec_los |
float
|
Total length of stay in the Same Day Emergency Care (SDEC) unit. |
ctp_duration |
float
|
Time taken for CT Perfusion scan. |
ct_duration |
float
|
Time taken for standard CT scan. |
arrived_ooh |
bool or None
|
Flag indicating if the patient arrived Out of Hours. |
clock_start |
float
|
Simulation time of patient arrival. |
nurse_q_start_time |
float
|
Time patient joined the nurse queue. |
nurse_triage_start_time |
float
|
Time nurse triage began. |
nurse_triage_end_time |
float
|
Time nurse triage finished. |
ct_scan_start_time |
float
|
Time CT scan began. |
ctp_scan_start_time |
float
|
Time CTP scan began. |
ct_scan_end_time |
float
|
Time CT scan finished. |
ctp_scan_end_time |
float
|
Time CTP scan finished. |
sdec_admit_time |
float
|
Time admitted to SDEC. |
sdec_discharge_time |
float
|
Time discharged from SDEC. |
ward_q_start_time |
float
|
Time patient joined the ward bed queue. |
ward_admit_time |
float
|
Time admitted to the ward. |
ward_discharge_time |
float
|
Time discharged from the ward. |
exit_time |
float
|
Time the patient left the simulation entirely. |
nurse_attending_id |
int or float
|
ID of the specific nurse resource assigned. |
ct_scanner_id |
int or float
|
ID of the specific CT scanner resource assigned. |
sdec_bed_id |
int or float
|
ID of the specific SDEC bed/cubicle assigned. |
ward_bed_id |
int or float
|
ID of the specific ward bed assigned. |
sdec_running_when_required |
bool or None
|
State of SDEC availability when the patient needed it. |
sdec_full_when_required |
bool or None
|
State of SDEC capacity when the patient needed it. |
generated_during_warm_up |
bool or None
|
Flag indicating if the patient was generated during the model warm-up period. |
journey_completed |
bool or None
|
Flag indicating if the patient completed the full pathway or was removed/processed differently. |
Notes
GENAI declaration (SR): this docstring has been generated with the aid of ChatGPT 5.1 and subsequently updated by Gemini to reflect code changes. All generated content has been thoroughly reviewed.
Source code in src/stroke_ward_model/entities.py
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 | |