A Pervasive Healthcare System for COPD Patients

Chronic obstructive pulmonary disease (COPD) is one of the most severe public health problems worldwide. Pervasive computing technology creates a new opportunity to redesign the traditional pattern of medical system. While many pervasive healthcare systems are currently found in the literature, there is little published research on the effectiveness of these paradigms in the medical context. This paper designs and validates a rule-based ontology framework for COPD patients. Unlike conventional systems, this work presents a new vision of telemedicine and remote care solutions that will promote individual self-management and autonomy for COPD patients through an advanced decision-making technique. Rules accuracy estimates were 89% for monitoring vital signs, and environmental factors, and 87% for nutrition facts, and physical activities.


Introduction
COPD has a significant impact on individuals and society. Moreover, COPD represents an economic burden on the healthcare system. Statistics Canada [1], ranked COPD as the fifth leading cause of death in the country. Studies show that people with COPD are vulnerable to many natural events, environmental factors, and sudden worsening of any of the symptoms associated with this disease. Recent years have witnessed a widespread increase in the number of telemedicine projects. This kind of intervention can open a window onto the COPD patient's life to assist with self-management and prevent declines. Telehealth refers to the remote monitoring and care of patients outside of the hospital setting. Typically, these systems are used with certain chronic diseases that are associated with frequent relapses. The early detection of worsening symptoms will help patients avoid severe problems and lengthy hospital stays [2]. The role of telemedicine in COPD is still being discussed. In 2018, Dr. Jean Bourbeau, a senior scientist at the research institute of McGill University Health Center, said that "telemedicine, both its application and results, is still controversial in COPD and the monitoring of physiological parameters does not solve the problem of predicting exacerbations that could lead to early therapy and prevention of hospital admissions" [3]. Recent studies cast serious doubts on the research findings in this domain [4][5][6].
However, pulmonologists still believe that telemonitoring can play an extremely important role if used properly. Brian Carlin, a pulmonary specialist and former chairman of the COPD Alliance, confirms that recognizing the main triggers in each patient is the best health protection plan to prevent flare-ups and thereby slow the progression of the disease; this is through maintaining an active lifestyle in a controlled environment without being exposed to such triggers. Specialists in this field suggested that "it may be more valuable to build the telemonitoring and telecommunication The third part is related to system functions; the services offered by the system are divided into two main categories: (1) patient services, which include assessment of the vital signs, evaluation of the external risk factors, and estimation of the overall effects of activities. (2) caregivers' services, which are supposed to provide multi-task interfaces for real-time monitoring, decision-making, and treatment evaluation. The last part controls all background processes. Dynamicity is one of the main features of this system. It develops its facts continuously since it sends raw and derived information periodically to the data warehouses for further analysis. This cycle allows the system to update its rules and promote personalized health services. In the next section, we will learn about the methods of extracting the medical rules of COPD.

Rules Extraction
In preparation for rule extraction, we performed a data analysis, reviewed the medical guidelines, interviewed experts, and examined published sources to map biomarkers of COPD patient to various real-life patterns. A rule is a description of how a patient is affected by internal bodily characteristics and external environmental factors. Obtaining medical rules from existing resources involves information extraction, analysis, filtering unwanted data, and refining ranges of values.

Vital Signs Rules
In clinical therapy, each patient must be recognized as an individual with a unique health state. However, grouping patients with a similar medical profile is an excellent solution to treat diseases. Unlike previous works and based on this scientific principle, we studied all relevant factors according to the personal medical profile, which includes the demographic information and the clinical chart of patients.
Hurst et al. [29] and Rajeh et al. [30] identified the main physiological parameters and symptoms to be monitored. Understanding the maximum possible extent of change for each variable in different scenarios is crucial for the early detection of pulmonary exacerbations. In the next section, we will try to find out how these parameters change with COPD patients in different medical profiles and during common daily life activities. Profile differences help to explain the discrepancies in medical care received by COPD patients. Having considered the guidelines, it is recommended that we divide the population of patients into groups or quartiles according to age, gender, stage, Body Mass Index The third part is related to system functions; the services offered by the system are divided into two main categories: (1) patient services, which include assessment of the vital signs, evaluation of the external risk factors, and estimation of the overall effects of activities. (2) caregivers' services, which are supposed to provide multi-task interfaces for real-time monitoring, decision-making, and treatment evaluation. The last part controls all background processes. Dynamicity is one of the main features of this system. It develops its facts continuously since it sends raw and derived information periodically to the data warehouses for further analysis. This cycle allows the system to update its rules and promote personalized health services. In the next section, we will learn about the methods of extracting the medical rules of COPD.

Rules Extraction
In preparation for rule extraction, we performed a data analysis, reviewed the medical guidelines, interviewed experts, and examined published sources to map biomarkers of COPD patient to various real-life patterns. A rule is a description of how a patient is affected by internal bodily characteristics and external environmental factors. Obtaining medical rules from existing resources involves information extraction, analysis, filtering unwanted data, and refining ranges of values.

Vital Signs Rules
In clinical therapy, each patient must be recognized as an individual with a unique health state. However, grouping patients with a similar medical profile is an excellent solution to treat diseases. Unlike previous works and based on this scientific principle, we studied all relevant factors according to the personal medical profile, which includes the demographic information and the clinical chart of patients.
Hurst et al. [29] and Rajeh et al. [30] identified the main physiological parameters and symptoms to be monitored. Understanding the maximum possible extent of change for each variable in different scenarios is crucial for the early detection of pulmonary exacerbations. In the next section, we will try to find out how these parameters change with COPD patients in different medical profiles and during common daily life activities. Profile differences help to explain the discrepancies in medical care received by COPD patients. Having considered the guidelines, it is recommended that we divide the population of patients into groups or quartiles according to age, gender, stage, Body Mass Index (BMI), smoker, medication, and comorbidity. Identifying factors that may indicate if something is wrong with COPD patient is about to happen was a daunting task and took a long time. This study establishes 11 physical parameters that must be monitored namely, body temperature, blood pressure, heart rate, partial pressure oxygen (PaO 2 ), oxygen saturation (SpO 2 ), partial pressure carbon dioxide (PaCO 2 ), oxygen consumption (VO 2 ), respiration rate, blood pH, bicarbonate HCO 3 , and FEV1. Understanding the role of these biomarkers and their normal ranges in stable COPD patients in all potential scenarios grants us the ability to sense imminent danger. Patients were separated horizontally by gender, age, and stage; these groups have then been reclassified vertically according to the effects of BMI, smoking, medication, and comorbidities on the vital signs. To illustrate this point, we will provide an example to explain changes in heart rate with different profiles.

Heart Rate
Analysis of data obtained from medical records [31][32][33] finds that heart rate in women can be slightly different than in men. Figure 2 shows that females have a higher heart rate compared with males at all ages; this difference increases in early middle age and decreases in late adulthood. In contrast, the overall analysis shows a remarkable decline in the normal resting heart rate ( Figure 3).
Diagnostics 2019, 9,135 23 of 35 (BMI), smoker, medication, and comorbidity. Identifying factors that may indicate if something is wrong with COPD patient is about to happen was a daunting task and took a long time. This study establishes 11 physical parameters that must be monitored namely, body temperature, blood pressure, heart rate, partial pressure oxygen (PaO2), oxygen saturation (SpO2), partial pressure carbon dioxide (PaCO2), oxygen consumption (VO2), respiration rate, blood pH, bicarbonate HCO3, and FEV1. Understanding the role of these biomarkers and their normal ranges in stable COPD patients in all potential scenarios grants us the ability to sense imminent danger. Patients were separated horizontally by gender, age, and stage; these groups have then been reclassified vertically according to the effects of BMI, smoking, medication, and comorbidities on the vital signs. To illustrate this point, we will provide an example to explain changes in heart rate with different profiles.

