scieee AI-readable full text Open interactive document viewer

Predicting Emergency Attendance at a Tertiary Hospital: An Emergency Department Data Warehouse Project

Gonçalves, Catarina Sousa

Abstract

The overcrowding of emergency departments (ED) has been a well-known problem worldwide. Over the years, many solutions have been proposed, demonstrating that improving task processes and management through business intelligence (BI) applications results in better outcomes. C.H.U.L.N. is the largest Portuguese hospital, providing third-level services, and its unique characteristics present a management challenge. Consequently, the excessive influx of patients to the emergency room is a more pronounced issue compared to other institutions. Therefore, the purpose of this thesis is to create a data warehouse for the C.H.U.L.N.'s Emergency department. This will facilitate the future development of a patient influx prediction algorithm, ultimately improving departmental management. To determine which information should be included in the data warehouse for the future algorithm, it was necessary to understand, based on existing projects and algorithms, what relevant information should be considered. As a result of the Data Warehouse Project, a constellation schema composed of two star schemas was designed. The relevant patient information identified in the literature includes the patient's age, gender, date and time of admission to the ED, diagnosis, Manchester Triage System (MTS) priority color, patient checkout condition, and other selected information. These factors were considered in the Data Warehouse. The project focuses on two main fact tables - Emergency Assistance and Outpatients - which enable access to selected information about ED patients. This information can be compared with the selected information about patients receiving treatment in service wards and during medical appointments. Analyzing the C.H.U.L.N.’s ED flowchart from the moment the patient enters the department, it seemed important to consider other factors such as waiting times in minutes. This thesis intends to serve as an intermediary step, creating a suitable data warehouse that permits the future development of a influx prediction algorithm, along with other potential projects. The application of BI is an important step in the development, improvement and sustainability of healthcare, which is the primary focus of this entire thesis.

Full text

