Introduction

Context-aware health information services can collect real-time user context data through wearable or implantable medical sensors and provide health information services to users by analyzing the information. These information services can provide real-time preventive monitoring of diseases and early intervention with timely diagnoses and treatment, as well as empowering users to manage their own health.

A context is any information that can be used to characterize the situation of an entity, and an entity is a person, place, or object that is considered relevant to the interaction between a user and an application, including the user and application themselves [1]. Context-aware health information services research focuses on the following services: alerts [2], disease diagnosis [3], epidemic forecasting [4], and information recommendation. Context-aware health information recommendation services recommend personalized health information such as drug information, suitable diets, exercise suggestions, and health education information to users combined with the context such as the user’s physiological parameters, medical history, and food preferences. Huang et al. [5] proposed a Context-aware Personal Diet Suggestion System (CPDSS) which tries to maximize an aggregated health utility function and provides useful diet suggestions according to some contextual information. Kim et al. [6] build the health context ontology model on the foundation of medical knowledge and provide recommendations on diet and exercise.

At present, there is limited research on drug information recommendations based on context awareness. Drug recommendations differ from other diet, exercise, and health education information recommendations as it is a very professional field [7]. With the improvement of medical information literacy, users want to make their own decisions. Drug recommendations also lack personalized information services. Apart from medical institutions, users can find it hard to get accurate medical information on how to cope with their diseases [8]. As hypertension is one of the major chronic diseases around the world, it is beneficial to provide personalized information on anti-hypertensive drugs and improve users’ information literacy in medicine.

Context-awareness based drug recommendation technology mainly includes context modeling and context reasoning [9]. Context modeling is the concept abstraction of context; context reasoning is identifying or predicting a user’s high-level context based on the low-level context.

Ontology technology enables sharing and reuse of domain knowledge by abstracting the concepts and terms in specific fields [10]. A context ontology model has strong interoperability, sharing, reusability and maintainability [11, 12]. It can model both the context and knowledge and provide the semantic reasoning based on the description logic (DL). This study integrates the context awareness into an anti-hypertensive drug recommendation service based on guidance from cardiovascular experts and Chinese Guidelines for the Management of Hypertension (Guidelines) [13]. This paper makes use of ontology technology to build an Anti-hypertensive Drugs Personalized Recommendation Service Context Ontology (HyRCO).

Ontology reasoning based on DL can only deduce potential binary relations [14]. Semantic Web Rule Language (SWRL) [15] has rich relation expression ability to overcome the limitation of Web Ontology Language (OWL) in reasoning ability. By combining DL and SWRL the system can achieve a better decision on the If-Then rule which enhances the ability of OWL to identify the high-level context [1619]. To further enhance the personalized information service, this study chooses ontology together with the SWRL reasoning method to infer knowledge and build context reasoning rules and recommendation optimization rules to optimize anti-hypertensive drug recommendation outcomes.

Anti-hypertensive drugs personalized recommendation service context ontology

The purpose of an anti-hypertensive drugs recommendation service is to provide relatively accurate medicinal information to users. The context awareness method is adopted in order to collect user contexts, and apply user context to infer high-level pathological contexts. Service recommended drugs which are most relevant to a user’s high-level pathological context can improve the personalization. This study built a HyRCO under the guidance of medical experts, fully considering two factors: (1) HyRCO can offer support for a drug recommendation service, and (2) extendibility.

On the basis of existing studies of context classification [2022], combined with drug recommendation services, HyRCO can be divided into seven core classes: User, Activity, Location, Environment, Device, Service and Anti-hypertensive. User is the very core concept in context-aware computing, here referring to a person who may be suffering from hypertension. Activity refers to the behavior of the entity, including SimpleMotion and ComplexActivity. Location is the basic concept in the context, in this article referring to the SymbolLocation. Environment refers to the Weather and PhysicalEnvironment around SymbolLocation. Device is the infrastructure which is used to support context data collection as well as the implementation of the Service. Service refers to the various applications which can meet the User’s needs. Antihypertensive is the set of drugs which are used to treat hypertension. In addition to the commonly used anti-hypertensive drugs, some other drugs are used in combination.

