openEHR logo

Decision Language (DL) and Model

Issuer: openEHR Specification Program

Release: PROC latest

Status: DEVELOPMENT

Revision: [latest_issue]

Date: [latest_issue_date]

Keywords: openehr, expressions, rules

openEHR components
© 2020 - 2020 The openEHR Foundation

The openEHR Foundation is an independent, non-profit foundation, facilitating the sharing of health records by consumers and clinicians via open specifications, clinical models and open platform implementations.

Licence

image Creative Commons Attribution-NoDerivs 3.0 Unported. https://creativecommons.org/licenses/by-nd/3.0/

Support

Issues: Problem Reports
Web: specifications.openEHR.org

Amendment Record

Issue Details Raiser, Implementer Completed

PROC Release 2.0.0 (unreleased)

0.5.0

SPECPROC-X. Add Decision Language specification.

T Beale

13 Feb 2020

Acknowledgements

Primary Author

  • Thomas Beale, Ars Semantica; openEHR Foundation Management Board.

1. Preface

1.1. Purpose

This document specifies the openEHR Decision Model (DM) and an abstract syntax, denoted the openEHR Decision Language (openEHR DL). The DOM defines the semantics of a first order predicate style logic that can be used to write clinical Decision Logic Models (DLMs) that may be used standalone or with a Process / Plan oriented system such as openEHR Task Planning.

The intended audience includes:

  • Standards bodies producing health informatics standards;

  • Academic groups using openEHR;

  • Solution vendors.

Prerequisite documents for reading this document include:

Related documents include:

1.3. Status

This specification is in the DEVELOPMENT state. The development version of this document can be found at https://specifications.openehr.org/releases/PROC/latest/decision_language.html.

Known omissions or questions are indicated in the text with a 'to be determined' paragraph, as follows:

TBD: (example To Be Determined paragraph)

1.4. Feedback

Feedback may be provided on the technical mailing list.

Issues may be raised on the specifications Problem Report tracker.

To see changes made due to previously reported issues, see the PROC component Change Request tracker.

1.5. Conformance

Conformance of a data or software artifact to an openEHR specification is determined by a formal test of that artifact against the relevant openEHR Implementation Technology Specification(s) (ITSs), such as an IDL interface or an XML-schema. Since ITSs are formal derivations from underlying models, ITS conformance indicates model conformance.

2. Requirements

The requirements of openEHR Decision Language fall into a number of categories, described below.

TBD: this section only very rough for now.

2.1. Caller Interaction

  • the ability to capture the reasoning chain for presentation to a caller as a justification;

  • the ability to provide a decision and its possible outcomes, with the current recommendation indicated;

2.2. Representation

2.3. Binding to Data Context

  • bindings that connect variables to external data sources;

2.4. Type System

  • an ability to use externally defined information models that supply types that may be used in DL statements.

3. Overview

3.1. Conceptual Model

The openEHR Decision Language (DL) and Decision Model (DM) define a formalism for expressing decision logic used in healthcare and biomedical research. The essential characterisation of 'decision logic' understood in this specification is a function-oriented logic that generates deductive inferences, such as clinical classification of patients (including diagnosis) from input data, generally obtained from real world observation and measurement. We consider decision logic to consist of definitions and functions, the latter of which can be abstractly understood as rules, conditions, decision tables and potentially other varieties of function.

For example, a rule can be written to infer from the input variables heart_rate and heart_rhythm whether a patient has atrial fibrillation, or other forms of arrhythmia. A decision table can be considered to be a convenient way of representing a 'rule-set', i.e. a set of related rules driven by a common set of input variables.

Rules typically contain numerous conditions i.e. Boolean-returning expressions such as heart_rate >= 120 /min and heart_rhythm = |irregular| that are used as criteria for choosing decision paths within a function. In many domains, including healthcare, such conditions are often determined by long-term, evidence-based research, and may be well-known within a domain. For example, the innocuous-looking condition blood_glucose[2h post 75g glucose challenge] > 6.5 mmol/ml is the diagnostic standard for diabetes in a patient.

