## 4 Results
### Creation of the Interactive Predictive Formula  
The use of PMApp provided a visual representation of the process, allowing us to stratify and compare these processes, integrating, in addition to time, the clinical variables that influenced patient outcomes. This analysis was conducted to understand the problem and propose a formula to predict the probability of patients presenting with a LOS greater than 4 h upon arrival at the ED. This analysis used data on those with the highest RR risk of prolonged LOS, their prevalence, and their clinical relevance. The purpose for which this formula has been manually developed is to facilitate the understanding of the decisions made. In developing the predictive formula, we deliberately excluded laboratory signs or dynamic clinical signs from the model, as our methodology focuses exclusively on variables available prior to triage. This decision ensures that the formula can be applied immediately upon patient arrival, enabling early identification of high-risk patients and facilitating a more streamlined and efficient fast-track process. Additionally, only parameters that can be directly known or observed by healthcare professionals at the time of triage were included, avoiding the use of complex care rules or arrival rate predictions, which would complicate real-time application. By prioritising simplicity and feasibility, the proposed approach ensures operational applicability across diverse emergency department settings, particularly those with limited resources. In especially critical environments such as emergencies, it is very important that the decisions made automatically are traceable in order to know on what basis the decisions have been made. Classic artificial intelligence systems are not traceable, so transparent traceability that ensures a fair, adequate decision that complies with the canons of equality and equity with the patient is not feasible. Therefore, to construct the formula, expert clinicians selected variables that, in addition to their prevalence and association with length of stay, had high clinical relevance to ensure the formula's performance when applied to the entire ED. Critically, the formula is intended to be applied at the point of triage, enabling immediate activation of the fast-track pathway. Consequently, outcome variables, which are only realised later in the patient's journey, were excluded from the formula due to their unavailability at the time of triage. The criteria for selecting the variables included in the formula included three characteristics: a high score associated with a prolonged LOS with the RR, prevalence, and finally, the application of the FT pathway must be clinically relevant. The first variables assessed, advanced age, frequency of visits, and triage level, were included in the formula because they have a strong association with RR and prolonged LOS. Furthermore, these variables have already been validated in various studies as triggers of prolonged LOS [61; 62; 63]. Variables related to patient mobility and referral by another healthcare professional were also highly correlated with prolonged stays. These variables are interrelated, as many patients who come to the ED and require a stretcher and/or wheelchair arrive by ambulance after being referred by another healthcare professional who determined that their health condition required urgent care. If we add the need for mobility aids, we are faced with a complex and/or fragile patient profile who will benefit from rapid access to care, a fact that has also been confirmed in related studies [61; 64; 65]  
To select the variables related to the reason for consultation, we selected those with the highest RR association with a prolonged LOS. The next step was to determine their prevalence and facilitate analysis.