The User creates the Activity, uses the Service, owns the Device, and takes Anti-hypertensive drugs to treat hypertension. The User and Device are located in SymbolLocation, and SymbolLocation has an Environment. The Service runs on a Device, and also supports some Activity. The Environment and Activity also influence and reflect the user’s physiological index. In addition to the core classes, HyRCO also includes extended classes, such as Time and Disease. The relationships between different classes constitute the basic framework of HyRCO (shown in Fig. 1).

Fig. 1
figure 1

The basic framework of HyRCO

The Activity ontology of this paper refers to the activity model built by Chen and Nugent [23]. Incorporated into a medicine information recommendation service, this paper emphasizes describing the administrative, building and indoor locations, in which the indoor location reuses Worboys’ indoor ontology [24]. The Environment ontology model is centered on SymbolLocation, and other classes connect to the Environment through SymbolLocation. In this paper, the Environment has subclasses of the PhysicalEnvironment and Weather, and the Weather ontology refers to that of Staroch’s Smart Home [25]. The Device mainly depicts the basic information about equipment, including computing equipment and devices. The computing equipment includes PC, cell phone, i-PAD, etc., and devices include monitor, mouse, simple sensor, etc. In addition, the basic information includes both software and hardware. User and Anti-hypertensive are the most important, and will be described in detail.

User ontology

The goal of this paper is to provide a drug recommendation service, hence the User ontology puts more emphasis on user health information, which mainly contains three types of information:

  1. (1)

    The profileOfUser includes age, gender, income, smoke, etc. The profileOfUser is expressed by data properties. Some information in the profileOfUser involves multiple ontologies, such as userInjectionHistory which involves the User, Activity, Antihypertensive and Time.

  2. (2)

    The bodySigns include bodyTemperature, diastolicPressure, heartRate, etc. To simplify the reasoning rules, bodySigns is expressed by data properties.

  3. (3)

    ExaminationData contains the results of medical tests. It is expressed by QualityValue. For example, LVMI is the left ventricular mass index (BMI) and its unit is g/m2, and the data type is integer.

The user ontology model is shown in Fig. 2.

Fig. 2
figure 2

User ontology model

Anti-hypertensive ontology

This study used the knowledge organization method of the RxNorm ontology to build the Anti-hypertensive ontology. RxNorm [26] is a clinical drugs ontology published by the National Library of Medicine (NLM) in 2004. The Anti-hypertensive ontology model involves two classes: Anti-hypertensive and Disease.

Anti-hypertensive is the basic knowledge about drugs, including drug classification, indications, dosage forms and the usages, pharmacologic action, etc. It has characteristics of temporality, consistency and diversity. We used the package inserts of drugs to build anti-hypertensive instances in order to avoid mistakes. Hence the Anti-hypertensive class can clearly express drug indications and pharmacological information.

Disease is classified according to the International Classification of Diseases (ICD) [27]. The ICD uses four main factors to classify diseases: etiology, part/s of the body, pathology and clinical manifestation. The ICD includes not only confirmed diseases, but also symptoms, signs and other indicators. Thus the ICD meets the classification requirements of this study.

The Anti-hypertensive ontology mainly includes the following content:

  1. (1)

    Object properties between User and Anti-hypertensive: isAllergicTo, isTolerantOf, cautiouslyTakes, isSuitableFor, isForbiddenTo. Object properties between User and Disease: suffersFrom.

  2. (2)

    Object properties between Anti-hypertensive and Disease: hasSideEffect, hasIndication, hasCautionCondition, hasContraindication. Drug interactions: hasEnhancedEffect, hasSynergisticEffect, hasAntagonisticEffect. ProfileofDrug is the basic information on a drug.

  3. (3)

    According to ICD-10, diseases can be divided into 20 kinds, and can be described by symptoms, signs, abnormal information, etc. Each disease has a unique ICD ID.

The Anti-hypertensive ontology model is shown in Fig. 3.

Fig. 3
figure 3

Anti-hypertensive ontology model

Implementation of anti-hypertensive drugs personalized recommendation service context ontology

The HyRCO built by Protégé is shown in Fig. 4. It includes classes, object properties, data properties, and a large number of axioms and instances.

Fig. 4
figure 4

HyRCO was created by Protégé