Conditions, rules, rule-sets and other inference-generating structures that may include them constitute fragments of knowledge that need to be able to be authored and change-managed independently from contexts that use them, rather than being directly written into (say) if/then/else logic chains as a programmer would typically do. This specification accordingly provides a representational form for such logic, along with artefacts that connect them to data access services (e.g. EHR) and also enable them to be invoked by user contexts (e.g. workflow engines).

The following diagram illustrates the artefacts covered by this specification within a larger computational context.

conceptual framework overview
Figure 1. Conceptual framework

In the above, the top part illustrates the category of process and plan definitions, of which the care pathway is a specific example in clinical medicine. In openEHR these are expressed as Work Plans, defined by the openEHR Task Planning model. In other environments, OMG BPMN/CMMN representation might be used.

Below the process component, two components of the DL framework are shown:

  • Decision Logic Module (DLM): modules containing decision functions that generate inferences from input variables representing real world entities being reasoned about (e.g. patient cardiac state etc);

  • Data Proxy Object (DPO): a definition of state variables and events characterising a real-world entity (e.g. cardiology patient) in a convenient form for use in a DLM.

The last component (shown at bottom left) is the Data Access Binding (DAB), which are bindings to data sources and repositories, such as patient health records and monitoring devices. Such data are extracted to become the logical data elements in a Data Proxy.

In this environment, the Process Definition component may be understood as a primary user of Data proxies and DLMs, providing it respectively with access to real world state (e.g. patient vital signs) and the results of inferencing on such state variables. As a consequence (and unlike BPMN or CMMN), formal decision / condition expressions do not appear in process definitions expressed as Task Plans.

3.2. Representation Scheme

The general approach to representation for Decision Logic Modules (DLMs) and Data Proxy Objects (DPOs) is to support two forms. The first is an optional high-level language form called Decision Logic Language (DLL) suitable for domain specialist authors, which abstracts away detail typically required by a programming language, and also provides some higher level abstractions, such as complex type operators, temporal logic and so on. DLL texts are assumed to be written by hand, with the aid of a syntax mode for typical editors, or a light-weight UI tool.

The second form is an expression in a standard programming language which is either generated from the first form by a cross-compilation process, or directly generated by a more sophisticated UI tool. This direct expression will be significantly more complex, because it encompasses not just the decision logic and proxy definitions, but the ability to compute recommendations (i.e. decision proposals), reasoning chains and other advanced functionality requiring transparent access to the logic structures of a DLM.

The two types of artefacts are shown below.

artefact scheme
Figure 2. Representation scheme

3.3. Prior Art

The openEHR DL formalism is a small formalism that builds upon the openEHR Expression Language, whose meta-model is defined in the openEHR Basic Meta-Model (BMM). DL adds constructs for representing conditions, decisions, and modules. A small extra meta-model and syntax covers Proxy definition, and the importation and binding semantics in the binding objects.

openEHR DL may be compared to other languages developed in the health arena for expressing 'medical logic', including HL7 Arden Syntax, Guideline Interchange Format (Ohno-Machado et al., 1998), ProForma (Sutton & Fox, 2003), as well as decision support languages such as HL7 Gello. These languages were not directly used, for various reasons including:

  • none have an easily extensible value referencing mechanism;

  • some are too procedural (Arden, GLIF);

  • current versions of some of these languages have been made specific to the HL7v3 RIM, a particular (and obsolete) model of health information designed for message representation (GLIF 3.x, GELLO);

  • none of them have a clear separation of the semantics of process representation, decision logic, proxy data and data access;

  • the maintenance and support is unclear and/or limited.

Nevertheless, various elements of Arden provided useful inspiration for the formalism described here. The Data Access Binding described here may be understood as a solution to the so-called 'curly braces problem' of Arden (Samwald, Fehre, de Bruin, & Adlassnig, 2012), i.e. the need to be able to bind rule logic to real-world variables.

Other relevant formalisms include the OMG BPMN, CMMN and DMN standards, and the HL7 CQL standard. The former group of standards are starting (as of 2020) to find use in the healthcare arena, having been developed for other industries including process control, logistics and insurance, and will require further development and integration for use in healthcare. The HL7 CQL standard addresses some of the same issues as openEHR DL/EL.