Heart Rate
Analysis of data obtained from medical records [31][32][33] finds that heart rate in women can be slightly different than in men. Figure 2 shows that females have a higher heart rate compared with males at all ages; this difference increases in early middle age and decreases in late adulthood. In contrast, the overall analysis shows a remarkable decline in the normal resting heart rate ( Figure 3).  In the same context and in order to assess whether the expected effect of age truly has a powerful influence on changing heart rate variability, we designed the following controlling analysis paradigm. We sampled 1370 male patients aged 40 to 90 and assessed all the main characteristics such as COPD stage, gender, BMI, and comorbidities. For male patients in stage I, the results were as follows: 72.6 ± 12 beats/min for those aged 40-50 years; 69.2 ± 11 beats/min for those aged between (BMI), smoker, medication, and comorbidity. Identifying factors that may indicate if something is wrong with COPD patient is about to happen was a daunting task and took a long time. This study establishes 11 physical parameters that must be monitored namely, body temperature, blood pressure, heart rate, partial pressure oxygen (PaO2), oxygen saturation (SpO2), partial pressure carbon dioxide (PaCO2), oxygen consumption (VO2), respiration rate, blood pH, bicarbonate HCO3, and FEV1. Understanding the role of these biomarkers and their normal ranges in stable COPD patients in all potential scenarios grants us the ability to sense imminent danger. Patients were separated horizontally by gender, age, and stage; these groups have then been reclassified vertically according to the effects of BMI, smoking, medication, and comorbidities on the vital signs. To illustrate this point, we will provide an example to explain changes in heart rate with different profiles.

Heart Rate
Analysis of data obtained from medical records [31][32][33] finds that heart rate in women can be slightly different than in men. Figure 2 shows that females have a higher heart rate compared with males at all ages; this difference increases in early middle age and decreases in late adulthood. In contrast, the overall analysis shows a remarkable decline in the normal resting heart rate ( Figure 3).  In the same context and in order to assess whether the expected effect of age truly has a powerful influence on changing heart rate variability, we designed the following controlling analysis paradigm. We sampled 1370 male patients aged 40 to 90 and assessed all the main characteristics such as COPD stage, gender, BMI, and comorbidities. For male patients in stage I, the results were as follows: 72.6 ± 12 beats/min for those aged 40-50 years; 69.2 ± 11 beats/min for those aged between In the same context and in order to assess whether the expected effect of age truly has a powerful influence on changing heart rate variability, we designed the following controlling analysis paradigm. We sampled 1370 male patients aged 40 to 90 and assessed all the main characteristics such as COPD stage, gender, BMI, and comorbidities. For male patients in stage I, the results were as follows: 72.6 ± 12 beats/min for those aged 40-50 years; 69.2 ± 11 beats/min for those aged between 50-60 years; 68.70 ± 9 beats/min and 69.0 ± 10 beats/min for patients aged between 60-70 and 70-80, respectively; and 67.20 ± 9 beats/min for patients who were over the age of 80 (see Table 1). In contrast, resting heart rate increased with the severity of COPD (p < 0.005), and we can easily notice that the resting heart rate of people aged 40 to 50 rose from 72.6 ± 12 in stage I to 84.9 ± 14 in stage IV. The analysis demonstrated that smoking increases the baseline heartbeat at a rate ranging from 6 to 10 beats/min. The values provided for smokers represent the mean heart rate at rest and the differences between sample proportions in the same conditions for male patients without specifications of age, BMI, etc. Resting heart rate was also associated with both obesity and the use of inhaler medication across all stages of COPD (p < 0.004 and p < 0.003). COPD patients tend to have more health problems, and COPD is frequently associated with a range of diseases such as congestive heart failure (CHF), coronary artery disease (CAD) or ischemic heart disease (IHD), pulmonary hypertension (PH), gastroesophageal reflux disease (GERD), high blood pressure (HBP), asthma, and anemia. The change in heart rate was only associated with four comorbidities, CHF, anemia, PH, and asthma, while HBP, IHD, and GERD were not statistically significant. One of the key factors that changes heart rate is activity. Heart rate differs from person to person during exercise or when doing any physical effort; this variation is determined by mathematical equations with an acceptable degree of accuracy. Activity would be classified into four categories: the first is sedentary, which requires the least amount of effort, or in other words, the minimal rate of oxygen consumption (e.g., sleeping, sitting, or lying down), the second category is called light-intensity activities (e.g., walking slowly, eating, preparing food, showering); the third category is defined as moderate physical activity (e.g., walking briskly, gardening, household cleaning); and the fourth category is the vigorous intensity level (e.g., jogging/running, swimming, walking upstairs, sports, carrying a heavy load).
In summary, this evidence-based analysis proves that heart rate varies depending on the medical profile of the patient, which in turn will affect the stable ranges of this vital sign during physical activities. The same analytical methodology has been used on the other physiological parameters mentioned above.

Indoor Rules
According to the Healthy Environments and Consumer Safety Branch (HECSB), Canadians spend approximately 90% of their life indoors [34], often due to the extreme nature of the climate. Therefore, it is very important to pay attention to the quality of that indoor air, temperature, humidity, and pressure, especially as COPD patients must live in a safe environment, away from any kind of irritants. Based on the outcomes of a wide range of studies [35][36][37][38][39][40][41][42][43][44][45][46][47] that addressed internal environmental conditions, we were able to draw up safe limits for all indoor climate factors. The foundations of internal protection have been translated into a hierarchical tree, as shown in Figure 4. In some cases, the indoor thresholds defined as comfortable have no significant correlation with the medical profile of the patient, while in other cases these thresholds were highly correlated with the severity of the patient profile. Reviewing all these factors in detail requires a lot of space, so we will simply list some of the existing findings. study demonstrated that the optimal respiratory recordings were obtained at and above 21 °C in the living room and at least 9 h at 18 °C in the bedroom during the night. Mu et al. [36] found that indoor temperature should be kept to an average of 18.2 °C. The WHO's annual world health statistics report recommends that for certain groups such as people over the age of 65, the minimum indoor warmth threshold is 20 °C, but there is no evidence that these findings are applicable to chronic pulmonary diseases [37,38]. The COPD Foundation's Slim Skinny Reference Guide (SSRG) [39] and Excellus BlueCross BlueShield [40] suggested keeping the indoor humidity below 40% and above 30%, respectively, to avoid harmful influences. Indoor pressure has a significant effect on breathing; it has been shown that negative pressure indoors may introduce harmful pollutants [41,42]. Generally, positive air pressure means that the indoor space is supplemented with 5 Pa/0.02 WC of filtered air with respect to the outside atmospheric pressure [43]. In multiple rooms, the most sensitive areas or places where the patient stays for a long time during the day should be the most highly pressurized. However, Ansley [44] indicated in an indirect manner that air pressure inside the chamber could be maintained at sea level. The standard sea-level pressure, by definition, equals 101.3 kPa = 760 mmHg [45].  Osman et al. [35] conducted an experiment on a sample of 254 participants; the mean age of patients was 69 years, with SD = 8.2; 45% of them were male. The sample included mild, moderate, and severe stages; smokers and non-smokers. Osman aimed at exploring whether the health status of COPD patients was associated with the recommended standards of indoor temperatures. This study demonstrated that the optimal respiratory recordings were obtained at and above 21 • C in the living room and at least 9 h at 18 • C in the bedroom during the night. Mu et al. [36] found that indoor temperature should be kept to an average of 18.2 • C. The WHO's annual world health statistics report recommends that for certain groups such as people over the age of 65, the minimum indoor warmth threshold is 20 • C, but there is no evidence that these findings are applicable to chronic pulmonary diseases [37,38]. The COPD Foundation's Slim Skinny Reference Guide (SSRG) [39] and Excellus BlueCross BlueShield [40] suggested keeping the indoor humidity below 40% and above 30%, respectively, to avoid harmful influences. Indoor pressure has a significant effect on breathing; it has been shown that negative pressure indoors may introduce harmful pollutants [41,42]. Generally, positive air pressure means that the indoor space is supplemented with 5 Pa/0.02 WC of filtered air with respect to the outside atmospheric pressure [43]. In multiple rooms, the most sensitive areas or places where the patient stays for a long time during the day should be the most highly pressurized. However, Ansley [44] indicated in an indirect manner that air pressure inside the chamber could be maintained at sea level. The standard sea-level pressure, by definition, equals 101.3 kPa = 760 mmHg [45].
Air pollution is considered to be one of the common triggers of exacerbations. Sometimes, pollutant levels in houses may be tens of times higher than the guidelines for outdoor air quality. Therefore, indoor air quality is a concern and must be monitored around the clock. Wang et al. [46] developed an indoor air quality index (IAQI) system based on the health risk assessment. The proposed IAQI is similar to the air quality index (AQI) developed by the U.S. Environmental Protection Agency Diagnostics 2019, 9, 135 9 of 35 (EPA). In this research, Wang suggested setting the health protection threshold of indoor air quality to 150 points for people with respiratory illnesses. In the same context, Saad et al. [47] presented another indoor environmental index. The IAQI value and status are divided into four categories: good (100-76), normal , unhealthy , and hazardous (25-0). Saad mentioned in his project that only good and moderate levels are appropriate for sensitive groups of people. The regulations for safe indoor air quality in these two indicators are almost identical, and we will adopt the most stringent index in case of different values. Indoor air quality is generally assessed by separately measuring major air pollutants such as PM10, PM2.5, O 3 , CO, CO 2 , HCHO, TVOC, bacteria, fungi, NO 2 , and SO 2 .

