## 4 Material and Methods  
### Study Design, Data Source, and Participants  
We conducted a retrospective, single-center study of all adult patients having consulting in the EDs at APUH between 2015 and 2018. The data were obtained directly from the hospital's electronic health records (ResUrgences(r), Berger Levrault, Boulogne-Billancourt, France). We excluded patients with no triage data and patients who had been transferred to an intensive care unit (ICU) immediately upon arrival. In French EDs, triage is performed by a nurse according to the five-level French Emergency Nurses Classification in Hospital (FRENCH) triage scale [55] (Table 1). Each triage criterion is associated with a triage level; for example, the criterion \"pulse \(\geq\) 180 bpm\" is associated with triage level 1, and the criterion \"chest pain with a normal ECG\" is associated with triage level 3. The nurse considers all triage criteria available and prioritizes the patient according to the most severe triage level met. The triage nurse can initiate simple tests (such as an ECG or a urine test) at the triage stage and can refer complex cases to a physician. The ML models were implemented by an interdisciplinary team of physicians from APUH and AI researchers from the University of Picardy Jules Verne (UPJV, Amiens, France). Specifically, structured triage data were used to develop binary classifiers for predicting the outcome (i.e., admission to a hospital ward or discharge). The outcome was binary because at the triage stage, not enough medical information is collected to predict a multi classifier with acceptable performance. The predictors and target outcomes are detailed in Supplementary Material S1.3. \begin{table}
\begin{tabular}{c c c} \hline
**Triage Level** & **Description** & **Action** \\ \hline
1 & Immediately life-threatening & Immediate medical intervention \\
2 & Marked impairment of a vital organ or imminently & Medical intervention within 20 min \\  & life-threatening & Medical intervention within 20 min \\  & Functional impairment or organic lesions likely to & \\
3 & deteriorate within 24 h or complex medical situation & Medical intervention within 60 min \\  & requiring several hospital resources & \\
4 & Stable, noncomplex functional impairment or organic lesions & Medical intervention within 120 min \\  & but requiring urgent use of at least one hospital resource & \\
5 & No functional impairment or organic lesion requiring no & Medical intervention within 240 min \\  & hospital resource & \\ \(*\) & Intense symptom or abnormal vital parameter requiring & \\  & rapid corrective action & \\ \hline \end{tabular} \(*\) is added to another triage level to flag the requirement of a rapide corrective action.  
\end{table} 
Table 1: The FRENCH triage scale [55]. In typical ED settings, not all variables were systematically collected (e.g., \"data not purposely collected\"). Consultations with missing values were not excluded. We next assumed that some vital signs were \"data not purposely collected\" because they appeared to be of little clinical relevance and/or were not ethical to collect. We therefore decided to fill missing data with a value of zero or a physiological value (Table 2). This decision was based on our clinical experience: an emergency physician would more readily understand predictions if the clinician knew that missing values had been replaced by the physiological value. In contrast, the use of more complex methods (such as multiple imputation chained equations) for in-context value imputation would be harder for the physician to understand. This missing data strategy (i.e., the replacement of missing values with fixed values) has been validated previously [56]. Accordingly, we decided to keep all the variables because \"abnormal\" data (i.e., either non-physiological or non-imputed) would nevertheless provide the model with information. Between 2015 and 2018, 351,019 patients attended the EDs at APUH.