4. Decision Logic Language

4.1. Overview

The Decision Logic Language is a high-level language in which modules containing the following elements may be written:

  • definitions: domain constants;

  • conditions: Boolean-returning domain-specified criteria;

  • rules: domain-specified rules structures based on condition/action structures, which may return any type;

  • rule-sets: related sets of rules in various forms, including decision tables.

An example of a basic DLL text is shown below.

decision_module
    Cardiology_basic

data_source
    Patient: HeartPatient

definitions
    Afib_heart_rate: DvQuantity = 120 /min
    High_heart_rate: DvQuantity = 100 /min

conditions
    has_atrial_fibrillation:
        Patient.heart_rhythm = |erratic|286761003 and
            Patient.heart_rate >= Afib_heart_rate

    has_tachycardia:
        Patient.heart_rate >= High_heart_rate and
              Patient.exertion = |at rest|263678003

rules
    heart_assessment: DvCodedText {
        if has_atrial_fibrillation
            Result <- |atrial fibrillation|49436004

        elseif has_tachycardia
            Result <- |tachycardia|11092001

        else
            Result <- |normal|76863003
    }

4.2. Structure

TBD:

4.3. Definitions

TBD:

4.4. Conditions

TBD:

4.5. Rules

TBD:

4.6. Rule-sets

TBD:

5. Proxy Objects

5.1. Overview

For decision logic to be useful, it must be able to refer to states and events of entities in the outside world, e.g. the patient vital signs in both steady state (oxygen saturation) and important transitions (e.g. critical low oxygen saturation). The approach taken in openEHR DL is that any such entity is represented by an abstract data proxy object (DPO) that defines state variables and event conditions as formal features, along with certain meta-data, e.g. currency, defining the worst-case latency of sampling of a variable from its real-world source.

From a semantic perspective, DPO state variables and events represent properties and events occurring in ontic (real-world) entities, such as the patient’s heart. They are typically populated via the patient record and real-time devices (e.g. pulse-oximeter, accelerometer). Consequently, they are understood as being temporally situated on a 'world time' rather than a 'system time' timeline, where the latter corresponds to data commit and availability time.

From a data perspective, the set of features defined in a DPO will relate to a particular use. For example, the properties for a leukaemia patient are likely to include white_cell_count, platelets and so on, while a DPO for ante-natal use will contain obstetric properties. A core set of DPO features for any patient would include clinical basics such as date of birth, sex, and typical vital signs. In general, the collection of features in a DPO will be a somewhat arbitrary 'slice' of all possible variables and events characterising a real-world entity.

The following illustrates two DPOs, one a specialisation of the other.

conceptual proxy
Figure 3. Abstract proxy

5.2. Variable Naming

TBD: basic question of variable like 'Apgar 5min heartrate' - represent in a structure, and reference like apgar_result.5min.heart_rate, or just use flat pre-coord approach: apgar_result_5min_heart_rate? Structuring probably makes authoring easier.

6. Plan / DLM Interaction

6.1. Data-sharing

TBD: how to transmit arguments: assume all available in data sources? Need to allow calls to DLM using arguments?

6.2. Plan Structure References to DLM Features

At least two usage styles between the Plan engine and the Decision engine are possible.

6.2.1. Rule-based

In this style, rules are defined within the decision logic modules and the Plan just performs a 'switch' on the output values. This would be useful for non-Boolean decisions, e.g. generating coded terms; also for functions generating many possible values or value ranges. A DLM 'rule' is likely to be intentionally designed to reflect published clinical best practice.

conceptual decision based
Figure 4. Rule-based interface

6.2.2. Condition-based

In this style, only conditions defined within the logic modules are called, and the Plan defines the decision structure, i.e. it is a novel or ad hoc use of existing conditions. Semantically the

conceptual condition based
Figure 5. Condition-based interface

7. DLM Service Model

The following shows an outline idea of a DLM service interface. This could be made to cater for talking to a DMN service. It could also incorporate the CDS-hooks idea, which is just a recommendation structure.

conceptual service model
Figure 6. Service Model

8. Full Example

A full proxy + decision module for obstetric care is shown below.

8.1. Proxy Module

