## 6 Conclusions  
The paper presents a study of the emergency department in a hospital located in the north of Portugal. The objective of this study was to find solutions to improve the performance of the department in terms of waiting times and resource utilization using simulation techniques. In a first phase, the operating principles of the emergency department were presented, such as the arrival rates, the admission process, the triage protocol, resuming the main stages through which an emergency episode undergoes. Subsequently, an extensive analysis of the database provided by the hospital is presented, from which the stages of the emergency episode previously mentioned were analytically distinguished, as well as the emergency department demand. This made it possible to unveil Monday as the weekday with the higher demand in comparison to the rest of week. A demand pattern with two particularities was also evident: on the one hand the night shift registered a substantially lower number of entries, and on the other hand two peak periods between 08.00-10.00 and 14.00-16.00. Then, a simulation model based on the extensive treated data was developed and presented. All the processes that characterize an emergency episode were modeled using probabilistic fitting to properly translate the emergency service operation. This model was later used to plan both the medical team, as well as the treatment places. We found a dependency between the number of doctors that make up the team and the places available for treatment, which directly affects the treatment rooms' efficiency. It was revealed and quantified how much the treatment rooms performance is affected due to resources (human and spaces) availability. It was found that the green room has a surplus of capacity in terms of the number of treatment places, and the opposite was verified for the yellow's treatment room. In this case, an improved solution is achieved by considering the binomial increase of the number of spaces (at least 3) with the increase of the doctor's team (1 doctor day shift). Thus, the authors proposed that the excess spaces in the green room should be allocated to the yellow room so it can achieve a better performance (doctor's occupation under 80% and waiting time for the first medical observation under 60 min, complying with the Manchester protocol time requirements). This allowed us to conclude that a proper room capacity design is influenced not only by the percentage of patients with a respective priority but also by the severity of the priority itself. Although the percentage of green patients is high, as their health status is not aggravated, and therefore they are treated more quickly, the capacity of the room does not require a volume of spaces in accordance with their percentage of entries. Taking into consideration the complexity and non-linearity of the emergency department, only a discrete-event simulation approach is capable of correctly modelling the system's dynamics and intercorrelations allowing a proper design  
Figure 16: Obtained values for different capacity scenario: (**a**) waiting time for first medical intervention (blue line—simulation model, red line—Manchester time); (**b**) medical resource occupation (blue line—simulation model, red line—occupation rate limit). of both the size of the rooms and the medical team. However, if it is impossible to use a simulation model, the room capacity assigned to each priority must consider two factors, the severity of the patient and the percentage this represents in the total entries. It is important to mention that every change proposed by the authors was implemented in practice by the hospital management. Discrete event simulation has proven to be extremely effective in determining the behavior of alternative scenarios without being implemented at full scale. The flexibility associated with the simulation represents one of the biggest advantages in its adoption since it allows informed decision making. Conceptualization, A.C.-P., B.S.G. and R.M.L. ; methodology, A.C.-P., B.S.G.