# Machine Learning in Medical Triage: A Predictive Model for Emergency Department Disposition
## 2 Materials and Methods
### The MIMIC-IV-ED Database  
We utilized the MIMIC-IV-ED database, which includes emergency department records from Beth Israel Deaconess Medical Center (Boston, MA, USA) between 2011 and 2019 [24]. Data extraction was conducted with SQLite software version 3.40.0, focusing on variables from the 'edstays', 'triage', and'medrecon' (medicine reconciliation) tables to form our dataset. Patient age was determined by merging the 'edstays' table from the MIMIC-IV-ED database with the 'patients' table from the 'hosp' (hospital) module of the MIMIC-IV database, using stay_id and subject_id identifiers. For our predictive model, we concentrated initially on a specific set of features, particularly initial vital signs and basic metrics. This choice was guided by the availability of reliable data within the MIMIC-IV database and the need to establish a baseline model that could be efficiently validated. These features, while foundational, represent only a subset of the potential predictors that could influence hospital admission decisions. We recognize that the dynamics of hospital admissions are influenced by a myriad of factors, including more complex patient histories, laboratory results, and prior health conditions, which were not included in the current model scope due to data constraints and initial scope definition. Each entry in the final dataset corresponds to a distinct emergency department visit capturing variables such as age, gender, race, mode of arrival, vital signs, pain intensity, acuity related to condition severity, current medications, final disposition (admission or discharge), and total waiting time in hours. As is usual in applied machine-learning pipelines, some preprocessing is always necessary as an initial stage--for example, removing records with null values or values outside the corresponding domain. Specifically, we excluded records that contained values outside the specific boundaries for legal values for the scale attributes O2 saturation, pain, and acuity. In the context of analyzing medical data from emergency department patients, it is common to encounter values that seem incompatible with life. Outlier values can occur for a variety of reasons, including measurement errors, data entry mistakes, or the severity of the patients' conditions. This process of data cleaning is semi-automated and human judgment has to be exercised, due to the sensitive nature of how to handle outlier values. A broad range of values are presented in Table 1. \begin{table}
\begin{tabular}{l l l l} \hline \hline
**Attributes** & **Type** & **Values/Range** & **Mean (SD)** \\ \hline Age (years) & Number (integer) & 18–103 & 56.53 (19.47) \\ Gender & String & Female, Male & N/A \\  & & American Indian/ Alaska Native, Asian 1, Black 1, & \\  & & Hispanic 1, Multiple race/ethnicities, Native & \\ Race & String & Hawaiian or other Pacific Islander, Other, Patient & N/A \\  & & decline to answer, Portuguese, South American, & \\  & & Unable to obtain, Unknown, White 1 & \\ Arrival\_transport & String & Walk-in, ambulance, helicopter, unknown, other & N/A \\ Temperature (\({}^{\circ}\)F) & Number (double) & 56–111.4 & 98.1 (1.00) \\ Heart rate (beats per minute) & Number (double) & 13–250 & 84.75 (17.47) \\ Resp.rate (breaths per minute) & Number (integer) & 1–97 & 17.6 (2.22) \\ O2 saturation & Number (double) & 8–100 & 98.36 (2.00) \\ Systolic Blood pressure (SBP) & Number (integer) & 5–299 & 136.28 (22.84) \\ Diastolic Blood Pressure (DBP) & Number (integer) & 0–297 & 77.33 (15.02) \\ Pain (Numeric Pain Scale) & Number (double) & 0–10 & 4.17 (3.77) \\ Acuity & Number (integer) & 0–5 & 2.63 (0.64) \\ Drugs & Number (integer) & 1–50 & 9.56 (7.69) \\ Disposition & String & Home, Admitted & N/A \\ Hours & Number (double) & 0.33–72.9 & 7.44 (6.00) \\ \hline \hline \end{tabular}  
* Data adapted with permission from [PERSON] et al. (2023), IISA [23]. \({}^{1}\) Category contains sub-categories.  
\end{table} 
Table 1: The predictive attributes *.