proxy_module
    Pregnant_patient

state


events


classification

    is_diabetic: Boolean

historical

8.2. Decision Module

decision_module
    Obstetric_pregnancy

data_source
    Patient: Pregnant_patient

definitions
    xxx: DvQuantity = 120 /min
    xxx: DvQuantity = 100 /min

conditions
    xxx:
        Patient.heart_rhythm = |erratic|286761003 and
            Patient.heart_rate >= Afib_heart_rate

    xxx:
        Patient.heart_rate >= High_heart_rate and
              Patient.exertion = |at rest|263678003

rules
    xxx: DvCodedText {
        if xxx
            Result <- |atrial fibrillation|49436004

        elseif xxx
            Result <- |tachycardia|11092001

        else
            Result <- |normal|76863003
    }

9. The Decision Language Object Model (DLOM)

TBD: this section is a rough draft at the moment

9.1. Overview

The org.openehr.proc.dlom package defines the Decision Language Object Model (DLOM), a structural model of the openEHR Decision language. It relies on the openEHR BMM.

The structure of the dlom packages is shown below.

PROC dlom packages
Figure 7. proc.dlom Package

The packages are described below.

9.2. DL Module Package

The top-level construct of the DLOM is the DL_MODULE, representing a standalone decision logic module. It is shown below.

PROC dlom.module
Figure 8. proc.dlom.module Package

TBD: to be continued.

9.2.1. Class Descriptions

9.2.1.1. MODULE_FEATURE Class

Class

MODULE_FEATURE (abstract)

Description

Inherit

BMM_DECLARATION

Attributes

Signature

Meaning

1..1
(redefined)

scope: BMM_MODULE

Model element within which an element is declared.

9.2.1.2. DECISION_MODULE Class

Class

DECISION_MODULE

Description

A container for a set of statements along with related BMM definitions, meta-data, terminology and bindings.

Inherit

BMM_MODULE, AUTHORED_RESOURCE

Attributes

Signature

Meaning

0..1

conditions: List<DL_CONDITION_DEF>

Boolean conditions defined by module for use in rules.

0..1

rules: List<DL_RULE>

Ruleset consisting of rules of various types.

0..1

proxy_properties: List<BMM_PROPERTY>

Properties representing real-world objects, such as the patient state, the patient history (logical EHR) etc.

0..1

proxy_objects: List<PROXY_MODULE>

Imported proxy modules

0..1

definitions: List<BMM_CONSTANT>

Constant definitions needed by module.

Functions

Signature

Meaning

create_bmm_class

Generate a BMM_CLASS structure in which:

  • constants = this.definitions;

  • this.conditions are converted to Boolean-returning functions with no parameters whose body is a single assignment statement of the form Result = DL_CONDITION_DEF.definition;

  • this.rules are converted to Boolean-returning functions with no parameters whose body consists of the DL_CONDITION_RULE.body.

9.2.1.3. DL_CONDITION_DEF Class

Class

DL_CONDITION_DEF

Description

DL representation of an argumentless Boolean function that defines a condition.

Attributes

Signature

Meaning

1..1

definition: EL_EXPRESSION

Invariants

Inv_boolean_definition: definition.is_boolean()

9.3. DL Rules Package

Specific Rule types are defined as descendants of DL_RULE, which may be understood as a pseudo form of the BMM_FUNCTION meta-type, i.e. a particular kind of function with a body. The following UML view illustrates.

PROC dlom.rules
Figure 9. proc.dlom.rules Package

Some specific rule types are described below.

9.3.1. Condition Chain Rule

A DL condition chain rule is one that consists of a chain of condition / result pairs and an 'else' result to cover a failure to match any condition. It is illustrated in the following UML view.

PROC dlom.rules condition chain
Figure 10. Condition chain rule

9.3.2. Case Rule

A DL case rule is one that obtains a value from an expression and determines the Result based on the interval in which the value falls. It is the equivalent of a 'case' statement in many languages. The match criterion on each branch of the rule is specified in terms of C_PRIMITIVE constraint types, from the openEHR AOM2 model.

PROC dlom.rules case
Figure 11. Case rule

9.3.3. Class Descriptions