The experts reported that the HyRCO performed well in terms of completeness, suitability, and consistency. HyRCO can support the drug recommendation service, and can be extended easily to other services.

Semantic reasoning and recommendation optimization

The HyRCO has two kinds of reasoning methods: ontology and SWRL. The ontology reasoning is mainly responsible for detecting inconsistencies, classification and instantiation. Meanwhile the SWRL rules involve the expansion of ontology axioms and are responsible for the high-level context reasoning and information recommendation. Figure 5 shows the reasoning model based on ontology and SWRL rules.

Fig. 5
figure 5

The reasoning model based on ontology and SWRL rules

Rules of context reasoning

In the personalized recommendation of anti-hypertensive drugs based on context awareness, cardiovascular risk factors and levels of the user are the main high-level contexts that need to be identified. According to the Guidelines, the cardiovascular risk level depends on cardiovascular risk factors and complicated clinical diseases. Forming the initial recommended drug set according to the cardiovascular risk level requires establishing four kinds of rules:

  1. (1)

    Blood pressure level classification rules, which derive from the definition and classification of blood pressure levels in the Guidelines. For example if the value of user’s diastolic pressure is [100,109], then the user suffers from moderate hypertension.

  2. R1:

    User(?x)∧diastolicPressure(?x,?y)∧swrlb:greaterThanOrEqual(?y,100)∧swrlb:lessThanOrequal?y,109)→suffersFrom(?x,Moderate_hypertension)

  3. (2)

    Rules about other risk factors, damage of target organs and complicated clinical diseases, which concern important factors that influence patients’ cardiovascular prognosis in the Guidelines. For example, if the value (mmol/L) of a user’s LDL-C is greater than 3.3, then the user suffers from dyslipidemia and the quantity of cardiovascular risk factors should add 1.

  4. R2:

    User(?x)∧quantityOfCardiovascularRiskFactor(?x,?y)∧HDL-C(?z)∧hasExaminationData(?x,?z)∧hasQualityValue(?z,?a)∧hasUnitOfMeasurement(?a,mmol/L)∧value(?a,?b)∧swrlb:greaterThan(?b,3.3)→suffersFrom(?x,Blood_lipid_abnormality)∧swrlb:add(?y,1)

  5. (3)

    Cardiovascular risk level classification rules, which conform to the definition and classification of cardiovascular risk level in the Guidelines. For example, if a user’s quantity of cardiovascular risk factors is [1, 2], the user suffers from mild hypertension and has no damage to target organs or complicated clinical diseases. Then the user is at a low level of cardiovascular risk.

  6. R3:

    User(?x)∧quantityOfCardiovascularRiskFactor(?x,?y)∧swrlb:greaterThanOrEqual(?y,1)∧swrlb:lessThanOrEqual(?y,2)∧damageofTargetOrgans(?x,0)∧complicatedClinicalDisease(?x,0)∧suffersFrom(?x,Mild_hypertension)→cardiovascularRiskLevel(?x,2)

  7. (4)

    Initial drug recommendation rules, which reflect the treatment process in the Guidelines. For example if a user’s level of cardiovascular risk is low, then an anti-hypertensive Class C drug is suitable for the user.

  8. R4:

    User(?x)∧cardiovascularRiskLevel(?x,1)∧C(?y)→isSuitableFor(?y,?x)

Rules of recommendation optimization

An initial drug set is formed through the context reasoning rules, while the personalization of drug recommendations is weak because it does not make full use of the user context information. Hence this paper designed three kinds of recommendation optimization rules: (1) Filtering rules, (2) Preference rules, and (3) Reservation rules. The aim was to design different priorities for these rules and design algorithms of priority in order to enhance the personalization of drug recommendations.

Filtering rule

Filtering rules are very common in many studies and can directly delete objects matching the requirements from the result set. Usually there is a detailed description of the drug ingredients and contraindications in the dispensatory, comprising the main theoretical evidence for the filtering rule. This type of rule can be abstracted as the following:

$$ RestrictionContext(ValueOfRestrictionContext)\mathit{\to} filter(d) $$
(1)

