## 3 Study Methodology  
Building upon the IPI described in the previous sections, a methodology was established to initially enable the characterisation of patients who are likely to contribute to ED overcrowding. From this characterisation, the risk rate was then calculated from the identified variables to determine which have the most significant influence on a prolonged stay (>4 h) in the ED, and thus design a fast-track care pathway to reduce times and possible adverse events. Figure 4 shows this methodology and the different phases in it:  
1. Analysis of the Interactive Process Indicator of the Emergency Department: This initial stage, based on data from 2021, involved two primary steps: (1.1) identification of the characteristics of patients with a length of day exceeding 4 h (\(\text{LOS}>\) 4 h) and (1.2) analysis of the relative risk associated with various variables. 2. Selection of Variables for the Study: This stage involved selecting relevant variables based on their clinical relevance, statistical significance (as measured by the relative risk), and prevalence in the patient population. 3. Creation of Predictive Models: This stage encompassed the development of two distinct predictive models: (3.1) an interactive predictive formula designed to evaluate fast-track implementation, and (3.2) predictive models built using machine learning techniques. 4. Evaluation of the Interactive Formula with Machine Learning Models: This stage focused on assessing the performance of the interactive formula in conjunction with the machine learning models. Data from 2022 were used in this stage. 5. Evaluation of the Effectiveness of the FT Predictive Formula Using Process Simulation: The final stage involved evaluating the effectiveness of the fast-track predictive formula through process simulation techniques. In the context of predicting prolonged LOS in EDs, there is an ongoing debate regarding the choice of predictive tools, particularly between manual formulas developed by clinical experts and machine learning (ML)-based systems. While ML systems provide advanced capabilities for processing large datasets and producing highly accurate models, the use of a manual predictive formula offers significant advantages in terms of traceability, transparency, and clinical relevance, especially in critical and sensitive environments such as EDs. One of the major limitations of ML models lies in their _black box_[45] nature, meaning that the decision-making process is often opaque and difficult to interpret. This lack of traceability can generate uncertainty and reduce trust among healthcare professionals, who need to justify clinical decisions based on understandable and verifiable parameters. In contrast, a manual formula designed by a group of clinical experts ensures full traceability of decisions. Each variable included in the formula is carefully selected based on its clinical relevance, statistical association with prolonged LOS (measured using the relative risk, RR), and prevalence in the patient population. This approach allows HCPs to understand the rationale behind each prediction, facilitating clinical validation and ensuring compliance with ethical principles such as fairness and equity in care. In addition, ML systems tend to prioritise model accuracy over the clinical relevance of the variables used, potentially leading to decisions that are impractical or inapplicable in a real-world healthcare setting. For example, variables with high statistical correlation but minimal clinical applicability may be included by an ML model, complicating its implementation in real-time scenarios. By contrast, the manual design of the formula allows experts to select only those variables that are both statistically significant and clinically impactful. In this case, the selected variables included advanced age (>65 years); frequent ED visits; triage levels (II and III); need for a stretcher or wheelchair; and prevalent reasons for consultation such as dyspnea, abdominal pain, and general poor condition.