9.3.3.1. DL_RULE Class

Class

DL_RULE (abstract)

Description

Abstract parent of DL rule types. All rules have a name (inherited from BMM_DECLARATION), and a type (from BMM_TYPED).

Inherit

BMM_TYPED, BMM_CLASS_ENTITY

Attributes

Signature

Meaning

1..1

body: BMM_STATEMENT_ITEM

9.3.3.2. DL_CONDITION_RULE Class

Class

DL_CONDITION_RULE

Description

A kind of rule consisting of a chain of Condition/action branches.

Inherit

DL_RULE

Attributes

Signature

Meaning

1..1
(redefined)

body: DL_CONDITION_CHAIN

The body of the rule.

9.3.3.3. DL_CONDITION_CHAIN Class

Class

DL_CONDITION_CHAIN

Description

Rule type that returns a result based on one or more conditions.

Inherit

BMM_STATEMENT

Attributes

Signature

Meaning

1..1

items: List<DL_CONDITION_BRANCH>

Items in the chain.

0..1

else_result: EL_INSTANCE_REF

Result to use if logical 'else' branch is followed.

9.3.3.4. DL_CONDITION_BRANCH Class

Class

DL_CONDITION_BRANCH

Description

A condition / result pair (sometimes known as a 'when/then rule').

Attributes

Signature

Meaning

1..1

condition: DL_CONDITION_DEF

The rule condition.

1..1

result: EL_INSTANCE_REF

The rule result, in the form of a terminal expression of the form of a literal value, module definition (i.e. constant), or function call.

9.3.3.5. DL_CASE_RULE Class

Class

DL_CASE_RULE

Description

A case rule.

Inherit

DL_RULE

Attributes

Signature

Meaning

1..1
(redefined)

body: DL_CASE_GROUP

The body of the rule.

9.3.3.6. DL_CASE_GROUP Class

Class

DL_CASE_GROUP

Description

Body of case rule construct.

Inherit

BMM_STATEMENT

Attributes

Signature

Meaning

1..1

items: DL_CASE_BRANCH

Branches of the case rule.

0..1

else_result: EL_INSTANCE_REF

Result to use if logical 'else' is followed.

1..1

value: EL_EXPRESSION

The value-generating expression that is the basis for the decision structure to be evaluated.

9.3.3.7. DL_CASE_BRANCH Class

Class

DL_CASE_BRANCH

Description

One branch of a case rule.

Attributes

Signature

Meaning

1..1

condition: C_PRIMITIVE_OBJECT

Constraint expression constraining the value of a decision branch.

1..1

result: EL_INSTANCE_REF

The rule result, in the form of a terminal expression of the form of a literal value, module definition (i.e. constant), or function call.

9.4. Proxy Module Package

The class PROXY_MODULE represents an object proxy, i.e. source of real-world data.

TBD: to be continued.

9.4.1. Class Descriptions

9.4.1.1. PROXY_MODULE Class

Class

PROXY_MODULE

Description

A module for defining a collection of properties representing real-world state values and events, defined in terms of conditions.

Inherit

BMM_MODULE

Attributes

Signature

Meaning

0..1

state_variables: List<STATE_VARIABLE>

0..1

event_conditions: List<EVENT_CONDITION>

0..1

ancestors: List<PROXY_MODULE>

References

Ohno-Machado, L., Gennari, J. H., Murphy, S. N., Jain, N. L., Tu, S. W., Oliver, D. E., Pattison-Gordon, E., et al. (1998). The GuideLine Interchange Format - A Model for Representing Guidelines. J Am Med Inform Assoc, 357–372.

Samwald, M., Fehre, K., Bruin, J. de, & Adlassnig, K.-P. (2012). The Arden Syntax standard for clinical decision support: Experiences and directions. Journal of Biomedical Informatics, 45, 711–718. Retrieved from https://www.sciencedirect.com/science/article/pii/S1532046412000226

Sutton, D. R., & Fox, J. (2003). The syntax and semantics of the PROforma guideline modeling language. J Am Med Inform Assoc., 10(5), 433–443. Retrieved from https://www.ncbi.nlm.nih.gov/pmc/articles/PMC212780/