RestrictionContext represents specific properties that may belong to users or drugs. ValueOfRestrictionContext represents the value of the specific properties. Filter means to directly delete object d from the result set. For example, if the user suffers from diabetes, then it needs to filter the anti-hypertensive drugs for which diabetes is a contraindication.

  1. R5:

    User(?x)∧Antihypertensive(?y)∧suffersFrom(?x,Diabetes_NOS)∧hasContraindication(?y,Diabetes_NOS)→isForbiddenTo(?y,?x)

Preference rule

A preference rule decides which drug is more suitable for the user. The user may have a complex condition and suffers from a variety of diseases at the same time. Moreover, the user’s age, weight, and gender could influence the final drug choice. This type of rule can be abstracted as the following:

$$ PreContext(ValueOfPreContext)\mathit{\to} prefer(d) $$
(2)

PreContext and ValueOfPreContext respectively represent specific properties and their values. Prefer means to preferentially recommend the object d. For example, if the user suffers from diabetes, then we preferentially recommend the anti-hypertensive drugs for which indications include diabetes.

  1. R6:

    User(?x)∧Antihypertensive(?y)∧suffersFrom(?x,Diabetes_NOS)∧hasIndication(?y,Diabetes_NOS)→isSuitableFor(?y,?x)

Reservation rule

A reservation rule is specific to the drug recommendation service. As mentioned above, the user usually suffers from a variety of diseases at the same time, so a drug that is suitable for one context may be harmful to another context. The usage of such a drug needs to be carried out under detailed guidance by medical professionals, and this kind of drug information is more difficult for users to process. In this case, we will not directly delete this drug, but put it at the bottom of the list. This type of rule can be abstracted as the following:

$$ ResContext(ValueOfResContext)\mathit{\to} reserve(d) $$
(3)

ResContext and ValueOfResContext respectively represent specific properties and their values. Reserve means to make object d in lower rank. For example if the user is pregnant, then we reserve the anti-hypertensive drugs for which conditions requiring caution include pregnancy.

  1. R7:

    User(?x)∧Antihypertensive(?y)∧suffersFrom(?x,Encyesis)∧hasCautiousCondition(?y,Diabetes_NOS)→caustiouslyTakes(?x,?y)

Design of priority and algorithm

Some conflicts may exist between different rules in the actual recommendation process, hence different priorities for these recommendation rules are needed to help avoid conflicts. A filtering rule represents the rigid requirements that filter out the inappropriate objects from the result set, it has the highest priority. A preference rule preferentially recommends the most suitable object to the user and its priority level is lower than that of the filtering rules. A reservation rule is proposed according to the specific service in this paper and its priority level is the lowest. Setting the filtering rule as R5, preference rule as R6 and reservation rule as R7, ≼ stands for the partial ordering relation which means the right priority is higher than that of the left, hence the priority ranking can be represented as the following:

$$ R 7\preccurlyeq R 6\preccurlyeq R 5 $$
(4)

The recommendation optimizing process based on context mainly includes three stages: (1) filter out the forbidden drugs based on filtering rule R5; (2) flag the drug based on preference rule R6 and mark based on the algorithm, and (3) flag again based on the reservation rule R7, mark based on the algorithm and rank based on the final score. Assume there exist m items filtering rule R5, r items preference rule R6, z items reservation rule R7, and the algorithm is shown in Fig. 6.

Fig. 6
figure 6

The optimized algorithm of recommendation results

The algorithm above can reorder the drugs based on the final scores. This paper makes use of deferred processing. We take N = −1 in step 3, and finally the higher score leads to the higher position.

In this paper, the design of the rule priorities is based on the anti-hypertensive drug recommendation service. But the rule meanings differ in different fields, hence priorities should be adjusted according to the application. More levels of rules can be designed but the main idea is the priority. Sectional optimization is mainly done in order to set the threshold value in the middle procession and reduce the calculation of the next step, which can reduce the operation cost of the process.

After completing the rules, we need to switch ontology knowledge and rules to the knowledge base and rule base of Jess. Then the Jess inference engine can produce new knowledge. Figure 7 shows rules in the SWRL Rules window in Protégé.

Fig. 7
figure 7

SWRL rules and Jess inference engine

Experiment and analysis