Outdoor Rules
There are several reasons why healthy outdoor environments are important for COPD patients. Unlike the internal environment, we cannot control the external environmental factors. There are six main factors that affect the patient: outdoor temperature, humidity, wind speed, precipitation, atmospheric pressure, and air quality. As with physiological parameters and internal environmental conditions, and considering space constraints, we will try to give a clear picture of how to select safe external environmental ranges.
In research and clinical trials provided by [35,[48][49][50][51][52][53][54], respiratory problems and exacerbations was highly correlated to the outdoor temperature. For example, Madaniyazi et al. [52] investigated the relationship between variations in heart rate (HR) and blood pressure (BP), including systolic blood pressure and diastolic blood pressure, and seasonal changes in ambient temperature. This work classified participants based on a set of physical and social characteristics such as age, sex, BMI, habits, physical activity, dietary habits, income, education level, work type, and medical history. The analysis concluded that cold and hot weather had an evident impact on HR and BP, but in different proportions according to the individual information of each patient. In general, for prolonged exposure to cold weather in the total population, a 1 • C decrease of mean temperature below the threshold temperature (which was estimated to be 22 and 27 • C for HR and BP, respectively) was linked to a 0.063 beats/min increase in HR, a 0.129 mmHg increase in SBP, and a 0.065 mmHg increase in DBP. On the other hand, hot weather was positively correlated with heart rate and blood pressure, a 1 • C increase in mean temperature above the threshold (previously mentioned) was associated with a 0.133 beats/min increase in HR, a 0.605 mmHg increase in SBP, and a 0.128 mmHg increase in DBP [52]. In the same context, Donaldson et al. [53] studied the effect of temperature on lung function and symptoms in COPD. The authors found that forced expiratory volume in one second (FEV1) and forced vital capacity (FVC) fell remarkably by a median of 44.9 mL (at 2.20 mL· • C −1 outdoors and range: -113,-229 mL) and 74.2 mL (at 3.64 mL· • C −1 outdoors and range -454,-991 mL), respectively, between the warmest weeks, with a mean temperature of 21.1 • C and coldest weeks with a mean temperature of 0.78 • C. The size of the effect was somewhat similar in the research done by [54], with a 0.71% and 0.59% decrease of FEV1 for every 10 • F increase in mean annual ambient temperature, which is estimated to be around 57 • F in two cohort studies. The flowchart in Figure 5 gives a summary of these extended reflections related to the outdoor temperature.
The environmental air consists of approximately 78% nitrogen (N 2 ), 21% oxygen (O 2 ), and 1% other gases, 0.038% of them for carbon dioxide (CO 2 ) [55][56][57]. At sea level, where the standard barometric pressure is 760 mmHg, the estimated partial pressures of these three gases can be 593 mmHg for N 2 , 160 mmHg for O 2 , and 0.02 mmHg for CO 2 [55]. At high altitude, the atmospheric pressure that is acting on the air gases is significantly less than the ordinary pressure at sea level. Therefore, the oxygen molecules in the air are spread further apart, reducing the oxygen concentration in the air and thus reducing the oxygen saturation in the blood [58], which can pose risks to people with COPD. There are several references describing the ratios of both oxygen and carbon dioxide with the change in altitude, temperature, and pressure [59]. These reference charts help us to develop the first layer of protection rules. The environmental air consists of approximately 78% nitrogen (N2), 21% oxygen (O2), and 1% other gases, 0.038% of them for carbon dioxide (CO2) [55][56][57]. At sea level, where the standard barometric pressure is 760 mmHg, the estimated partial pressures of these three gases can be 593 mmHg for N2, 160 mmHg for O2, and 0.02 mmHg for CO2 [55]. At high altitude, the atmospheric pressure that is acting on the air gases is significantly less than the ordinary pressure at sea level. Therefore, the oxygen molecules in the air are spread further apart, reducing the oxygen concentration in the air and thus reducing the oxygen saturation in the blood [58], which can pose risks to people with COPD. There are several references describing the ratios of both oxygen and carbon dioxide with the change in altitude, temperature, and pressure [59]. These reference charts help us to develop the first layer of protection rules.
The barometric and hypsometric formula for altitudes between 0 km and 11 km is depicted in the next equation: P = 760 × (1 − Hb/4430.76923) 5.255876 provided by [60], where the pressure P and the altitude Hb are expressed in mmHg and m, respectively. The analysis of physiological responses to extreme atmospheric pressure revealed the presence of a significant direct relationship. In a metaregression study, Mingi et al. [61] have shown an incremental increase in the prevalence of hypertension by 2% with every 100 m rise in altitude. This higher pressure means that the heart must work harder to pump blood through the arteries [62]. At the same time, exposure to low barometric pressure must result in a decrease in the PaO2 in alveoli, leading to reduced oxygen blood saturation (SpO2) [55,63]. Given the varying severity of COPD, Dillard et al. [64], developed equations to estimate PaO2 at high altitude, incorporating PaO2 on the ground and FEV1% predicted. The partial The barometric and hypsometric formula for altitudes between 0 km and 11 km is depicted in the next equation: P = 760 × (1 − H b /4430.76923) 5.255876 provided by [60], where the pressure P and the altitude H b are expressed in mmHg and m, respectively. The analysis of physiological responses to extreme atmospheric pressure revealed the presence of a significant direct relationship. In a meta-regression study, Mingi et al. [61] have shown an incremental increase in the prevalence of hypertension by 2% with every 100 m rise in altitude. This higher pressure means that the heart must work harder to pump blood through the arteries [62]. At the same time, exposure to low barometric pressure must result in a decrease in the PaO 2 in alveoli, leading to reduced oxygen blood saturation (SpO 2 ) [55,63]. Given the varying severity of COPD, Dillard et al. [64], developed equations to estimate PaO 2 at high altitude, incorporating PaO 2 on the ground and FEV1% predicted. The partial pressure of oxygen in the COPD patient's arterial blood (PaO 2 ) with baseline FEV1 below 1.5 L should be evaluated prior to high-altitude travel to determine whether the lung conditions require supplemental oxygen based on the regression equation provided by Dillard [64]: P a O 2 altitude = (0.5196 × P a O 2 sea level ) + (11.856 × FEV1) -1.76. Netzer et al. [65] verified the findings related to fluctuations of SpO 2 and heart rate during a mountain hike; the authors found that SpO 2 values are significantly lower and heart rate values are significantly higher in a high-altitude environment. In the same context, Maldonado et al. [66] assessed the risks in the highlands through comparing the effects of the lower barometric pressure on COPD patients at rest and during exercise. The study provided a detailed description of endurance time, inspiratory capacity, arterial blood gases, and lactate. Rules of barometric pressure at high altitude help patients to tell if it is safe for them to travel to intermediate altitude. Briefly, altitude exposure is not recommended for patients with severe COPD; however, these rules could minimize the risk of adverse effects, and determine the level of physical activity to ensure optimal health and prevent exacerbations. Based on this information, we developed an algorithm that evaluate the effect of low barometric pressure on air compounds (O 2 and CO 2 ) and air temperature, which are reflected in the vital signs of the body such as SpO 2 , heart rate, respiration rate, and PaCO 2 (see Figure 6). The proposed rules check the altitude periodically or when needed to calculate the change in the biological parameters, as shown in Figure 7.
supplemental oxygen based on the regression equation provided by Dillard [64]: PaO2 altitude = (0.5196 × PaO2 sea level) + (11.856 × FEV1) -1.76. Netzer et al. [65] verified the findings related to fluctuations of SpO2 and heart rate during a mountain hike; the authors found that SpO2 values are significantly lower and heart rate values are significantly higher in a high-altitude environment. In the same context, Maldonado et al. [66] assessed the risks in the highlands through comparing the effects of the lower barometric pressure on COPD patients at rest and during exercise. The study provided a detailed description of endurance time, inspiratory capacity, arterial blood gases, and lactate. Rules of barometric pressure at high altitude help patients to tell if it is safe for them to travel to intermediate altitude. Briefly, altitude exposure is not recommended for patients with severe COPD; however, these rules could minimize the risk of adverse effects, and determine the level of physical activity to ensure optimal health and prevent exacerbations. Based on this information, we developed an algorithm that evaluate the effect of low barometric pressure on air compounds (O2 and CO2) and air temperature, which are reflected in the vital signs of the body such as SpO2, heart rate, respiration rate, and PaCO2 (see Figure 6). The proposed rules check the altitude periodically or when needed to calculate the change in the biological parameters, as shown in Figure 7.   supplemental oxygen based on the regression equation provided by Dillard [64]: PaO2 altitude = (0.5196 × PaO2 sea level) + (11.856 × FEV1) -1.76. Netzer et al. [65] verified the findings related to fluctuations of SpO2 and heart rate during a mountain hike; the authors found that SpO2 values are significantly lower and heart rate values are significantly higher in a high-altitude environment. In the same context, Maldonado et al. [66] assessed the risks in the highlands through comparing the effects of the lower barometric pressure on COPD patients at rest and during exercise. The study provided a detailed description of endurance time, inspiratory capacity, arterial blood gases, and lactate. Rules of barometric pressure at high altitude help patients to tell if it is safe for them to travel to intermediate altitude. Briefly, altitude exposure is not recommended for patients with severe COPD; however, these rules could minimize the risk of adverse effects, and determine the level of physical activity to ensure optimal health and prevent exacerbations. Based on this information, we developed an algorithm that evaluate the effect of low barometric pressure on air compounds (O2 and CO2) and air temperature, which are reflected in the vital signs of the body such as SpO2, heart rate, respiration rate, and PaCO2 (see Figure 6). The proposed rules check the altitude periodically or when needed to calculate the change in the biological parameters, as shown in Figure 7.   Research in the medical domain in recent years has confirmed that short-and long-term exposure to air pollutants increases the risk of COPD exacerbations [67,68]. Compliance with environmental regulations and standards decreases the levels of air pollution and reduces the exacerbation burden of COPD. Many countries and organizations are using the air quality index in assessing the concentrations of air pollutants. However, there is a lack of studies about the clinical adverse effects of outdoor air pollution on COPD patients. The pollutants in the surrounding air can be classified into primary and secondary types depending on the compounds and formation process. Several evidence-based policies and recommendations for air quality have been developed to reduce the impacts of pollution on human health and safety. In this work we adopted the various Canadian air quality objectives and standards: the Canadian National Ambient Air Quality Objectives [69], the standards for the atmospheric quality throughout the territory of Québec [70], the Ambient Air Quality Criteria (AAQCs) [71] developed by the Ontario Ministry of the Environment and Climate Change, and the British Columbia Ambient Air Quality Objective [72]. These standards helped us to create four levels of protection based on the profile of the patient.
Traditional information indicates that optimum humidity levels range from 30% to 60%, but Tseng [49] found that a lower humidity level, starting at around 34%, was positively associated with parameters related to an increase in COPD exacerbation and hospital admissions with more sunshine hours. A study in Hong Kong [73] supported this contention that dry air may aggravate symptoms, noting that the respiratory system of COPD patients seems to be protected by humidity contained in the air. Conversely, Freitas et al. [74] and Hayes et al. [75] demonstrated the indirect effects of high humidity and warm climate on respiratory and circulatory diseases. In this paper we developed a humidity-temperature reference to control outdoor activities and set the maximum exposure time per 24 h.

Adaptation to Dynamic Context
With the growing need to adapt services to the patient's context, we have added some vitality to the structure of the proposed rules. In this project, we used rules with dynamic threshold instead of predefined and static values. Many safe constants will not stay safe all the time. Prolonged and persistently high levels of biometrics are undesirable even if the captured values are normal to some extent. In contrast, some environmental variables may also have a negative effect if the exposure time exceeds the allowable limits or coincides with another influential factors (e.g., temperature, wind speed, and humidity). The boundaries of the safe zone are often spaced out, i.e., there is a wide margin between the high and low limits. The rules expand and minimize the safe area of humidity, heat, and air quality index automatically according to the exposure time and other related factors. For example, the safety threshold for PM10 is 0.150 mg/m 3 , but if a patient from the low-severity group stays in this room for more than 8 h, the safe zone limits will change to 0.020 mg/m 3 (see Figure 8). This process has been accomplished with the help of pulmonary specialists.

Adaptation to Dynamic Context
With the growing need to adapt services to the patient's context, we have added some vitality to the structure of the proposed rules. In this project, we used rules with dynamic threshold instead of predefined and static values. Many safe constants will not stay safe all the time. Prolonged and persistently high levels of biometrics are undesirable even if the captured values are normal to some extent. In contrast, some environmental variables may also have a negative effect if the exposure time exceeds the allowable limits or coincides with another influential factors (e.g., temperature, wind speed, and humidity). The boundaries of the safe zone are often spaced out, i.e., there is a wide margin between the high and low limits. The rules expand and minimize the safe area of humidity, heat, and air quality index automatically according to the exposure time and other related factors. For example, the safety threshold for PM10 is 0.150 mg/m 3 , but if a patient from the low-severity group stays in this room for more than 8 h, the safe zone limits will change to 0.020 mg/m 3 (see Figure  8). This process has been accomplished with the help of pulmonary specialists. This information aims at building a safe environment for COPD patients by converting this contextual schema into the SWRL rules base. These rules focus on evaluating body functions, environment information, calculating the severity profile, and outputting the right decisions.

Dataset
Gathering such different kinds of data from real sensors is subject to some practical limitations such as ethical approval, financial costs, and deployment time. Hence, researchers suggest an alternative experimental method using intelligent simulation. Based on this solution, each project can be proved operationally efficient before proceeding to the later stages of implementation. In this context, many simulation scenarios need to be performed to prove the feasibility of the proposed This information aims at building a safe environment for COPD patients by converting this contextual schema into the SWRL rules base. These rules focus on evaluating body functions, environment information, calculating the severity profile, and outputting the right decisions.

Dataset
Gathering such different kinds of data from real sensors is subject to some practical limitations such as ethical approval, financial costs, and deployment time. Hence, researchers suggest an alternative experimental method using intelligent simulation. Based on this solution, each project can be proved operationally efficient before proceeding to the later stages of implementation. In this context, many simulation scenarios need to be performed to prove the feasibility of the proposed approach. These trials include placing COPD patients in different environmental conditions with multiple shapes of everyday life activities. Human health is a very sensitive topic and must be treated with high accuracy; this means that all created scenarios should provide a representation close to everyday-life experiences in a realistic environment in terms of the weather, pollution, and other surrounding factors. The second point we need to take into consideration when we generate data is the time scale of monitoring, where long-term scenarios allow the evaluation of the dynamicity and computing paradigms of the system. The third requirement in this operational context is to consider abnormal situations or irregular events that may occur during the monitoring of COPD patients. To create realistic and effective scenarios, it is necessary to carry out a simulation over a long period of time that involves the expected activities of patients and the environmental conditions that influence the health of people suffering from COPD. There are three basic data sources to build such scenarios: (1) medical information, (2) daily life activities, and (3) the environmental conditions, as shown in Figure 9. approach. These trials include placing COPD patients in different environmental conditions with multiple shapes of everyday life activities. Human health is a very sensitive topic and must be treated with high accuracy; this means that all created scenarios should provide a representation close to everyday-life experiences in a realistic environment in terms of the weather, pollution, and other surrounding factors. The second point we need to take into consideration when we generate data is the time scale of monitoring, where long-term scenarios allow the evaluation of the dynamicity and computing paradigms of the system. The third requirement in this operational context is to consider abnormal situations or irregular events that may occur during the monitoring of COPD patients. To create realistic and effective scenarios, it is necessary to carry out a simulation over a long period of time that involves the expected activities of patients and the environmental conditions that influence the health of people suffering from COPD. There are three basic data sources to build such scenarios: (1) medical information, (2) daily life activities, and (3) the environmental conditions, as shown in Figure 9.

Real-Life Activities
There are relatively many published studies about the simulation of activities; for instance, Elbayoudi et al. [76] have simulated human behavior in intelligent domestic space. Limousine et al. [77] proposed a grammatical approach to facilitate the representation of complex indoor human activities scenarios and consider the abnormal activities using a hierarchical hidden Markov model. In a similar work, Aritoni et al. [78] presented a generative model able to define the vast majority of daily routine events that would be of interest in a real-time monitoring system. Mshali et al. [79] used a novel strategy for generating long-term realistic scenarios. The suggested approach considers the person's profile, the activities, and the logical relationships between these activities. Unfortunately, the publicly available datasets that simulate patients' activities did not consider outdoor scenarios such as driving, walking outside, running, etc. They involve only a subset of the most common indoor actions. Based on these findings, we attempted to extend the existing indoor scenarios proposed by Mshali [79] using the same approach built upon Markovian models. Many other scenarios have been built upon Markovian models; we created new sequences of expected activities, including outdoor actions that can be performed by COPD patients. These scenarios took into consideration the levels of severity and disabilities, as provided for in the international classification of functioning (ICF). This is a classification of health domain and its main related aspects; it is intended to describe how patients live with their physical or mental illness [80,81]. According to the ICF model, COPD can influence the participation of patients in practical life, or daily living activities, depending on their health conditions. Figure 10 shows the ICF model, which could be adapted for each COPD patient. As depicted in Figure 10, the ICF framework presents the functioning and disability of a patient with COPD as mutualistic interactions among five different entities: body functions and structures, activities, participation, environmental, and personal factors.

Real-Life Activities
There are relatively many published studies about the simulation of activities; for instance, Elbayoudi et al. [76] have simulated human behavior in intelligent domestic space. Limousine et al. [77] proposed a grammatical approach to facilitate the representation of complex indoor human activities scenarios and consider the abnormal activities using a hierarchical hidden Markov model. In a similar work, Aritoni et al. [78] presented a generative model able to define the vast majority of daily routine events that would be of interest in a real-time monitoring system. Mshali et al. [79] used a novel strategy for generating long-term realistic scenarios. The suggested approach considers the person's profile, the activities, and the logical relationships between these activities. Unfortunately, the publicly available datasets that simulate patients' activities did not consider outdoor scenarios such as driving, walking outside, running, etc. They involve only a subset of the most common indoor actions. Based on these findings, we attempted to extend the existing indoor scenarios proposed by Mshali [79] using the same approach built upon Markovian models. Many other scenarios have been built upon Markovian models; we created new sequences of expected activities, including outdoor actions that can be performed by COPD patients. These scenarios took into consideration the levels of severity and disabilities, as provided for in the international classification of functioning (ICF). This is a classification of health domain and its main related aspects; it is intended to describe how patients live with their physical or mental illness [80,81]. According to the ICF model, COPD can influence the participation of patients in practical life, or daily living activities, depending on their health conditions. Figure 10 shows the ICF model, which could be adapted for each COPD patient. As depicted in Figure 10, the ICF framework presents the functioning and disability of a patient with COPD as mutualistic interactions among five different entities: body functions and structures, activities, participation, environmental, and personal factors.
Based on this framework, Bui [82] discussed the physical capacity for various body structures and functions of COPD patients, while Alda [83] studied the association between activities and participation components and the grades of patients' airflow limitation. In the same context, Marilyn [84] showed the types of physical activities performed by COPD patients. All these facts were combined in one algorithm to extract a series of daily activities in accordance with the medical and personal profile of the patient in terms of demographic characteristics and physical ability.
These daily life activities of COPD patients have been divided into six successive sequences associated with six time periods from sunrise to sunset. Each of these sequences consists of a set of coordinated activities, with a random duration created through transition probabilities matrices. The matrix was filled in a systematic and deliberate manner, where high probability values were given to all the possible events that might occur during a specified period of the daytime, such as driving to work between 8:00 a.m. and 9:00 a.m. or having lunch between 2:00 p.m. and 4:00 p.m. The generated dataset comprises most of the main activities and their related actions that are deduced according to the patient's ability to perform activities of daily living either with or without the help of others. Based on this framework, Bui [82] discussed the physical capacity for various body structures and functions of COPD patients, while Alda [83] studied the association between activities and participation components and the grades of patients' airflow limitation. In the same context, Marilyn [84] showed the types of physical activities performed by COPD patients. All these facts were combined in one algorithm to extract a series of daily activities in accordance with the medical and personal profile of the patient in terms of demographic characteristics and physical ability.
These daily life activities of COPD patients have been divided into six successive sequences associated with six time periods from sunrise to sunset. Each of these sequences consists of a set of coordinated activities, with a random duration created through transition probabilities matrices. The matrix was filled in a systematic and deliberate manner, where high probability values were given to all the possible events that might occur during a specified period of the daytime, such as driving to work between 8:00 a.m. and 9:00 a.m. or having lunch between 2:00 p.m. and 4:00 p.m. The generated dataset comprises most of the main activities and their related actions that are deduced according to the patient's ability to perform activities of daily living either with or without the help of others.
In this project, 18 typical activities, describing the behaviors of COPD patients in public life, have been considered. Some of the indoor activities were taken from the proposed list in [85], while a range of activities was added based on the patient's needs outside of the home setting. The activities selected are: eating, dressing, driving, walking, jogging, running, traveling, washing, toileting, housekeeping, laundry, cooking, telephone use, taking medication, watching TV, reading, and sleeping. Figure 11 provides a graphical interpretation of the probabilities of transitions followed to generate a random activities sequence within the given interval of time between 4:00 and 6:00 p.m. Moreover, for greater accuracy in the generation of the realistic scenarios, Mshali [79] added In this project, 18 typical activities, describing the behaviors of COPD patients in public life, have been considered. Some of the indoor activities were taken from the proposed list in [85], while a range of activities was added based on the patient's needs outside of the home setting. The activities selected are: eating, dressing, driving, walking, jogging, running, traveling, washing, toileting, housekeeping, laundry, cooking, telephone use, taking medication, watching TV, reading, and sleeping. Figure 11 provides a graphical interpretation of the probabilities of transitions followed to generate a random activities sequence within the given interval of time between 4:00 and 6:00 p.m. Moreover, for greater accuracy in the generation of the realistic scenarios, Mshali [79] added additional constraints that bound the frequency [f min , f max ] of each activity and the total duration [D min , D max ] of the sequence; for more details, see [85]. In addition to the previous restrictions, the process of building the data must consider the types of activities that the COPD patient can do, as stated in the ICT framework. In other words, adhering to a realistic representation requires respect for the constraints of the physical capacity profile of patients of whatever age or stage.
A small sample of the data is presented in Table 2.  A small sample of the data is presented in Table 4.

Environmental Conditions
Assembling environmental data was easier, in that we found many open sources that describe the environmental conditions of indoor and outdoor spaces over long intervals. One of the most interesting outdoor datasets for environmental information was published by the Ministry of Environment and Climate Change Strategy in British Columbia, Canada [86]. These datasets contain continuous readings of meteorological and pollutant indexes from air quality monitoring stations across the province from 1980 until the end of 2017.
The Canadian environment has extreme climatic conditions that include unusual and unpredictable weather. The published dataset contains meteorological time series encompassing temperature in degrees Celsius, relative humidity in percent, wind speed in meters per second, wind direction in degrees from true north/azimuth, precipitation in millimeters, and barometric pressure

Environmental Conditions
Assembling environmental data was easier, in that we found many open sources that describe the environmental conditions of indoor and outdoor spaces over long intervals. One of the most interesting outdoor datasets for environmental information was published by the Ministry of Environment and Climate Change Strategy in British Columbia, Canada [86]. These datasets contain continuous readings of meteorological and pollutant indexes from air quality monitoring stations across the province from 1980 until the end of 2017.
The Canadian environment has extreme climatic conditions that include unusual and unpredictable weather. The published dataset contains meteorological time series encompassing temperature in degrees Celsius, relative humidity in percent, wind speed in meters per second, wind direction in degrees from true north/azimuth, precipitation in millimeters, and barometric pressure in kilopascals. In addition to the meteorological data, the monitoring stations in British Columbia recorded the air quality health index, the level of carbon monoxide in parts per million, hydrogen sulfide and total reduced sulfur in ppb, nitric oxide in parts per billion, nitrogen dioxide in ppb, sulfur dioxide (SO 2 ) in ppb, ground-level ozone in ppb, particulate matter with a diameter of 2.5 µm or less in micrograms per cubic metre (µg/m 3 ), and particulate matter with a diameter of 10 µm or less in µg/m 3 . The dataset pertaining to environmental elements follows the form date, time, longitude, latitude, altitude, temperature, humidity, wind speed, wind direction, precipitation, barometric pressure, carbon monoxide, hydrogen sulfide, sulfur, nitric oxide, nitrogen dioxide, sulfur dioxide, ozone, PM 2.5, and PM 10. Some of the data is provided in Tables 3 and 4. Simulation of the internal environment is also important when the patient spends most of his/her time at home. The indoor data are tracked via GAMS environmental monitoring company, Shanghai [87]. The indoor air quality dataset contains temperature, humidity, carbon dioxide (CO 2 ), volatile organic compounds (VOC), particulate matter with a diameter of 2.5 µm (PM2.5), and particulate matter with a diameter of 10 µm (PM10). The structure of the indoor environment dataset consists of date, time, indoor temperature, indoor humidity, CO 2 , VOC, PM 2.5, and PM10 (see Table 5).

Medical Profile
Medical profiles are vital in ensuring the validation process. In this context, we have collected thousands of electronic medical records, hospital admission data, and measures of outcome in clinical studies from different medical sources (MIR Clinic [32] and Al-Sahel Hospital [31]). As we can see in the Table 6, these datasets contain specific information about age, gender, weight, height, BMI, smoking, comorbidities, medications, the mMRC dyspnea scale, the stage of COPD, normal baseline vital signs such as body temperature, diastolic blood pressure, systolic blood pressure, heart rate, partial pressure oxygen (PaO 2 ), oxygen saturation (SpO 2 ), partial pressure carbon dioxide (PaCO 2 ), oxygen consumption (VO 2 ), respiration rate, pH, HCO 3 , and a spirometry test that includes FEV1, VC, FVC, FEV1/VC, FEV1/FVC, PEF, PEF2575, ELA, FET, FEF25%, FEF50%, FEF75%, EVol, MVVcalc, FIVC, FIV1 FIV1/FIVC, and PEF. These datasets contain an incremental cycle test (ICT) and a six-minute walking test (6MWT), which would give us a clear understanding of the upper and lower limits of the physiological parameters of patients during sedentary, light, moderate, and vigorous activity.

Implementation
As seen in the previous section, the experimental available datasets consist of values collected at different observational units. So, we synchronized the time scale between these data without affecting the accuracy, and mapped the simulated representation of the real-life activity with corresponding vital signs, according to the medical file. Therefore, the new dataset consists of three fully connected observations, the activities that have been generated using the MATLAB, the environmental conditions that are captured by real sensors, and the biomarkers that are obtained from medical sources. The simulated scenarios revolve around creating sequential records over a 12-month period for COPD patients with different levels of disease severity and autonomy. Each record is a description of the activities performed, the environmental factors, and the vital signs at a certain time. The objective of this process was to create a dataset of the COPD parameters associated with variation in the bodily activity and surrounding factors. The obtained databases consist of a total of 104 parameters, giving distinct advantages over previous studies even though the accuracy is unknown. For example, this dataset utilizes the best available environmental characteristics dataset for weather conditions and outdoor pollutants in Canada; it also uses real-indoor observations taken from a credible research project. The sequences of daily living activities were generated through Markov models and algorithms for probabilistic logic, while the medical profile has been issued by reliable medical sources. To prove the advantages of this work, we conducted many experimental simulations for the whole scenario of biological reactions to physical activities and external influences over 12 months in 100 virtual patients. First, we considered the scenarios of COPD patients having the same level of dependency but in different stages of the disease. Secondly, we simulated COPD in elderly patients who have lost some of their physical ability by excluding some kinds of autonomous activities of daily living tasks. Thirdly, for accuracy reasons, we created our simulations to compare the efficiency of this system during the winter, spring, summer, and autumn. We evaluated the performance of the proposed system for the identification of abnormal situations or patterns that may pose serious health risks for COPD patients. This evaluation consists of quantifying the level of computing or compliance with the expected time and the capacities of rules repository. COPD patients' needs change according to their medical profiles and the type of hazards. The adaptation services with these changes are an essential point to test in such a remote healthcare system; therefore, it is of paramount importance to deliver a quick and accurate response to a sudden decline in vital parameters and general health status. Using a specific amount of data, the system categorizes the monitored conditions as either normal or abnormal. In the next section, we briefly describe the implementation steps of this project using Protégé that was developed by the Stanford Center for biomedical informatics research at the Stanford University School of Medicine.
The initial implementation presented in the Figure 12 is carried out in the following manner: (1) the simulated data, stored in Excel spreadsheet files, will be uploaded directly to Ontology-based knowledge using Cellfie plugin. We constructed eight ontologies for monitoring COPD patient and representing machineunderstandable Knowledge Base. As shown in Figure 13, the developed ontologies consist of concepts related to the personal and medical profile, physical examinations, laboratory test, location, activity, environment, time, recommendations, and diseases. In OWL, properties are used to describe relationships between individuals (instances) or to attribute an XML data type (such as string, integer, etc.) to individuals. There are two main types of properties, object properties that relate individuals from two classes, and datatype properties that are We constructed eight ontologies for monitoring COPD patient and representing machine-understandable Knowledge Base. As shown in Figure 13, the developed ontologies consist of concepts related to the personal and medical profile, physical examinations, laboratory test, location, activity, environment, time, recommendations, and diseases. We constructed eight ontologies for monitoring COPD patient and representing machineunderstandable Knowledge Base. As shown in Figure 13, the developed ontologies consist of concepts related to the personal and medical profile, physical examinations, laboratory test, location, activity, environment, time, recommendations, and diseases. In OWL, properties are used to describe relationships between individuals (instances) or to attribute an XML data type (such as string, integer, etc.) to individuals. There are two main types of In OWL, properties are used to describe relationships between individuals (instances) or to attribute an XML data type (such as string, integer, etc.) to individuals. There are two main types of properties, object properties that relate individuals from two classes, and datatype properties that are used to save real data values for the individuals of classes in a specific data format. Data type and object properties play a fundamental role in the ontology. Our COPDology consists of hundreds of object and data properties.
Diagnostics 2019, 9, 135 25 of 35 properties, object properties that relate individuals from two classes, and datatype properties that are used to save real data values for the individuals of classes in a specific data format. Data type and object properties play a fundamental role in the ontology. Our COPDology consists of hundreds of object and data properties. These properties are used to define the profile of patient (e.g., hasAge, hasBMI, hasGender), to recognize location and activity (e.g., LocatedAt, EngagedIn), to characterize environment (e.g., hasIndoorTemperature, hasOutdoorPressure), or to trigger alarms and provide suggestions (e.g., hasAlarm, hasSuggestion). Figure 14 shows an example of the properties defined in our ontology. The instances were instantiated automatically in Protégé from the gathered dataset. As mentioned before, the data simulates patient conditions and environment characteristics. These individuals can provide a list of medical records, profiles, physiological signs, safe thresholds, potential risks, recommendations, and explanations to the user when running the system. Figure 15 shows an example of instances created in the ontology. This example, from left to right, illustrates symptoms, answered questions, alarms, suggestions, patient identifier, and treatment. The instances were instantiated automatically in Protégé from the gathered dataset. As mentioned before, the data simulates patient conditions and environment characteristics. These individuals can provide a list of medical records, profiles, physiological signs, safe thresholds, potential risks, recommendations, and explanations to the user when running the system. Figure 15 shows an example of instances created in the ontology. This example, from left to right, illustrates symptoms, answered questions, alarms, suggestions, patient identifier, and treatment.
Thousands of SWRL rules were used to manage the status of almost 600 COPD medical profiles in various circumstances. Both chronic and multichronic patient profiles were configured by using the proposed rules. These configured profiles could be used to monitor the safe conditions of patients with chronic or multi chronic illnesses. Based on the medical information found in the guidelines and other information provided by physicians, we created 20,328 rules using forward chaining of inference. These rules use concepts/axioms defined in our COPDology. The rules are set to achieve different goals such as (i) verifying the profile of patients; (ii) detecting the location; (iii) evaluating the patient's status and surrounding conditions; and (iv) providing the corresponding service for patients. For more details, please refer to the reasoning section of our previous work [7]. Figure 16 shows the list of SWRL rules that we created in the SWRL tab to monitor the patient. Thousands of SWRL rules were used to manage the status of almost 600 COPD medical profiles in various circumstances. Both chronic and multichronic patient profiles were configured by using the proposed rules. These configured profiles could be used to monitor the safe conditions of patients with chronic or multi chronic illnesses. Based on the medical information found in the guidelines and other information provided by physicians, we created 20,328 rules using forward chaining of inference. These rules use concepts/axioms defined in our COPDology. The rules are set to achieve different goals such as (i) verifying the profile of patients; (ii) detecting the location; (iii) evaluating the patient's status and surrounding conditions; and (iv) providing the corresponding service for patients. For more details, please refer to the reasoning section of our previous work [7]. Figure 16 shows the list of SWRL rules that we created in the SWRL tab to monitor the patient.  The use of SWRL rules in combination with COPDology instances has been studied in this article to provide personalized care services. Having reasoning techniques of ontologies and rules that contain the asserted and inferred statements, we used SPARQL to retrieve and derive contextual information from the knowledge base. Although SPARQL is classified as a query language, it can be considered more than this since it provides different query forms that allow its functionalities to be extended. For example, SPARQL can provide functions to verify whether certain constraints currently hold in an RDF triple store (ASK), or to specify inference rules using (CONSTRUCT), not only, but SPARQL can also be used to perform DELETE or INSERT operations. In contrast, the simplest form of a basic graph pattern (WHERE) can establish complex patterns by using UNION, OPTIONAL, and FILTER clauses. Therefore, the same SPARQL rule engine can be a used to execute functions and clinical monitoring rules, providing great flexibility in the definition of both types of data. Furthermore, SPARQL has also been studied to complement OWL expressiveness for arithmetic functions that will be included in the COPDology. This functionality indicates how information can be mathematically processed. A total of 11 arithmetic functions (ABS, AVG, division, multiplication, cell, floor, count, min, max, round, and sum) have been used to compensate for the OWL limitations. The aim of these queries is to retrieve any information relating to an identified instance, such as a sign, symptom, treatment, alarm, recommendation, decision, etc. In this section, we will present some queries that could be used to display important information and illustrate the implementation of the main functions.
with chronic or multi chronic illnesses. Based on the medical information found in the guidelines and other information provided by physicians, we created 20,328 rules using forward chaining of inference. These rules use concepts/axioms defined in our COPDology. The rules are set to achieve different goals such as (i) verifying the profile of patients; (ii) detecting the location; (iii) evaluating the patient's status and surrounding conditions; and (iv) providing the corresponding service for patients. For more details, please refer to the reasoning section of our previous work [7]. Figure 16 shows the list of SWRL rules that we created in the SWRL tab to monitor the patient.  In the query presented in the Figure 17, we display the identifier of all patients and their corresponding information. We use the triple pattern of Patient hasAge Age, Patient hasGender Gender, and Patient hasStage GoldStage. We use the SELECT query to get the information of the patient identifier, age, gender, and stage. In a similar way, we used the triple pattern of Patient LocatedIn Location, Patient hasAlarm Alarm, Patient EngagedIn ActivityLabel, Patient hasVitalSign VitalSign, HasValue Value, VitalSign hasTime Date, and Date hasTime Time. We use the SELECT query to get the information of location, activity, vital, signs, value, alarm, and time. The use of SWRL rules in combination with COPDology instances has been studied in this article to provide personalized care services. Having reasoning techniques of ontologies and rules that contain the asserted and inferred statements, we used SPARQL to retrieve and derive contextual information from the knowledge base. Although SPARQL is classified as a query language, it can be considered more than this since it provides different query forms that allow its functionalities to be extended. For example, SPARQL can provide functions to verify whether certain constraints currently hold in an RDF triple store (ASK), or to specify inference rules using (CONSTRUCT), not only, but SPARQL can also be used to perform DELETE or INSERT operations. In contrast, the simplest form of a basic graph pattern (WHERE) can establish complex patterns by using UNION, OPTIONAL, and FILTER clauses. Therefore, the same SPARQL rule engine can be a used to execute functions and clinical monitoring rules, providing great flexibility in the definition of both types of data. Furthermore, SPARQL has also been studied to complement OWL expressiveness for arithmetic functions that will be included in the COPDology. This functionality indicates how information can be mathematically processed. A total of 11 arithmetic functions (ABS, AVG, division, multiplication, cell, floor, count, min, max, round, and sum) have been used to compensate for the OWL limitations. The aim of these queries is to retrieve any information relating to an identified instance, such as a sign, symptom, treatment, alarm, recommendation, decision, etc. In this section, we will present some queries that could be used to display important information and illustrate the implementation of the main functions.

Query 1: How to Show Patient, Age, Gender, Stage, Location, Activity, Vital Signs, Alarm, and Time
In the query presented in the Figure 17, we display the identifier of all patients and their corresponding information. We use the triple pattern of Patient hasAge Age, Patient hasGender Gender, and Patient hasStage GoldStage. We use the SELECT query to get the information of the patient identifier, age, gender, and stage. In a similar way, we used the triple pattern of Patient LocatedIn Location, Patient hasAlarm Alarm, Patient EngagedIn ActivityLabel, Patient hasVitalSign VitalSign, HasValue Value, VitalSign hasTime Date, and Date hasTime Time. We use the SELECT query to get the information of location, activity, vital, signs, value, alarm, and time.

Query 2: Show the Suggestions of All Calculated Levels of IAQI
Based on the indoor air quality index, we could query for the suggestions of all the IAQI levels. This query could show an aspect of the system in monitoring the environmental conditions. Figure  18 shows the calculated levels of IAQI and their corresponding suggestions.

Query 2: Show the Suggestions of All Calculated Levels of IAQI
Based on the indoor air quality index, we could query for the suggestions of all the IAQI levels. This query could show an aspect of the system in monitoring the environmental conditions. Figure 18 shows the calculated levels of IAQI and their corresponding suggestions. Diagnostics 2019, 9,135 28 of 35 Figure 18. Query 2 and result.

Query 3: Show Risk Scales
In this query, we display the medical assessment of the patient at a certain moment based on the Ottawa COPD Risk Score. Any value between 3 and 9 could reflect a dangerous situation for a patient. In this query we get the risk of exacerbation after calculating the total scores of signs and symptoms. Based on the grouped levels and the total calculated score, we use a subquery to query the risk scale of the queried total scores (see Figure 19).

Query 4: Show the Risk of Hypoxia at High Altitude Exposure
In this query, we show that the patient could be prone to consequences of the initial exposure to high altitude: if the partial pressure and concentration of the oxygen are less than 50 mmHg and 85%, respectively, the patient cannot travel without supplemental oxygen (see Figure 20).

Query 3: Show Risk Scales
In this query, we display the medical assessment of the patient at a certain moment based on the Ottawa COPD Risk Score. Any value between 3 and 9 could reflect a dangerous situation for a patient. In this query we get the risk of exacerbation after calculating the total scores of signs and symptoms. Based on the grouped levels and the total calculated score, we use a subquery to query the risk scale of the queried total scores (see Figure 19).

Query 3: Show Risk Scales
In this query, we display the medical assessment of the patient at a certain moment based on the Ottawa COPD Risk Score. Any value between 3 and 9 could reflect a dangerous situation for a patient. In this query we get the risk of exacerbation after calculating the total scores of signs and symptoms. Based on the grouped levels and the total calculated score, we use a subquery to query the risk scale of the queried total scores (see Figure 19).

Query 4: Show the Risk of Hypoxia at High Altitude Exposure
In this query, we show that the patient could be prone to consequences of the initial exposure to high altitude: if the partial pressure and concentration of the oxygen are less than 50 mmHg and 85%, respectively, the patient cannot travel without supplemental oxygen (see Figure 20).

Query 4: Show the Risk of Hypoxia at High Altitude Exposure
In this query, we show that the patient could be prone to consequences of the initial exposure to high altitude: if the partial pressure and concentration of the oxygen are less than 50 mmHg and 85%, respectively, the patient cannot travel without supplemental oxygen (see Figure 20).

Query 3: Show Risk Scales
In this query, we display the medical assessment of the patient at a certain moment based on the Ottawa COPD Risk Score. Any value between 3 and 9 could reflect a dangerous situation for a patient. In this query we get the risk of exacerbation after calculating the total scores of signs and symptoms. Based on the grouped levels and the total calculated score, we use a subquery to query the risk scale of the queried total scores (see Figure 19).

Query 4: Show the Risk of Hypoxia at High Altitude Exposure
In this query, we show that the patient could be prone to consequences of the initial exposure to high altitude: if the partial pressure and concentration of the oxygen are less than 50 mmHg and 85%, respectively, the patient cannot travel without supplemental oxygen (see Figure 20).

Results
The proposed ontology is suitable for two main scenarios. First, a typical home-based telemonitoring scenario that can provide self-management service by observing physiological data regarding the general health of individuals, as well as better information about the indoor air parameters such as temperature, humidity, pollutant gases, dust, and vapor, which are considered triggering factors for COPD. The second scenario is designed for tracking patients outside the home. In the outdoor monitoring area, the system gathers contextual information or environmental stimulus that could influence the biomedical parameters.
To illustrate the use of the model, we will perform some experiments. Let us consider the scenario of a COPD patient being remotely monitored after diagnosis. The patient's vital signs, activity, and environmental parameters are continuously monitored. The patient's profile is shown in Table 7. The requirements for the supervision configured by the medical rules are depicted in each experiment. The parameters to be monitored correspond to specific limits. All these settings are described as parameters, constraints, and alarms. The defined alarms are associated with constraints configured for each profile. The activation of any of the alarms would alert both the patient and the physician; an earlier alert should be sent to the patient and pneumologist, with a visible notification and audible warning. These experiments allow for analyzing the fulfillment of the medical rules and services provided by varying both the vital signs and the activities of the patient. These experiments are classified as follows.
Experiment 1-The Main Objective of This Experiment Is to Examine the Ability of the Ontology to Detect Abnormal Changes in Physiological Parameters.
The alarms and constraints that control these changes are listed in the Table 8.  The number of biometric alerts in Figure 21 is illustrated on a monthly basis. The experiment reveals that there were hundreds of changes in vital signs detected by our system during this year. We observe that the highest rates occurred during the months of July, August, and December, when the system detected about 1300 cases of abnormal conditions. The number of biometric alerts in Figure 21 is illustrated on a monthly basis. The experiment reveals that there were hundreds of changes in vital signs detected by our system during this year. We observe that the highest rates occurred during the months of July, August, and December, when the system detected about 1300 cases of abnormal conditions.  Table 11 Below. As shown in Figure 22 below, pollution hazards in both internal and external spaces were also numerous. According to the conducted experimentation, the patient received between two and eight notification alerts per day, which would reduce the incidence of exacerbations significantly. As demonstrated in the Table 9 below. Table 9. Pollutants alarms and constraints for a specific profile.

Parameter Constraints Alarm
Carbon monoxide (CO) As shown in Figure 22 below, pollution hazards in both internal and external spaces were also numerous. According to the conducted experimentation, the patient received between two and eight notification alerts per day, which would reduce the incidence of exacerbations significantly.   Daily weather alerts were distributed between alarms related to temperature, humidity, atmospheric pressure, wind, and precipitation. Figure 23 shows the number of climatic notifications received by the patient during the different months of the year.     Table 8 provides some of the alarms and constraints for climatic conditions that suit a specific profile of copd patients. Daily weather alerts were distributed between alarms related to temperature, humidity, atmospheric pressure, wind, and precipitation. Figure 23 shows the number of climatic notifications received by the patient during the different months of the year.   Daily weather alerts were distributed between alarms related to temperature, humidity, atmospheric pressure, wind, and precipitation. Figure 23 shows the number of climatic notifications received by the patient during the different months of the year.     Table 9 provides some of the alarms and constraints for everyday activities that suit a specific profile of copd patients. In Figure 24, we can see the number of risks that the patient may experience because of his involvement in some unsafe activities or nonadherence to proper nutrient intake. In Figure 24, we can see the number of risks that the patient may experience because of his involvement in some unsafe activities or nonadherence to proper nutrient intake. The presented simulations have handled a great amount of data (525,600 records) of possible situations. The generated alarms have been classified into four main categories: vital signs, activity, pollution, and weather. The system applies continuous monitoring and detects a total of 3962 abnormal situations. Table 14 provides detailed information about the number of alarms during the different seasons.  The presented simulations have handled a great amount of data (525,600 records) of possible situations. The generated alarms have been classified into four main categories: vital signs, activity, pollution, and weather. The system applies continuous monitoring and detects a total of 3962 abnormal situations. Table 12 provides detailed information about the number of alarms during the different seasons.

Evaluation and Validation
The existing systems sought to promote their products without giving much attention to context design and performance; instead, their research focused on technology as a practice sustained by patients. It is important that the systems being used are supported by clinical practice guidelines and protocols to maintain consistency and minimize medical errors. Without a well-validated framework, the healthcare system will fail to provide any kind of protection or self-management services. Accuracy remains an important challenge for the alerts generated by the decision support systems. Practically, it is not known exactly how changes in physical parameters would affect the accuracy of the predefined alerts and their impact on patient outcomes. Improving the accuracy would enhance the overall performance of the telemonitoring systems and thus substantially reduce the disease burden.
As previously mentioned, the problem of telemonitoring systems was the impact of commercial and industrial aspects on research, which pushed hard towards blind adoption without a rigorous evaluation of the proposed designs. This lack of credible evaluation raises many questions about the feasibility and efficacy of this technology. This section will explore the performance of our ontology using a confusion matrix. Performance measurement quantifies accuracy, sensitivity, specificity, and the probability of predicting a dangerous change in physiological parameters in COPD patients. The purpose of this evaluation is to measure the accuracy of the alarms at the technical and clinical levels. A master file was created in MS Excel®that contains 1200 patient records, biometric readings for each patient (body temperature, diastolic blood pressure (DBP), systolic blood pressure (SBP), heart rate, partial pressure oxygen (PaO 2 ), oxygen saturation (SpO 2 ), partial pressure carbon dioxide (PaCO 2 ), oxygen consumption (VO 2 ), respiration rate, pH levels, concentration of hydrogen carbonate in the blood (HCO 3 ), and FEV1 have been extracted from the results inferred from ontology in different scenarios. This information was presented to physicians in the following format (see Table 13):

Physician's Report
The data are used to calculate the confusion matrices for the physician's report outcomes. There are four possible outcomes: true positive (TP), true negative (TN), false positive (FP), and false negative (FN). The confusion matrix contains information about the predicted classifications identified by our ontology and the opinions of medical experts. The designation of the categories is as follows: (1) the alarm that is generated is based on a threshold set into the SWRL rules for each biometric parameter, (2) the values are interpreted within the ontology to identify when intervention is needed, (3) once a risk level is established the classifier is designated into one of four categories (TP, TN, FP, FN) based on physician's report outcomes. Categories in this research are defined as follows: 1.
TP is an alarm with a hospitalization.

2.
FN has no alarm with a hospitalization. 3.
TN has no alarm and no hospitalization. 4.
FP has an alarm with no hospitalization.
The confusion matrices in Table 14 illustrated the results of the issued alarms based on the physician's report outcomes. The next Table 15 summarizes the performance of our ontology include accuracy, sensitivity, specificity, the FPF, representing 1-specificity, FNF, PPV, and NPV.  The results indicate that our model reaches an accuracy of 88% in a set of 1200 clinical cases. Sensitivity and specificity have high values, denoting the ability of the ontology to detect warning signs. The positive predictive value (PPV) is defined as the probability of intervention for positive test results, while the negative predictive value (NPV) describes the probability of being healthy despite negative test results.

Conclusions and Limitations
The proposed approach will provide significant potential to address some of the current COPD challenges because it establishes new obligations that will limit many potential hazards at different levels, both physiological and environmental. The presented model provides automated alarm generation algorithms for the telemonitoring of COPD patients. The ontology can recognize any important changes in biometrics and environment based on a personalized threshold. The protection process aims to adjust the thresholds around the normal state to avoid exacerbation triggers. Our findings proved that dynamic thresholds can enhance existing telemonitoring systems and make a valuable contribution to identifying the health status of COPD patients. Three main conclusions can be drawn from this work. Firstly, an ontology-based system can provide a more efficient way to deal with medical data.
Secondly, adding an SWRL layer of experts' rules on top of OWL can handle various types of context and suggest reliable recommendations. Thirdly, the results support the importance of context where it demonstrates that context variables have a strong influence on the accuracy of decisions. This work has some limitations at the decision-making and implementation levels. The central reasoning engine is based on rules defined by experts, thus in a case where pneumologists fail to mention some risk scenarios, the system is unable to detect abnormal conditions directly. Moreover, the proposed system is considered relatively more complex than the traditional system because it must deal with large ontologies and relational databases simultaneously, which may reduce the computing performance in terms of response time. Further research is needed before the practical application of this approach. This study will have to be evaluated through real implementation and a crossover trial to assess its success and effectiveness.