## 3 Development of the System
### Upload Data to Generate the Predictive Models  
The data used to generate the model were the same for the study. There are multiple tools on the market that can be used to upload data into a database. The SQL-Loader was used, which is a tool that allows to read text files and transfer the data into the tables. Once the information had been uploaded into the auxiliary tables the next step was to group the information using the framework criteria of the study:  
* Day of the week (Monday, Tuesday,... Sunday)
* Working day (Weekday, Holiday)
* Month (1 is January, 2 is February,... 12 is December)
* Year (2014, 2015, 2016, 2017)  
The grouped data provided the basis to generate the decision support system. The information was grouped with a simple SQL query. The query integrated all data and grouped them by the established criteria (month, year, working day). All the data were obtained from that date. See the Supplementary Materials which includes the source SQL that makes the inclusion of grouped information. Our decision support system was based on a theoretical study carried out by the University of Jaen and the Healthcare District. The data mining study was conducted using the following input data:  
Season data: date and number of visits to the primary care centres. Meteorological data: The meteorological data used came from two weather stations in the city of Jaen [27]. In order to integrate this information into the database the daily mean values were taken for maximum, medium and minimum temperatures, humidity and rainfall. Pollution levels: This information was provided by its source denoted as good or bad, depending on the partial index for each pollutant: sulphide dioxide SO\({}_{2}\), particles, NO\({}_{2}\) nitrogen dioxide, carbon monoxide CO and ozone O\({}_{3}\). These data were also obtained from the network REDIAM [27]. The study was conducted using data from 2014 to 2018. The model was generated with data from 2014-2017. Finally, the data from 2018 was used to validate the effectiveness of the models. Using the minimum description length algorithm (MDL) [29], the weight of each attribute over the target attribute (number of patients) was measured. This algorithm detected which attributes were not decisive for the study, and they were subsequently eliminated. The implementation of this algorithm returned a range of values between \(-1\) and \(1\). A higher positive value means that the attribute is more closely related to the attribute to predicted; however, a value of \(0\) means that there is no relationship, finally a negative value means that the attribute is not related to the target attribute and therefore may cause \begin{table}
\begin{tabular}{l l} \hline \hline
**HIST\_TABLE_GENERATION\_MODELS** & **RESULTS** \\ \hline Day\_of\_week (varchar2(20)) & Date (date) \\ Month (number) & Id\_record (number) \\ Year (number) & Day\_of\_week (varchar2(20)) \\ Working (varchar2(1)) & Month (number) \\ number visits (number) & Year (number) \\ Minimum\_temperature (number) & Working (varchar(1)) \\ Mean\_temperature (number) & Minimum\_temperature (number) \\ Maximum\_temperature (number) & Mean\_temperature (number) \\ Relative\_humidity (number) & Maximum\_temperature (number) \\ air\_quality (number) & Relative\_humidity (number) \\  & air\_quality (number) \\  & Prediction (number) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Design decision support system tables. noise in the study. In this study only those attributes with weights greater than 0 were considered, discarding all those with 0 or negative values. In the first part of the study the category discrimination method (CDM) algorithm was used. Table 3 shows the result and analyses the level of influence of the attributes on the target attribute. In this case, the target attribute is the number of patients requiring medical care in the health centre. According to the MDL algorithm attributes influenced differently on each cohort.