This study used 25 hypertension patients in a hospital in China as experimental subjects from March 1, 2016 to March 31, 2016, and obtained the users’ raw context data through medical sensors and manual input. The sensor data are mostly the users’ physiological index, activity, location, etc. The manually input data are mostly the users’ basic information such as smoking history, alcohol history, etc. In collecting the context’s raw data, we set up a range of thresholds according to the equipment, environment and the users’ average physiological index, and filtered out the data that were out of the range. As a result, the quality of the data was under effective control. After the filter, we imported the processed context data into the HyRCO. Knowledge reasoning was implemented by means of the context reasoning optimizing rules devised in this paper, and provided recommended drugs to each patient according to their own context. To assess the results, a series of effective prescriptions given by several medical professionals were taken as the reference standard. The assessment of the results mainly includes the validity of the context reasoning and the effectiveness of the recommendation optimization.

Context reasoning was done to identify the users’ cardiovascular hazards, established diseases and the levels of cardiovascular risk in order to determine the treatment plans and original drug combinations. Through the context reasoning rules, the system inferred patients’ high-level contexts, which concurred with professional pathological analyses. Figure 8 shows the context reasoning of user no. 12. It can be deduced from the blood pressure that the user is suffering from tertiary hypertension, and from context data such as the patient’s profileOfUser, bodySigns, ExaminationData what cardiovascular threats are lurking. Along with the user’s clinical diseases, an extremely high-risk cardiovascular condition can be diagnosed.

Fig. 8
figure 8

Context reasoning result of user no.12

In optimizing the recommendation result, a ranked list of recommended anti-hypertensive drugs generated through the Filtering rule, Preference rule and Reservation rule. To verify the effectiveness of the recommendation result optimization, this experiment invited medical professionals to participate in the final assessment, and took their valid prescriptions as the reference standard, using the upgrade rate of ranking A as a measurement indicator, as follows:

$$ A=\left(N-M\right)/N $$
(5)

N represents the average ranking of prescribed drugs before optimizing the recommended list; M represents the average ranking after the optimization.

Figure 9 displays the upgrade rate of average ranking after the optimization, which is demonstrated as Ᾱ = 65.3 %. It can be concluded from the figure that the ranking of prescribed drugs as a whole has been dramatically enhanced. In Fig. 9, since the prescribed drugs for user 9 and 24 have been given high ranks, there are no significant changes. In fact, the recommendation results of all 25 patients having been optimized, the prescribed drugs for 20, or 80 % of all patients, rank in the top 10 of the list.

Fig. 9
figure 9

Upgrade rate of average ranking of prescribed drugs

The context-based reasoning optimization eliminates the conflicts among different rules by dividing priority levels. Since the ontology is separate from the rules, rules can be flexibly added or deleted as needed. The experiment result demonstrates that the system is able to provide high-quality drug recommendation according to the user’s context.

Conclusions and future work

Context-aware personalized recommendation systems have been mainly applied in non-professional domains. With the improvement of users’ information literacy, information recommendation in the professional domain is gradually becoming in demand. Current professional recommendation systems lack context awareness. Our system is capable of real-time sensing the users’ context with wearable and medical sensor devices and provides reliable anti-hypertensive drug recommendations that fulfill users’ need for drug information. It is a useful tool as a recommendation service using context-aware medical information. In summary, this paper first created the HyRCO framework, and implemented identification and assessment with an evaluation index under professional supervision. The assessment verified that the HyRCO performs favorably in terms of system integrity, validity, consistency and applicability. Subsequently, based on the theories in the Guidelines, this paper established context reasoning rules and recommendation optimization rules to establish the priority level. An experiment conducted with a group of hypertension patients demonstrated that 80 % of the top 10 recommended drugs fit into medical professionals’ prescriptions. The system was verified as capable of providing a recommendation service of high-quality medical information.

Although this research is about a context-aware personalized recommendation service for anti-hypertension drugs, the method is extensible to other disease types, or other types of information services, such as alert services and diet recommendation services.

A limitation is that this study considered only the user’s objective context, such as physiological parameters, behavior parameters, etc. while ignoring the user’s subjective context, such as drug price, country of origin, preference for brands, etc. The subjective context will influence the ranking of the recommended drugs. In future studies, we will add users’ subjective context to the anti-hypertensive drugs recommendation service to further enhance its personalization feature.