# Semi-Automated Approach for Building Event Logs for Process Mining from Relational Database
## 4 Results
### Construction of the Event Log
#### 4.2.3 Event Log Generated
The event log's consistency obtains a value in the lower range of the medium degree (0.450) due to the fact that a mixed granularity was identified in the level of activity abstraction, affecting the evaluation of the event log. Likewise, a mixed granularity at the log abstraction level was determined, caused by different types of formats in the event log instances. The value obtained in the uniqueness metric is since, at the trace level, several traces show the same timestamp, which may be an error in the insertion of the tuples in the relational database. The traces probably occurred in sequence but were stored with the same timestamp. On the other hand, the values achieved in the accuracy and completeness metrics are very acceptable, confirming the quality of the event log generated. Figure 9 shows the main variants retrieved from the event log of the patient's treatment process. The analysis of process variants tries to identify the differences in the traces representing the execution of the process derived from the same business process [40,41]. In the third map of the process variants, it is observed that the sequence of HO-LE activities is only executed once. However, in the discovered process diagrams, it is identified that the LE activity is of the loop type; because this behavior is infrequent, it is not represented within the main variants of the process. In the fourth variant (from top to bottom) presented in Figure 9, the sequence of LE-MI activities was executed with a return to the LE activity on continuous occasions, before and after the execution of the MI activity, which allows identifying a loop in this part of the process flow. Figure 10 shows the graph discovered using the DFG algorithm from the event log built from the process identified for the patient treatment with pneumonia symptoms. At the beginning of the business process, three paths are distinguished to start the treatment and hospitalization of the patient. After admission to the hospital, several cycles related to the laboratory exam activity are recognized; for example, between the activities laboratory exam and medical images, as well as between the activities laboratory exam and procedure. Likewise, a low-frequency sequence is distinguished in the process flow between laboratory exams, medical images, medical ward activities, and returning to the laboratory exam activity before the patient's possible discharge. In addition, several tasks have loop-like behavior in the generated event log but are discarded by the DFG algorithm due to their low frequency in the event log traces. \begin{table}
\begin{tabular}{l c c c} \hline
**Process Model** & **Precision** & **Recall** & **Generalization** \\ \hline IoT Air Quality Monitor & 1.0 & 1.0 & 0.991 \\ Repository Management Service & 1.0 & 1.0 & 0.993 \\ System Access Service & 1.0 & 1.0 & 0.980 \\ \hline \end{tabular}
\end{table} 
Table 4: Results of the quality metrics applied in the business process models discovered. \begin{table}
\begin{tabular}{l c c c} \hline
**Event Log** & **Accuracy** & **Completeness** & **Consistency** & **Uniqueness** \\ \hline Patient Treatment Process & 0.834 (high) & 0.747 (medium) & 0.450 (medium) & 0.555 (medium) \\ \hline \end{tabular}
\end{table} 
Table 5: Quality metrics calculated for patient admission event log built. Figure 11 shows the business process model based on the BPMN language, which was discovered using the split-miner algorithm. The business process flow discovered by the two algorithms is consistent in its behavior, tasks, and identified decision points. However, the split-miner algorithm distinguishes several loop-type tasks (Laboratory Exam, Medical Imagesm and Procedure) in the event log traces. Figure 10: Process model discovered using DFG algorithm for _patient treatment_ event log. Figure 9: Top 5 process variants contained in the _patient treatment_ event log. Table 6 shows the calculated values for the quality metrics of the uncovered patient treatment process model.