GDL2 Object Model
Package Structure
The Guideline Object Model, the object model of GDL2 consists of three packages, the guideline package, expression package and the terminology package, each described in detail through the following sections.
cds PackageGuideline Package
Overview
The following UML diagram shows the guideline and terminology packages.
cds.guideline PackageClass Definitions
GUIDELINE Class
-
Definition
Class |
GUIDELINE |
|
|---|---|---|
Description |
Representation of a discrete guideline, which defines archetype bindings, rules and descriptive meta-data. |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
id: |
Identification of this guideline. Syntax is a string of format:
For example: |
0..1 |
gdl_version: |
The version of the GDL the guide is written in, in a string of format:
i.e. a 2- or 3-number form of version, e.g. "1.0", "2.0", etc. |
1..1 |
concept: |
The normative meaning of the guideline as whole. Expressed as a gt-code. |
1..1 |
definition: |
The main definition part of the guide. It consists of archetype bindings and rule definitions. |
1..1 |
terminology: |
Terminology definitions of the guideline containing definitions and translations (if applicable) for every gt-code. |
GUIDELINE_DEFINITION Class
-
Definition
Class |
GUIDELINE_DEFINITION |
|
|---|---|---|
Description |
The definition of the guideline includes:
|
|
Attributes |
Signature |
Meaning |
0..1 |
data_bindings: |
List of archetype/template bindings, which define specific elements to be used by rules in this guideline. |
0..1 |
Pre-conditions to be met before the guideline can be selected for execution. Pre-conditions constitute the definition of the guideline 'entry point', i.e. the match to a patient type to which the guideline may apply. |
|
0..1 |
Map of rules indexed by local gt codes. |
|
0..1 |
default_actions: |
Actions that will always be performed, whenever the |
0..1 |
templates: |
One or more output termplates that define how to represent output reporting structure. |
0..1 |
Variables used internally to a GDL guideline, i.e. not bound to external data entities. These are generated during parsing of expressions and used to track interim state. |
|
RULE Class
-
Definition
Class |
RULE |
|
|---|---|---|
Description |
A single rule defined in a guideline, of the logical form
Conditions are assertions based on input and/or environment variables (e.g.time, date etc). Actions take the form of assignments to output variables. |
|
Attributes |
Signature |
Meaning |
1..1 |
id: |
The gt-code of this rule. |
0..1 |
List of assertions that when evaluated to |
|
0..1 |
then: |
List of actions if the rule is fired. Each action is in the form of an assignment to an 'output' type variable. |
1..1 |
priority: |
Indicates the evaluation order of Rules within a Guideline. Rules with a higher priority value are executed first. |
DATA_BINDING Class
-
Definition
Class |
DATA_BINDING |
|
|---|---|---|
Description |
A list of bindings of nodes for a data-set' - i.e. from the archetype (and optionally template) specified by |
|
Attributes |
Signature |
Meaning |
1..1 |
model_id: |
The identifier of the data-set model (i.e. archetype or other) from which the list of elements is selected. |
0..1 |
template_id: |
The ID of an optional template to be used for selecting elements. |
0..1 |
Map of variable binding indexed by identifying gt-code of the variable. |
|
0..1 |
Predicates (constraints) that need to be satisfied before rule execution can occur. Generally speaking, predicates are constraints on variable values, and can only mention gt-codes of variables. |
|
1..1 |
type: |
Marker to indicate whether variable is an input or output variable in the data-set. The value can either be:
|
OUTPUT_TEMPLATE Class
-
Definition
Class |
OUTPUT_TEMPLATE |
|
|---|---|---|
Description |
Definition of structure for reporting guideline execution results. |
|
Attributes |
Signature |
Meaning |
1..1 |
id: |
The gt-code of this output template. |
1..1 |
name: |
Name of this template. |
1..1 |
model_id: |
Identifier of a model that defines the structure of the |
0..1 |
template_id: |
The identifier of a template based on the model identified by |
1..1 |
object: |
Detailed output report structure as an object that may be defined by a published model. |
Expressions Package
Class Definitions
EXPRESSION_ITEM Class
-
Definition
Class |
EXPRESSION_ITEM (abstract) |
|
|---|---|---|
Description |
Abstract parent of all valued elements that may be used as a term in an expression. Concrete descendant types are generated by a GDL2 parser when processing a GDL2 text. The function |
|
Functions |
Signature |
Meaning |
1..1 |
type (): |
Type name of the item. Comparisons should be done case-insensitive. |
OPERATOR Class
-
Definition
Class |
OPERATOR (abstract) |
|
|---|---|---|
Description |
Abstract model of an operator-based expression. |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
operator: |
The operator type of this expression. |
UNARY_OPERATOR Class
-
Definition
Class |
UNARY_OPERATOR |
|
|---|---|---|
Description |
Concrete model of a unary operator in the rule. |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
operand: |
The operand. |
BINARY_OPERATOR Class
-
Definition
Class |
BINARY_OPERATOR |
|
|---|---|---|
Description |
Concrete model of a binary operator in the rule. |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
left: |
Left operand. |
1..1 |
right: |
Right operand. |
OPERATOR_KIND Enumeration
-
Definition
Enumeration |
OPERATOR_KIND |
|
|---|---|---|
Description |
Enumeration of operator types. |
|
Attributes |
Signature |
Meaning |
ADDITION |
Addition ('+') operation. |
|
SUBTRACTION |
Subtraction ('-') operation. |
|
MULTIPLICATION |
Multiplication ('*') operation. |
|
DIVISION |
Division ('/') operation. |
|
EXPONENT |
Exponent ('^') operation. |
|
AND |
Logical and ('&&') operation. |
|
OR |
Logical or ('||') operation. |
|
NOT |
Logical negation ('!') operation. |
|
EQUALITY |
Relational equality ('==') operation. |
|
INEQUALITY |
Relational inequality ('!=') operation. |
|
LESS_THAN |
Relational less-than ('<') operation. |
|
GREATER_THAN |
Relational greater-than ('>') operation. |
|
LESS_THAN_OR_EQUAL |
Relational less-than-or-equal ('<=') operation. |
|
GREATER_THAN_OR_EQUAL |
Relational greater-than-or-equal ('>=') operation. |
|
IS_A |
Subsumption operator ('is_a'). |
|
IS_NOT_A |
Negated subsumption operator ('!is_a'). |
|
FOR_ALL |
Universal quantifier operator ('∀'). |
|
FUNCTION_CALL Class
-
Definition
Class |
FUNCTION_CALL |
|
|---|---|---|
Description |
Concrete expression in the form of a function. |
|
Inherit |
||
Attributes |
Signature |
Meaning |
0..1 |
items: |
Function arguments. |
1..1 |
function: |
The specific function. |
FUNCTION_KIND Enumeration
-
Definition
Enumeration |
FUNCTION_KIND |
|
|---|---|---|
Description |
Enumeration of function types. |
|
Attributes |
Signature |
Meaning |
abs |
Returns the absolute value of a double value. |
|
ceil |
Returns the smallest double value that is greater than or equal to the argument and is equal to a mathematical integer. |
|
exp |
Returns Euler’s number e raised to the power of a double value. |
|
floor |
Returns the largest double value that is less than or equal to the argument and is equal to a mathematical integer. |
|
log |
Returns the natural logarithm (base e) of a double value. |
|
log10 |
Returns the base 10 logarithm of a double value. |
|
log1p |
Returns the natural logarithm of the sum of the argument and 1. |
|
round |
Returns the closest long to the argument, with ties rounding to positive infinity. |
|
sqrt |
Returns the correctly rounded positive square root of a double value. |
|
sin |
Returns the trigonometric sine of an angle. |
|
cos |
Returns the trigonometric cosine of an angle. |
|
max |
Maximum value of N elements. |
|
min |
Minimum value of N elements. |
|
count |
Count of instances of an element. |
|
sum |
Total sum of N element values. |
|
CONSTANT Class
-
Definition
DATE_TIME_CONSTANT Class
-
Definition
Class |
DATE_TIME_CONSTANT |
|
|---|---|---|
Description |
Constant of type Date/time. |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
value: |
Value of constant, redefined to specific types in descendants. |
CODE_PHRASE_CONSTANT Class
-
Definition
Class |
CODE_PHRASE_CONSTANT |
|
|---|---|---|
Description |
Constant of type Code phrase. |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
value: |
Value of constant, redefined to specific types in descendants. |
CODED_TEXT_CONSTANT Class
-
Definition
Class |
CODED_TEXT_CONSTANT |
|
|---|---|---|
Description |
Constant of type Coded text. |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
value: |
Value of constant, redefined to specific types in descendants. |
ORDINAL_CONSTANT Class
-
Definition
Class |
ORDINAL_CONSTANT |
|
|---|---|---|
Description |
Constant of type Ordinal. |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
value: |
Value of constant, redefined to specific types in descendants. |
QUANTITY_CONSTANT Class
-
Definition
Class |
QUANTITY_CONSTANT |
|
|---|---|---|
Description |
Constant of type Quantity. |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
value: |
Value of constant, redefined to specific types in descendants. |
VARIABLE Class
-
Definition
Class |
VARIABLE |
|
|---|---|---|
Description |
Terminal expression element representing a named variable with a definition provided by the |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
name: |
Variable symbolic name. |
1..1 |
code: |
Internal gt-code defining the meaning of this variable. |
STATEMENT Class
-
Definition
Class |
STATEMENT (abstract) |
|
|---|---|---|
Description |
Abstract concept of a statement, which is a self-standing procedural element. |
|
ASSIGNMENT Class
-
Definition
Class |
ASSIGNMENT |
|
|---|---|---|
Description |
A statement assigning an expression result to a variable. |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
variable: |
Variable that is the target of the assignment. |
1..1 |
expression: |
Expression that is the source of the assignment. |
ASSERTION Class
-
Definition
Class |
ASSERTION |
|
|---|---|---|
Description |
A statement of the logical form |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
expression: |
Expression that is the subject of the assertion. |
Invariants |
Inv_expression_type: |
|
Terminology Package
Overview
The terminology package is illustrated earlier. The TERMINOLOGY and TERM classes are slightly simplified versions of the ARCHETYPE_TERMINOLOGY and ARCHETYPE_TERM classes from the openEHR AOM2 specification.
Class Definitions
TERMINOLOGY Class
-
Definition
Class |
TERMINOLOGY |
|
|---|---|---|
Description |
Local terminology of an archetype. This class defines the semantics of the terminology of an archetype. |
|
Attributes |
Signature |
Meaning |
1..1 |
is_differential: |
Indicates whether this terminology is differential with respect to a specialisation parent, or complete. |
1..1 |
original_language: |
Original language of the terminology, as set at creation or parsing time; must be a code in the ISO 639-1 2 character language code-set. |
1..1 |
concept_code: |
Term code defining the meaning of the artefact as a whole, and always used as the at-code on the root node of the archetype. Must be defined in the |
1..1 |
Directory of term definitions as a two-level table. The outer hash keys are language codes, e.g. |
|
0..1 |
term_bindings: |
Directory of bindings to external terminology codes and value sets, as a two-level table. The outer hash keys are terminology ids, e.g. |
Functions |
Signature |
Meaning |
1..1 |
specialisation_depth (): |
Specialisation depth of this artefact. Unspecialised artefacts have depth 0, with each additional level of specialisation adding 1 to the specialisation_depth. |
1..1 |
True if language |
|
1..1 |
True if there are bindings to terminology |
|
1..1 |
True if code |
|
1..1 |
term_definition ( |
Term definition for a code, in a specified language. |
1..1 |
term_binding ( |
Binding of constraint corresponding to |
1..1 |
List of terminologies to which term or constraint bindings exist in this terminology, computed from bindings. |
|
1..1 |
List of languages in which terms in this terminology are available. |
|
Invariants |
Original_language_validity: |
|
concept_code_validity: |
||
Term_bindings_validity: |
||
Parent_archetype_valid: |
||
TERM Class
-
Definition
Class |
TERM |
|
|---|---|---|
Description |
Representation of any coded entity (term or constraint) in the artefact terminology. |
|
Attributes |
Signature |
Meaning |
1..1 |
code: |
Code of this term. |
1..1 |
text: |
Short term text, typically for display. |
1..1 |
description: |
Full description text. |
0..1 |
Hash of keys and corresponding values for other items in a term, e.g. provenance. Hash of keys ("text", "description" etc) and corresponding values. |
|
TERM_BINDING Class
-
Definition
Class |
TERM_BINDING |
|
|---|---|---|
Description |
One binding between a local gt-code and one or more external bindings |
|
Attributes |
Signature |
Meaning |
0..1 |
List of external codes, typically parsed in either URI form or openEHR standard form namespace '::' code. |
|
1..1 |
code: |
Local gt-code to which external terms are bound. |