i Master in Information Management Predicting Emergency Attendance at a Tertiary Hospital An Emergency Department Data Warehouse Project Catarina de Sousa Gonçalves Work Project presented as a partial requirement to obtain the degree of Master in Information Management NOVA Information Management School Instituto Superior de Estatística e Gestão de Informação Universidade Nova de Lisboa MGI ii NOVA Information Management School Instituto Superior de Estatística e Gestão de Informação Universidade Nova de Lisboa Predicting Emergency Attendance at a Tertiary Hospital by Catarina de Sousa Gonçalves Project presented as a partial requirement to obtain the degree of Master in Information Management with specialization in knowledgement Management e Business Intelligence Advisor: Prof. Doutor Miguel de Castro Neto Advisor: Prof. Doutor Luis Pedro Batista iii July 2023 DECLARATION OF INTEGRITY I declare that I have carried out this academic work with integrity. I confirm that I have not resorted to plagiarism or any other form of misuse of information or falsification of results during the process of preparing this work. I also declare that I am aware of the Rules of Conduct and the Code of Honor of the NOVA Information Management School. Catarina de Sousa Gonçalves Lisboa, 15th of July of 2023 iv ABSTRACT The overcrowding of emergency departments (ED) has been a well-known problem worldwide. Over the years, many solutions have been proposed, demonstrating that improving task processes and management through business intelligence (BI) applications results in better outcomes. C.H.U.L.N. is the largest Portuguese hospital, providing third-level services, and its unique characteristics present a management challenge. Consequently, the excessive influx of patients to the emergency room is a more pronounced issue compared to other institutions. Therefore, the purpose of this thesis is to create a data warehouse for the C.H.U.L.N.'s Emergency department. This will facilitate the future development of a patient influx prediction algorithm, ultimately improving departmental management. To determine which information should be included in the data warehouse for the future algorithm, it was necessary to understand, based on existing projects and algorithms, what relevant information should be considered. As a result of the Data Warehouse Project, a constellation schema composed of two star schemas was designed. The relevant patient information identified in the literature includes the patient's age, gender, date and time of admission to the ED, diagnosis, Manchester Triage System (MTS) priority color, patient checkout condition, and other selected information. These factors were considered in the Data Warehouse. The project focuses on two main fact tables - Emergency Assistance and Outpatients - which enable access to selected information about ED patients. This information can be compared with the selected information about patients receiving treatment in service wards and during medical appointments. Analyzing the C.H.U.L.N.’s ED flowchart from the moment the patient enters the department, it seemed important to consider other factors such as waiting times in minutes. This thesis intends to serve as an intermediary step, creating a suitable data warehouse that permits the future development of a influx prediction algorithm, along with other potential projects. The application of BI is an important step in the development, improvement and sustainability of healthcare, which is the primary focus of this entire thesis. KEYWORDS Business Intelligence; Healthcare; Sustentability; Data Warehouse Sustainable Development Goals (SDG): v RESUMO A sobrelotação dos serviços de emergência (ED) é um problema amplamente conhecido em todo o mundo. Ao longo dos anos, têm sido propostas muitas soluções, demonstrando que a melhoria dos processos e da gestão pela utilização de Business Intelligence (BI) confere melhores resultados. O C.H.U.L.N. é o maior hospital português, sendo um hospital terciário, e, suas características únicas apresentam um desafio de gestão. Consequentemente, a afluência excessiva de doentes à urgência é uma questão mais agravada em comparação com outras instituições. Portanto, o objetivo desta tese é criar um data warehouse para o Departamento de Emergência do C.H.U.L.N. No futuro o objectivo será criar de um algoritmo de previsão de afluência de doentes à urgência, melhorando assim a gestão do serviço. Para determinar quais os dados que devem ser incluídas no data warehouse para o futuro algoritmo, foi necessário entender, com base em projetos e algoritmos existentes, quais informações relevantes deveriam ser consideradas. Assim deste Projeto de Data Warehouse resultou um constellation schema composto por dois star schema. Os dados identificados como relevantes na literatura incluiam a idade, sexo, data e hora de admissão no ED, diagnóstico, cor de prioridade do Sistema de Triagem de Manchester (MTS), destino de alta do doente e outras informações selecionadas. Esses fatores foram considerados no Data Warehouse. O projeto concentra-se em duas fact tables principais - Emergency assistance e OutPatients - que permitem o acesso às informações selecionadas sobre os doentes do ED. Essas informações podem ser comparadas com as informações selecionadas sobre os doentes que se encontram internados nos serviços, os doentes que recorrem às consultas e hospital de dia. Ao analisar o fluxograma do ED do C.H.U.L.N. desde o momento em que o doente entra no departamento, pareceu importante considerar outros fatores, como tempos de espera em minutos. Esta tese pretende ser um passo intermediário, criando um data warehouse adequado que permita o desenvolvimento futuro de um algoritmo de previsão de afluência, e potencialmente outros projetos que possam surgir. A aplicação de métodos de BI é um passo importante no desenvolvimento, melhoria e sustentabilidade dos cuidados de saúde, sendo este o foco principal desta tese. PALAVRAS-CHAVE Business Intelligence; Cuidados de saúde; sustentabilidade; Data Warehouse Objetivos do Desenvolvimento Sustentável (ODS): vi TABLE OF CONTENTS 1. INTRODUCTION ........................................................................................................................ 1 1.1. Motivations and context .................................................................................................. 1 1.2. Case study ......................................................................................................................... 2 1.3. Objective ........................................................................................................................... 2 1.4. Design science research ................................................................................................... 3 2. LITERATURE REVIEW ................................................................................................................ 4 2.1. What is a data warehousing? ........................................................................................... 4 2.2. Data warehouse architecture ........................................................................................... 5 2.3. Data warehouse architecture - tier .................................................................................. 5 2.4. Data warehouse architecture – dimensional modelling .................................................. 6 2.5. What to look for in the future .......................................................................................... 7 2.6. How were the existing projects developed to create the predicting algorithm? What does 'exist' mean? Which variables were used? ...................................................................... 8 2.7. What are the influential factors that showed significance in the prediction of the emergency department influx? ................................................................................................ 9 3. METHODOLOGY ..................................................................................................................... 11 3.1. Identify problem & motivate .......................................................................................... 11 3.2. Project objectives ........................................................................................................... 11 3.3. Identification of artifacts and problem class configuration ........................................... 12 3.4. Factors ............................................................................................................................ 12 4. RESULTS .................................................................................................................................. 13 4.1. Design of Data Warehouse Architecture ........................................................................ 13 4.2. Data Warehouse Design ................................................................................................. 13 4.2.1. Design of the Data Warehouse ............................................................................... 13 4.3. Data Warehouse diagram ............................................................................................... 22 4.4. Evaluation ....................................................................................................................... 22 4.5. Communication .............................................................................................................. 23 5. DISCUSSION ............................................................................................................................ 24 6. CONCLUSION .......................................................................................................................... 26 REFERENCES ................................................................................................................................ 27 vii INDEX OF FIGURES Figure 1 - Process iteration (image from Peffers et al., 2007) ............................................................... 3 Figure 2 – Data Warehouse Architecture (Data Warehouse Architecture Explained, 2020) .................. 5 Figure 3 - C.H.U.L.N. Emergency Department data warehouse project chronogram (adapted from Data Warehousing 2, 2023) .................................................................................................................. 11 Figura 4 - C.H.U.L.N.’s ED data warehouse tiers (adapted from Ida Bagus Leo Mahadya Suta, 2019) 13 Figura 5 - Selection process to design the Data Warehouse ................................................................ 14 Figura 6 - Organogram CHLN 2016 ....................................................................................................... 15 Figure 7 - Emergency Assistance schema diagram ............................................................................... 19 Figure 8 - OutPatient schema diagram ................................................................................................. 21 Figure 9 - Data Warehouse Diagram .................................................................................................... 22 viii INDEX OF TABLES Table 1 - Fact Emergency_Assistance ................................................................................................... 16 Table 2 - Fact Outpatient ...................................................................................................................... 17 Table 3 - Fact_Emergency_Assistance Dimensions .............................................................................. 18 Table 4 - Outpatient dimensions .......................................................................................................... 20 ix GLOSSARY ANN - Artificial Neural Networks ARIMA - Autoregressive Integrated Moving Average ARIMAX - Autoregressive Integrated Moving Average with Exogenous Regressors BI - Business Intelligence C.H.U.L.N. - Centro Hospitalar Universitário Lisboa Norte DSR - Design Science Research DWH - Data Warehouse ED - Emergency Departments EEMD - Ensemble Empirical Mode Decomposition ES - Exponential Smoothing ETL - Extraction, Transformation, and Loading HOLPAP - Online Analytical Processing Multidimensional and Relational Model JDBC - Java Database Connectivity LSTM - Long Short-Term Memory MAPE - Mean Absolute Percentage Error MOLAP - Online Analytical Processing Multidimensional Model MTS - Manchester Triage System NHS - National Health Service ODBC - Open Database Connectivity OLE-DB - Object Linking and Embedding for Databases RDBMS - Relational Database Management System ROLAP - Online Analytical Processing Relational Model SARIMA - Seasonal Autoregressive Integrated Moving Average VAR - Vector Autoregression VARIMA - Vector Autoregressive Integrated Moving Average 7 The Galaxy Data Warehouse Schema is also known as a Fact Constellation Schema. It utilizes multiple fact tables connected with shared normalized dimension tables. However, it allows only the inclusion of first-level dimensions, making the construction easier. Essentially, it is a group of star schemas connected to each other while being normalized. The redundancy in this schema is nearly zero. It offers high data quality and accuracy (Buuck, 2022) (Data Warehousing - Schemas, s.d.). There are different approaches to designing data warehouse architecture. The two main ones are Kimball's and Inmon's approaches. Kimball's approach follows a bottom-up procedure. It begins by exploring the business processes, identifying their needs and the questions that require answers. Then, it identifies all the data sources and undergoes an ETL (Extract, Transform, Load) process to create a denormalized data model. This dimensional model, built using either a star schema or snowflake schema, is then structured around department-specific sub-databases. In contrast, Inmon's approach follows a top-down procedure. It starts by identifying all the available data sources within the enterprise. Then, through a comprehensive evaluation of the data and business needs, key entities and their relationships are defined. Next, the entity structure is utilized to build a model that captures the attributes of each entity, along with their mutual relationships and dependencies. Finally, the physical model is created, using ETL to populate the data into the normalized data model. Both approaches have their respective roles. Kimball's approach is more suitable when fast results are needed, the developers may have limited expertise, and minimal changes in business requirements are anticipated. Inmon's approach is more suitable for large enterprises, as its purpose is to provide a holistic view of the company's data model (Kimball vs Inmon: Which approach should you choose when designing your data warehouse architecture?, 2021). The first step is to define the business process that is supposed to be understood by the user. The second step is to define the grain, which refers to the level of data stored in the primary fact table. Kimball argued that this point is of utmost importance because the grain determines whether the model can answer the proposed questions easily and quickly. The third step is to choose the dimensions for each fact table row. Finally, the fourth step is to identify the numeric facts that will populate each fact table row (Kimball vs Inmon: Which approach should you choose when designing your data warehouse architecture?, 2021). 2.5. WHAT TO LOOK FOR IN THE FUTURE The literature presents many projects supporting the benefits of BI in ED management. Therefore, this literature review aims to identify the most accurate methods to use and determine the variables and covariates that have shown to have an impact. This knowledge will serve as the foundation for building this project, utilizing insights gained from recent years. This thesis was developed with the purpose of creating the C.H.U.L.N.'s ED Data Warehouse so that, in the future, it will be possible to develop a prediction algorithm for patient influx to C.H.U.L.N.'s ED. Currently, this is not possible as there is no Data Warehouse available that enables the analysis of the 8 data involved. So, this project is a crucial step towards the future aim. Furthermore, it will enable the effective and fast analysis of information in a report format and, if desired, the development of other projects based on C.H.U.L.N.'s ED Data Warehouse. 2.6. HOW WERE THE EXISTING PROJECTS DEVELOPED TO CREATE THE PREDICTING ALGORITHM? WHAT DOES 'EXIST' MEAN? WHICH VARIABLES WERE USED? In Singapore, a study group applied statistical methods (t-test), using Autoregressive Integrated Moving Average (ARIMA), based on historical trends to prove the possibility to forecast daily attendance at an ED with about 400 daily attendances. This study used independent variables namely public holiday (yes or no), ambient air quality, daily ambient average temperature, and daily relative humidity. It concluded that attendance at the ED can be predicted with good accuracy. The daily total attendances were not predicted by weather conditions having hypothesized as causality the stability of temperatures and humidity throughout the year, characteristic of Singapore. During the days with poor ambient air quality, the number of attendances was smaller, this fact being justified by the warnings of public institutions for the weakened population to stay at home. The daily attendances were higher during summer, concurrent with the closure of primary healthcare (Yan Sun, 2009). Another analysis developed in England – in the National Health Service (NHS) – intended to analyze and forecast the ED attendances in NHS, where an ARIMA to forecast the daily attendances was applied (Qassim, 2018). Another approach was taken in ED of the University Hospital Hassan II of Fez, a city in Morocco. The authors used combining Artificial Neural Networks (ANNs) with a signal decomposition technique named Ensemble Empirical Mode Decomposition (EEMD) to forecast the weekly arrivals to the ED. This study produced a review on the most used methods and based on the results used feedforward neural network. This ANN type demonstrated to capture the real patterns of the data, and it seemed that dealing with the data before learning was actually an advantage. In this study, the data was decomposed into multi-signals to learn the sub-signal using different ANN models with different combinations, and then combining the forecasting results of all sub-signals, concluding that EEMDANN presented the best results (Rohaifa Khaldi, 2019). Focusing on forecasting models, through time data specialists have been proposing different time series methods such as Linear and Logistic Regression, ARIMA, Seasonal ARIMA (SARIMA), ARIMA with Exogenous Regressors (ARIMAX), Vector Autoregression (VAR), Vector ARIMA (VARIMA), Exponential Smoothing (ES) and Artificial Neural Networks (ANN). These methods have been widely tested in the forecasting of ED attendance with or without considering concomitant different parameters (Vidya K.Sudarshan, 2021). As criteria to evaluate the model performance, most of the studies used the percentage of variability (R2) in regression analysis, the mean absolute percentage error (MAPE) and the root mean square error (RMSE) (M Wargon, 2009). Thus, there are mainly two categories of models for this time series forecasting problem: statistical models and machine learning models. Statistical models, for example, ARIMA, although they have shown good results over the last 20 years, fail to model the stochastic and non-linear nature of time series, characteristic of the data of the area in question. On the other hand, advanced machine learning 9 models and support vector machine are more adapted to these challenges (Vidya K.Sudarshan, 2021) (Xinxing Zhao, 2022). Deep learning models through time have been tested in many domains, demonstrating positive results, such as COVID-19 forecasting (Matheus Henrique Dal Molin Ribeiro, 2020). Lately, with the knowledge acquired, there has been a focus on the combined models. It seems that hybridizing different models, deep learning models, gets better forecasting performance (Xinxing Zhao, 2022). Deep learning is characterized by a neural network with three or more layers. This subset of machine learning attempts to simulate the behavior of the human brain, "learning" from large amounts of data. It represents a neural network composed of three or more layers that all together, through the processes of gradient descent and backpropagation, optimize and refine the accuracy of prediction. Essentially, it is reinforcement learning where the model learns to become more accurate in performing a designated task based on feedback, maximizing the reward (What is deep learning?, s.d.). Using Long Short-Term Memory (LSTM) Neural Networks to predict ED admissions seems to be combining machine learning prediction models with better results (Nok Cheng, 2020) (Jing Xia, 2019) (Farid Kadri, 2019) (Xinxing Zhao, 2022). While we can find many models for clinical prediction, there is still a lack of studies with a prospective validation in real-world clinical issues. Therefore, despite all efforts, there has been little progress in the implementation of the existing models in the ED (Rasheed El-Bouri, 2021). 2.7. WHAT ARE THE INFLUENTIAL FACTORS THAT SHOWED SIGNIFICANCE IN THE PREDICTION OF THE EMERGENCY DEPARTMENT INFLUX? Focusing on influence factors, it seems that the prediction of the influx is mainly related to trends, but with limited influence of stochastic variations (M Wargon, 2009). So the trends through the data show a significant role of the season in the prediction of visits to ED (Robert Champion, 2007) (Z Rotstein1, 1997), (A K Diehl, 1981), (D R Holleman Jr, 1996) (Simon Andrew Jones, 2002), as it is possible to see on “Winter crisis” (K J Fullerton, 1999) and many other late examples (Yan Sun, 2009) (Ines Corcuera Hotz, 2020) (Emily Y Y Chan, 2013) (C Linares, 2008). Through the analysis of the investigations and projects that have been developed over time, it is noticed that there are some important factors to consider in a project developed at the C.H.U.L.N. Lisbon presents changes related to the seasons, so taking into account the data verified in other projects, it will be important to consider the weather for the project, as it was possible to verify in Portuguese existing projects (Carlos Narciso Rocha, 2021). Most of the studies that used machine learning to predict admissions and scheduling in the ED used seasonal/environmental data, health records and hospital location. To predict the admission of patients, static and time models were developed, foreseeing the volume of people the next day, the next week and the next month. To predict the readmission of patients, using as source seasonal/environmental data and health records, static and time models were developed, foreseeing the readmission in several days. 10 To predict emergency and elective patients, using as source health records and hospital location information, simulation, static and optimization models were developed, allowing a schedule design based on the predicted priority ranking (Rasheed El-Bouri, 2021). Also, some other temporal variables were used, such as holidays, local events and international events such as sporting events. Meanwhile, weather conditions and pollution levels show unsatisfactory and nonconsensual results (M Wargon, 2009) (Adam M Wilson, 2005). Epidemics and pandemics are not considered since it is not beneficial to predict them jointly, taking into account the unpredictability evident in their emergence and typical characteristics, for example, transmission rate and symptomatology. Epidemiological surveillance of these syndromes requires models that differ in the variables to be evaluated against prediction algorithms in a non-pandemic period (Judith C Brillman, 2005). The impact of university hospitals on the influx to ED was demonstrated in the USA, as well as the impact of income level of the population (Leah S. Honigman WarnerJessica E. Galarraga, 2018). However, the USA is served by a different health system, which may result in different influence factors in ED admission. Although many advances have been made in the definition of forecast models, there is a lack in data on the factors that influence the inflow of patients to the urgency. Most of the studies assess quality factors. It is known from what has been learned that the crowding of ED is mainly related to intrinsic factors (Gerard Espinosa, 2002). However, it is also known that the volume of patients on admission has a close association with factors external to the institution, such as social support and community followup (Ian Pope, 2017). Existing data shows that the variation in the ratios between the different hospitals varies depending on the unique characteristics of each institution (Ian Pope, 2017). 11 3. METHODOLOGY 3.1. IDENTIFY PROBLEM & MOTIVATE The problem on which this project is based is the overcrowding of the C.H.U.L.N.'s ED (Emergency Department). The motivation, as previously described, lies in obtaining a reliable algorithm in the future that will enable the prediction of the influx to the ED. Therefore the main objective is to create a Data Warehouse with the C.H.U.L.N.'s Emergency Department's patient influx information. Thus, in the Design & Development phase of the project, access to the data and information systems of C.H.U.L.N.'s ED is imperative. It is necessary to understand which information is important, considering previous projects and the characteristics of C.H.U.L.N.'s ED. And then correlate it with the levels of detail, integration and completeness, while defining the roadmap and roles. Figure 3 - C.H.U.L.N. Emergency Department data warehouse project chronogram (adapted from Data Warehousing 2, 2023) 3.2. PROJECT OBJECTIVES The final purpose of this thesis, as mentioned before, is to create the project of a Data Warehouse. In the future, after completing this thesis, the plan is to implement and test the Data Warehouse. Then, an algorithm suitable for predicting the influx to C.H.U.L.N.'s ED will be developed. In the demonstration phase, the main structure of the Data Warehouse will be explained. In order to accomplish the final design of the Data Warehouse, it is also necessary to define: 12 1. Selecting the process. 2. Determining the granularity. 3. Identifying and validating the dimensions. 4. Selecting the facts. 5. Storing pre-calculations in the fact table. 6. Completing the dimension tables. 7. Determining the database's timeframe. 8. Managing slowly changing dimensions. 3.3. IDENTIFICATION OF ARTIFACTS AND PROBLEM CLASS CONFIGURATION It was possible to define that Long Short-Term Memory (LSTM) Neural Networks is the deep layer model which showed better results. In the other hand, external factors seem to be more difficult to define. From what was possible to learn with the literature review, it seems that the seasonality is an important external factor, as it is the day of the week and month, holidays and big events. However, there are many other factors that can be important, being them characteristic of each institution. The next step on this project will be to analyze the data existing in the ED of C.H.U.L.N., identification of important events/external factors that seem to interfere with the volume of admissions, so it can be collected and measured if its significant or not to the forecasting. 3.4. FACTORS The final outcome of this project will be to prove that a Data Warehouse will enable the development of a prediction algorithm for the patients' influx from the C.H.U.L.N.'s department. It is crucial to define the information to include in the Data Warehouse. The experience from other works has shown that age, Emergency Severity Triage Score, heart rate, diastolic blood pressure and chief complaint have significant predictive value for influx (Michael A. LaMantia, 2010) (Allan Cameron, 2015) (Yan Sun PhD, 2011). 13 4. RESULTS 4.1. DESIGN OF DATA WAREHOUSE ARCHITECTURE The C.H.U.L.N.'s ED Data Warehouse will naturally consist of three tiers. The data sources will include data from the emergency department program (Inpatient database) and the general hospital system (Outpatient database). All data must be encrypted in accordance with the General Data Protection Law (Lei n.º 58/2019, de 8 de Agosto). C.H.U.L.N.'s ED Data Warehouse will be composed of a three-tier architecture, i.e., three environments or levels. C.H.U.L.N. presents complex data demands. Even though C.H.U.L.N.'s ED Data Warehouse will focus on one department, the sources of information will include different programs. This threetier architecture will include: - The back-end tier, which will basically be the data storage. - The middle-tier, which will perform data analytics and processing. - The front-tier, which will be the user interface. The back-end tier will basically consist of the database of the warehouse, where the entire ETL (Extract, Transform, Load) process occurs. The middle tier will provide a well-organized view of the data, enabling analysis focused on the purpose of the Data Warehouse. It is in this tier that query, analysis and data mining tools are defined. Finally, the front-tier is the 'front page' where health professionals can access the analyzed data, as it is represented on figure 4. Figura 4 - C.H.U.L.N.’s ED data warehouse tiers (adapted from Ida Bagus Leo Mahadya Suta, 2019) 4.2. DATA WAREHOUSE DESIGN 4.2.1. Design of the Data Warehouse This project was developed based on Kimball's four-step approach, taking into account the main goal of the Data Warehouse and the particularities of the C.H.U.L.N.'s ED, on which the project is based. 14 4.2.1.1. Choosing the process The objective of the project is to develop a prediction algorithm for patient influx in the C.H.U.L.N. Emergency Department. Based on this objective, the selection process will be used to design the Data Warehouse. The process that patients go through since they enter the ED is explained in the flowchart below. Figura 5 - Selection process to design the Data Warehouse As it is possible to analyze in the flowchart above, when a patient goes to the C.H.U.L.N.'s, there is an established process: 1. The patient is admitted to the ED by registering at the ED's secretary. The registration can be done by the patient, the patient's escort, a firefighter, pre-hospital emergency staff or anyone bringing the patient to the ED. 2. Then there is a waiting time until triage. The most seriously ill patients can be immediately assisted in the resuscitation room. 3. The patient undergoes triage using the Manchester Triage System, which classifies him into blue, green, yellow, orange or red priority categories. 4. After triage, the patient is attended to by medical staff. The waiting time for assistance depends on both the MTS priority and the ED's overcrowding. 4.2.1.2. Choosing the grain The grain refers to the level of detail at which records in a table are unique. In an ideal scenario, this uniqueness is captured by a single column known as the unique primary key, which is a non-null column in a database object that uniquely identifies each row. However, even with a unique ID, there is descriptive information that provides context or additional detail behind that unique identifier. The grain is determined by the combination of all dimensions. Taking into account the objective of the project, here are the defined fact tables in the Data Warehouse design. 1) Inpatient The analysis of the inpatient process will include the count of patients as measures in a specific date, time, for a specific inpatient, for a specific diagnosis, specific triage (Manchester Triage color code priority) and specific checkout condition. Patient Emergency Department (ED) Admission [1] •Admission date string, day of the month, week of the year, month Wainting triage minutes [2] Patient Triage using Manchester Triage System [3] •Blue, green, yellow, orange and red •Non-urgent, standard, urgent, very urgent and immediate Waiting time assistance minutes [4] Patient Medical Assistance [4] •Diagnosis, description diagnosis and diagnosis group Check Out Condition •leave ED, Hospital, death 15 2) Outpatient The analysis of the outpatient process aims to allow the comparison of the number of patients attending hospital consultations and the number of patients already admitted to a ward. This comparison is then made with the number of inpatients at C.H.U.L.N.'s ED. The information regarding the number of patients already admitted to a ward will be presented within the same dimension - the ward dimension. The information regarding the number of patients attending hospital consultations will be presented in another dimension - the medical appointment dimension. As it is possible to see on C.H.U.L.N.'s chart presented below, the organization of C.H.U.L.N. is complex. Therefore, the best solution to avoid redundancy was the creation of sub-dimensions for each ward service. It is important to remember that this project is centered on the Adult Care emergency department, so the pediatric services were not considered. It is also important to explain that not all medical specialties have a ward service, so only those with nursery service were considered. Figura 6 - Organogram CHLN 2016 4.2.1.3. Identification and confirming the dimensions In this stage, the task at hand is to construct a set of dimensions that establish the context for querying the facts stored in the fact table. The selected dimensions for each fact table are as follows: 16 1) Dimensions connected to Fact_Emergency_Assistance Dimensions to be used in the analysis of Inpatient are the dimension of time, date, patient class, Diagnosis, Triage and CheckOut condition. 2) Dimensions connected to Outpatient Fact Table The dimensions to be used in the outpatient analysis are time, date, ward patients and medical appointment patients. The medical appointment dimension encompasses patients who visited the hospital for either a consultation or an appointment at a day hospital. Each C.H.U.L.N.’s ward presents a dimension, making it possible for a thorough analysis of the ward patients, but also a generalized one. 4.2.1.4. Choosing the facts At this stage there will be the selection of facts to be used on the Inpatients and Outpatients as fact tables. 1) Fact Emergency_Assistance The facts chosen for usage in the Fact_Emergency_Assistance table consist of fk_time, fk_date, fk_diagnosis, fk_triage, fk_checkout, count_of_patients, waiting_time_triage_minutes and waiting_time_assistance_minutes. Table 1 - Fact Emergency_Assistance Column Data Type Length fk_time DateTime fk_date DateTime fk_patient_class Number fk_diagnosis Number fk_triage Number 5 fk_checkout Number 4 count_of_patients Number waiting_time_triage_minutes Number waiting_time_assistance_minutes Number 2) Fact Outpatient 23 enhancing the overall quality of care and patient outcomes. However, it should be noted that this hypothesis is intended for future execution of the project. 4.5. COMMUNICATION The communication phase will involve a presentation at NOVA-IMS and, potentially, the publication of a journal article to showcase the project. 24 5. DISCUSSION Data warehousing is a good solution to aggregate all the information in C.H.U.L.N.'s ED in order to develop projects using said information. The aim of this thesis was to develop the C.H.U.L.N.'s ED data warehouse project in order to ultimately create an algorithm. The algorithm will focus on predicting the C.H.U.L.N.'s ED affluence. So, the data warehouse is focused on that objective. To define the fact tables and each dimension, it was necessary to understand what already exists about emergency department’s prediction algorithms, what has been studied, and what has shown good results. However, it is important to understand that each healthcare institution is singular, as it is possible to realize through the existing literature. The C.H.U.L.N.'s ED data warehouse was projected focusing on the particular elements that characterize the department. The existing literature about the data warehousing of healthcare institutions is informative, although limited and not recent. Recent works already focus on the generation and interpretation of report results. However, despite advanced BI development, the investment in this area in the Portuguese NHS still falls short of what would be desirable. So, although the future purpose of this project is to create an algorithm, the present purpose was to start where it was necessary, to start from the beginning. The benefits of the different data warehouse schemas are well known (Buuck, 2022) (Data Warehousing 2, 2023). The choice of the snowflake schema rests on the characteristics of C.H.U.L.N.'s ED and on the knowledge obtained in the literature review. Considering the aim of predicting the C.H.U.L.N.'s ED patient influx, the fact tables and each dimension were defined based on the information that is made available in the ED program - ALERT - and the conclusions of the literature review. The available studies showed that the best accuracy prediction algorithms used neural networks with deep learning. (What is deep learning?, s.d.) However, there are also interesting and important works with other models, such as ARIMA (Yan Sun PhD, 2011) and LSTM (Xinxing Zhao, 2022). From what has been learned from the existing literature, to achieve a good accuracy algorithm in this field, it is important to include health records such as age, sex, admission diagnosis and patient's priority (in C.H.U.L.N.’s ED case based on MTS). Therefore, these variables were included in C.H.U.L.N.'s ED DWH. Regarding weather conditions, there were non-consensus results. Therefore, considering the increasing meteorological unpredictability due to climate change, it was decided not to include meteorology as a variable (M Wargon, 2009). Statistically, it appears that local events and holidays influence attendance at the emergency service; however, direct integration of this data into the data warehouse is not possible. Potentially, the influence of local events, which repeat themselves over time on a regular basis, will be seen in the attendance pattern itself. Empirically, it is known that certain events, such as an increase in the number of visits to the nearest pediatric hospital or the closure of the emergency area in neighboring hospitals, tend to increase the number of visits to C.H.U.L.N.'s ED. Once again, this data is not directly included in C.H.U.L.N.'s DWH. In the future, it will be possible to verify the validity of these hypothesis through the analysis of reports. 25 Although the nature of the institution seems to be important, C.H.U.L.N. has the particularity of being a third level hospital, which means that it will receive patients from many other places, which makes the rational use of the place unfeasible as a variable. For all the reasons previously explained, “Fact_Outpatient” was defined, corresponding to patients admitted to the emergency room. Due to the fact that C.H.U.L.N. is a hospital with unique characteristics and an influx influenced by external and internal factors, it was thought to be important and interesting to conduct a comparative analysis with the influx of inpatients and patients in consultation/day hospital. The first phase will involve the implementation of C.H.U.L.N.'s ED DWH project, including testing and further improvement based on the obtained results. The second phase will focus on the development of an algorithm, leveraging queuing theory. Queuing theory, a branch of probability, studies the formation of queues through precise mathematical analysis and measurable properties. The objective is to optimize the staffing of C.H.U.L.N.'s ED. The influx forecast generated by the algorithm, applied by using queuing system theory, aims to adjust the required number of staff for each shift based on the forecasted demand. This approach intends to achieve a more effective and efficient management of the staff, ultimately promoting better patient care. 26 6. CONCLUSION The application of BI methods in healthcare is essential to the continued development of health care, its profitability and sustainability. However, the application of those methods faces challenges different from those faced in other areas of intervention. Although the efforts through the years and development of BI and artificial intelligence in healthcare, there is still a long way to go. The application possibilities are numerous; however, further studies are needed to identify the ideal solutions and to make these solutions accepted within the healthcare community. 27 REFERENCES A K Diehl, M. D. (1981). Use of calendar and weather data to predict walk-in attendance. The Southern Medical Journal. Abdulaziz Ahmed, O. A. (2022). An integrated optimization and machine learning approach to predict the admission status of emergency patients. Expert Systems with Applications. Adam M Wilson, C. P. (2005). Air pollution, weather, and respiratory emergency room visits in two northern New England cities: an ecological time-series study. Environmental Research, 312-21. Allan Cameron, K. R. (2015). A simple tool to predict admission at the time of triage. Emergency Medicine Journal, 174-9. Buuck, B. (31 de 5 de 2022). Schemas Used in Data Warehouses: Star, Galaxy, and Snowflake. Obtido de StreamSets: https://streamsets.com/blog/schemas-data-warehouses-star-galaxy-snowflake/ C Linares, J. D. (2008). Impact of high temperatures on hospital admissions: comparative analysis with previous studies about mortality (Madrid). European Journal of Public Health, 317-22. Carlos Narciso Rocha, F. R. (2021). Forecasting emergency department admissions. Journal of Intelligent Information Systems. Clare Allison Parker, N. L. (2019). Predicting hospital admission at the emergency department triage: A novel prediction model. The American Journal of Emergency Medicine, 1498-1504. D R Holleman Jr, R. L. (1996). Predicting daily visits to a walk-in clinic and emergency department using calendar and weather data. Journal of General Internal Medicine. Daily New Cases in Portugal. (17 de January de 2023). Obtido de worldometer: https://www.worldometers.info/coronavirus/country/portugal/#graph-cases-daily Data Warehouse Architecture Explained. (29 de 10 de 2020). Obtido de phoenixNAP GLOBAL IT SERVICES: https://phoenixnap.com/kb/data-warehouse-architecture-explained Data Warehousing - Schemas. (s.d.). Obtido de tutorialspoint: https://www.tutorialspoint.com/dwh/dwh_schemas.htm Data Warehousing 2. (2023). Obtido de caserta: https://caserta.com/data-warehouse-2/ Dr. Osama E.Sheta, A. N. (2013). THE TECHNOLOGY OF USING A DATA WAREHOUSE TO SUPPORT DECISIONMAKING IN HEALTH CARE. International Journal of Database Management Systems ( IJDMS ), 5, 3. Emily Y Y Chan, W. B. (2013). Hospital admissions as a function of temperature, other weather phenomena and pollution levels in an urban setting in China. Bulletin of the World Health Organization, 576-84. Farid Kadri, M. B. (2019). An LSTM-based Deep Learning Method with Application to Predicting Hospital Emergency Department Admissions. An LSTM-based Deep Learning Approach with Application to Predicting Hospital Emergency Department Admissions. 2019 International Conference on Industrial Engineering and Systems Management (IESM). Shanghai. Gerard Espinosa, Ò. M.-v. (2002). Effects of External and Internal Factors on Emergency Department. Annals of Emergency Medicine, 693-695. 28 Giuseppe Maria Sechi, M. M.-A. (11 de May de 2020). Obtido de https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7569617/ Hevner, A. R. (2018). esign Science Research Opportunities in Health Care. Em N. Wickramasinghe, Healthcare Delivery in the Information Age (pp. 3–18). Springer. Ian Pope, H. B. (2017). A qualitative study exploring the factors influencing admission to hospital from the emergency departmenT. BMJ, e011543. Ida Bagus Leo Mahadya Suta, I. G. (2019). Design General Hospital Data Warehouse Base . International Journal of Engineering and Emerging Technology. Ines Corcuera Hotz, S. H. (2020). The Effects of Temperature on Accident and Emergency Department Attendances in London: A Time-Series Regression Analysis. International Journal of Environmental Research and Public Health. Jing Xia, S. P. (2019). A Long Short-Term Memory Ensemble Approach for Improving. Hindawi - Computational and Mathematical Methods in Medicine. Judith C Brillman, T. B. (2005). Modeling emergency department visit patterns for infectious disease complaints: results and application to disease surveillance. BMC Medical Informatics and Decision Making. K J Fullerton, V. L. (1999). The winter bed crisis--quantifying seasonal effects on hospital bed usage. QJM: An International Journal of Medicine, 199-206. Kimball vs Inmon: Which approach should you choose when designing your data warehouse architecture? (31 de October de 2021). Obtido de keboola: https://www.keboola.com/blog/kimball-vs-inmon Kimball’s Dimensional Data Modeling. (s.d.). Em H. P. Huy Nguyen, The Analytics Setup Guidebook. Holistics. Obtido de Holistics. Leah S. Honigman WarnerJessica E. Galarraga, O. L. (2018). The Impact of Hospital and Patient Factors on the Emergency Department Decision to Admit. Journal of Emergency Medicine, 249-257.e1. M Wargon, B. G. (2009). A systematic review of models for forecasting the number of emergency department visits. Emergency Med Journal, 395-399. Matheus Henrique Dal Molin Ribeiro, R. G. (2020). Short-term forecasting COVID-19 cumulative confirmed cases: Perspectives for Brazil. Chaos, Solitons & Fractals. Michael A. LaMantia, M. M.-M.-W. (2010). Predicting Hospital Admission and Returns to the Emergency Department for Elderly Patients. Academic Emergency Medicine, 252–259. Michael J. Bullard, C. V.-R. (2009). Tracking Emergency Department Overcrowding in a Tertiary Care Academic Institution. Healthcare Quarterly, 99-106. Multi-tier architecture of Data Warehouse. (5 de 5 de 2023). Obtido de geeksforgeeks: https://www.geeksforgeeks.org/multi-tier-architecture-of-data-warehouse/ Nok Cheng, A. K. (2020). Using Long Short-Term Memory (LSTM) Neural Networks to Predict Emergency Department Wait Time. Studies in Health Technology and Informatics, 199-202. Pedamkar, P. (2023). Three Tier Data Warehouse Architecture. Obtido de EDUCBA: https://www.educba.com/three-tier-data-warehouse-architecture/ 29 Qassim, A. (2018). Time Series Analysis and Forecasting for A&E Attendances and Emergency Admission in England. Towards Data Science. Rasheed El-Bouri, T. T. (2021). Machine learning in patient flow: a review. Progress in Biomedical Engineering. Robert Champion, L. D. (2007). Forecasting emergency department presentations. Australian Health Review. Rohaifa Khaldi, A. E. (2019). Forecasting of weekly patient visits to emergency department: real case study. ScienceDirect, 532–541. Sachin Chaudhary, D. P. (2011). A Critical Review of Data Warehouse. Global Journal of Business Management and Information Technology., 1, 95-103. Serviço de Urgência Central. (s.d.). Obtido de chln.min-saude: https://www.chln.min-saude.pt/index.php/asnossas-especialidades/urgencia-e-medicina-intensiva/urgencia-central Simon Andrew Jones, M. P. (2002). Forecasting demand of emergency care. Health Care Management Science, 297-305. Sinha, T. (16 de 3 de 2021). OLAP vs. OLTP: What's the Difference? Obtido de IBM: https://www.ibm.com/cloud/blog/olap-vs- oltp#:~:text=OLAP%20vs.%20OLTP%3A%20What%E2%80%99s%20the%20Difference%3F Vidya K.Sudarshan, M. B. (2021). Performance evaluation of Emergency Department patient arrivals forecasting models by including meteorological and calendar information: A comparative study. Computers in Biology and Medicine. What is deep learning? (s.d.). Obtido de ibm: https://www.ibm.com/topics/deep-learning Xinxing Zhao, K. L. (2022). A deep learning architecture for forecasting daily emergency department visits with acuity levels. Chaos, Solitons & Fractals. Yan Sun PhD, B. H. (2011). Predicting Hospital Admissions at Emergency Department Triage Using Routine Administrative Data. Academic Emergency Medicine, 18:844–850. Yan Sun, B. H. (2009). Forecasting daily attendances at an emergency department to aid resource planning. BMC Emergency Medicine. Z Rotstein1, R. W.-M. (1997). The dynamics of patient visits to a public hospital ED: a statistical model. The American Journal of Emergency Medicine.