# Question-Driven Methodology for Analyzing Emergency Room Processes Using Process Mining
## 3 Methods
### New Methodology  
This section proposes a methodology based on process mining to analyze ER processes. The methodology is based on the guidelines for process mining projects proposed in [19] and has adapted them to be question driven. The proposed methodology deals with the flexible nature of ER processes as follows:  
* FPQs are established. For each of them, it is possible to identify from the beginning the data in which the analysis should be focused. * From these data, an event log is extracted that includes only the information required for the analysis of the selected FPQ. * A list of ad hoc methods is provided to address each FPQ. * The process can be decomposed into subprocesses, and episodes can be clustered in groups that can be analyzed independently, allowing more comprehensible models to be obtained. * Moreover, process mining provides a set of tools to deal with unstructured processes: trace clustering gathers episodes into similar groups; identifying more frequent variants of how the process can be performed; and the ability of process mining algorithms, such as fuzzy miner or the one used by Disco, to ignore less frequent behaviors [19]. The proposed methodology is intended to guide a team formed by a domain expert and a process mining expert, so that they have a clear roadmap of how to apply process mining to analysis ER processes. The domain expert contributes with his/her knowledge about and insights about how ER processes are performed. The process mining expert contributes with his/her understanding of how to use the process mining techniques and how to correctly interpret their results. The methodology consists of six stages (as shown in Figure 3), as follows: (1) extracting data from HIS; (2) creating an event log (main input for process mining techniques) based on the FPQ; (3) filtering the log for any given clinical context; (4) applying data analysis; (5) applying process mining (PM) techniques; and (6) analyzing the results with the experts. Each of the stages is explained below:  
**Stage 1. ** Data extraction:  
The first stage is to identify the data, extract it from the sources, build a data model, check the presence of timestamps, name the events or activities, create any specific fields and verify the quality of the extracted data. Table 1 sums up the main activities of this stage and provides a series of guidelines to be considered during this stage. **Activity 1.1**. : Identify available data in HIS and build the data model:  
The data may be centralized in a single HIS or distributed across different information systems. A data model should be constructed, based on the reference model proposed in Section 3.1.2, while always identifying each episode with a unique episode ID. Storing data based on a data reference model facilitates data extraction and the use thereof when answering the questions of the experts. It is important at this point to bear in mind a number of challenges when constructing the data reference model, as the quality of the data is not usually optimal, and actions are required as a result. **Activity 1.2**. : Ensure the availability of a timestamp for each event:  
The first challenge is to ensure that a timestamp is present for each event of an episode. Each timestamp shows the moment in which a relevant event takes place. In addition to verifying