Basic Package

Overview

The data_types.basic package, illustrated below, contains types for the concepts of bistate, state (in a state machine) and real-world entity identifiers (see the openEHR Common IM for a discussion on identifier types).

RM data types.basic
Figure 1. rm.data_types.basic package

Requirements

Bi-state Values

One of the most basic types of data is boolean or bi-state data. The need here is for a type which both includes a boolean value, and which inherits from the type DATA_VALUE, enabling it to be used as an ELEMENT.value.

State Machine States

A type is required to represent state values of a state machine. In a simple system of data types, a simple integer would appear sufficient to perform this job. However, in an archetyped framework, a distinct type is required, so that it can be archetyped not by the constraints used for integers, but by a state machine definition instead. The type DV_STATE is provided for this purpose. An example of a state machine which models the lifecycle of a medication order is illustrated in the figure below. This definition would appear in an archetype; the values of a DV_STATE object are then restricted to the values of the states in the definition.

state machine
Figure 2. Example State Machine for Medication Orders

Real-world Entity Identification

Real world entities (RWEs) such as people, car engines, invoices, and appointments may all be assigned identifiers. Although many of these are designed to be unique within a jurisdiction or issuing space, they are often not, due to data entry errors, bad design (ids which are too small or incorporate some non-unique characteristic of the identified entities), bad process (e.g. non-synchronised id issuing points); identity theft (e.g. via theft of documents of proof or hacking). In general, while some real world identifiers (RWIs) are 'nearly unique', none can be guaranteed so. Therefore, from a strict computatoinal point of view, RWIs are not treated as reliable identifiers, but as attributes of their owning objects, in the same ways as names and addresses for example.

Examples of RWE identifiers which are intended to be unique within the space of the issuing authority or organisation include:

  • driver’s licence id

  • social security number

  • passport number

  • prescription id

The defining logical characteristic of RWE ids is that they continue to identify the entities in question, regardless of how they change in time; for example a social security number does not change when someone changes their hair colour or even their gender (both of which attributes may be recorded in the database). In general it should be the case that if two RWE ids are equal, they refer to the same RWE.

At a practical level, RWE identifiers differ from information entity (IE) identifiers in that the former are generally not assigned by the computing infrastructure that uses them - that is to say, in the production computing system, such identifiers are no different from other characteristics of the entity, such as names or addresses.

Note: Some messaging standards make use of a "time validity" or similar attribute on identifier datatypes. The recommended way of representing validity timespans of identifiers in openEHR is to model this using archetypes and templates so that regional or use-case specific needs can be better represented.

Design

The model defined here in the DV_IDENTIFIER class allows the recording of three things as part of identifying an item of interest:

  • the identifier given to the item of interest (mandatory).

  • the issuing authority of the kind of id used (e.g. it might be the federal department of health) (optional);

  • the assigner of the id to the item being identified. This is usually the organisation which created the item being identified (optional);

In addition, a type of item being identified can also be recorded, such as 'driver’s licence' or 'Medicare card'. All fields are text fields, rather than coded, as no definitive vocabularies are available. However, some useful sources of terms exists, such as HL7v2 Table 0203 for the type field. If using the latter, it is recommended to use the 'description', not the code.

Only the identifier field is mandatory to allow for use cases in which the other fields cannot be populated. However it is strongly recommended to populate the type and issuer fields where possible. In many cases the issuer and assigner have the same value, however two fields allow for the situation in which a central issuer provides blocks of identifiers (typically on some kind of form or other paperwork) to other organisations who then assign them to individuals, as is often done with prescription identifiers.

See the Support IM specification for a further discussion of RWEs and IEs, and the definition of IEs in openEHR.

Class Descriptions

DATA_VALUE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

DATA_VALUE (abstract)

Description

Abstract parent of all DV_ data value types.

Inherit

OPENEHR_DEFINITIONS

DATA_VALUE (abstract)

Abstract parent of all DV_ data value types.

Inherits: BASIC_DEFINITIONS, OPENEHR_DEFINITIONS

Constants

BASIC_DEFINITIONS.CR: Character = '\015' [1..1]

Carriage return character.

BASIC_DEFINITIONS.LF: Character = '\012' [1..1]

Line feed character.

BASIC_DEFINITIONS.Any_type_name: String = "Any" [1..1]

BASIC_DEFINITIONS.Regex_any_pattern: String = ".*" [1..1]

BASIC_DEFINITIONS.Default_encoding: String = "UTF-8" [1..1]

BASIC_DEFINITIONS.None_type_name: String = "None" [1..1]

OPENEHR_DEFINITIONS.Local_terminology_id: String = "local" [1..1]

Predefined terminology identifier to indicate it is local to the knowledge resource in which it occurs, e.g. an archetype

{
    "name": "DATA_VALUE",
    "documentation": "Abstract parent of all `DV_` data value types.",
    "is_abstract": true,
    "ancestors": [
        "OPENEHR_DEFINITIONS"
    ]
}
DATA_VALUE

DV_BOOLEAN Class

  • Definition

  • Effective

  • BMM

  • UML

Class

DV_BOOLEAN

Description

Items which are truly boolean data, such as true/false or yes/no answers. For such data, it is important to devise the meanings (usually questions in subjective data) carefully, so that the only allowed results are in fact true or false.

Misuse: The DV_BOOLEAN class should not be used as a replacement for naively modelled enumerated types such as male/female etc. Such values should be coded, and in any case the enumeration often has more than two values.

Inherit

DATA_VALUE

Attributes

Signature

Meaning

1..1

value: Boolean

Boolean value of this item. Actual values may be language or implementation dependent.

DV_BOOLEAN

Items which are truly boolean data, such as true/false or yes/no answers. For such data, it is important to devise the meanings (usually questions in subjective data) carefully, so that the only allowed results are in fact true or false.

Misuse: The DV_BOOLEAN class should not be used as a replacement for naively modelled enumerated types such as male/female etc. Such values should be coded, and in any case the enumeration often has more than two values.

Inherits: BASIC_DEFINITIONS, OPENEHR_DEFINITIONS, DATA_VALUE

Constants

BASIC_DEFINITIONS.CR: Character = '\015' [1..1]

Carriage return character.

BASIC_DEFINITIONS.LF: Character = '\012' [1..1]

Line feed character.

BASIC_DEFINITIONS.Any_type_name: String = "Any" [1..1]

BASIC_DEFINITIONS.Regex_any_pattern: String = ".*" [1..1]

BASIC_DEFINITIONS.Default_encoding: String = "UTF-8" [1..1]

BASIC_DEFINITIONS.None_type_name: String = "None" [1..1]

OPENEHR_DEFINITIONS.Local_terminology_id: String = "local" [1..1]

Predefined terminology identifier to indicate it is local to the knowledge resource in which it occurs, e.g. an archetype

Attributes

value: Boolean [1..1]

Boolean value of this item. Actual values may be language or implementation dependent.

{
    "name": "DV_BOOLEAN",
    "documentation": "Items which are truly boolean data, such as true/false or yes/no answers. For such data, it is important to devise the meanings (usually questions in subjective data)  carefully, so that the only allowed results are in fact true or false. \n\nMisuse: The DV_BOOLEAN class should not be used as a replacement for naively modelled enumerated types such as male/female etc. Such values should be coded, and in any case the enumeration often has more than two values. \n",
    "ancestors": [
        "DATA_VALUE"
    ],
    "properties": {
        "value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "value",
            "documentation": "Boolean value of this item. Actual values may be language or implementation dependent.",
            "is_mandatory": true,
            "type": "Boolean"
        }
    }
}
DV_BOOLEAN

DV_STATE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

DV_STATE

Description

For representing state values which obey a defined state machine, such as a variable representing the states of an instruction or care process.

DV_STATE is expressed as a String but its values are driven by archetype-defined state machines. This provides a powerful way of capturing stateful complex processes in simple data.

Inherit

DATA_VALUE

Attributes

Signature

Meaning

1..1

value: DV_CODED_TEXT

The state name. State names are determined by a state/event table defined in archetypes, and coded using openEHR Terminology or local archetype terms, as specified by the archetype.

1..1

is_terminal: Boolean

Indicates whether this state is a terminal state, such as "aborted", "completed" etc. from which no further transitions are possible.

DV_STATE

For representing state values which obey a defined state machine, such as a variable representing the states of an instruction or care process.

DV_STATE is expressed as a String but its values are driven by archetype-defined state machines. This provides a powerful way of capturing stateful complex processes in simple data.

Inherits: BASIC_DEFINITIONS, OPENEHR_DEFINITIONS, DATA_VALUE

Constants

BASIC_DEFINITIONS.CR: Character = '\015' [1..1]

Carriage return character.

BASIC_DEFINITIONS.LF: Character = '\012' [1..1]

Line feed character.

BASIC_DEFINITIONS.Any_type_name: String = "Any" [1..1]

BASIC_DEFINITIONS.Regex_any_pattern: String = ".*" [1..1]

BASIC_DEFINITIONS.Default_encoding: String = "UTF-8" [1..1]

BASIC_DEFINITIONS.None_type_name: String = "None" [1..1]

OPENEHR_DEFINITIONS.Local_terminology_id: String = "local" [1..1]

Predefined terminology identifier to indicate it is local to the knowledge resource in which it occurs, e.g. an archetype

Attributes

value: DV_CODED_TEXT [1..1]

The state name. State names are determined by a state/event table defined in archetypes, and coded using openEHR Terminology or local archetype terms, as specified by the archetype.

is_terminal: Boolean [1..1]

Indicates whether this state is a terminal state, such as "aborted", "completed" etc. from which no further transitions are possible.

{
    "name": "DV_STATE",
    "documentation": "For representing state values which obey a defined state machine, such as a variable  representing the states of an instruction or care process. \n\nDV_STATE is expressed as a String but its values are driven by archetype-defined  state machines. This provides a powerful way of capturing stateful complex processes  in simple data. \n",
    "ancestors": [
        "DATA_VALUE"
    ],
    "properties": {
        "value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "value",
            "documentation": "The state name. State names are determined by a state/event table defined in archetypes, and coded using openEHR Terminology or local archetype terms, as specified by the archetype. ",
            "is_mandatory": true,
            "type": "DV_CODED_TEXT"
        },
        "is_terminal": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "is_terminal",
            "documentation": "Indicates whether this state is a terminal state, such as  \"aborted\",  \"completed\" etc. from which no further transitions are possible.",
            "is_mandatory": true,
            "type": "Boolean"
        }
    }
}
DV_STATE

DV_IDENTIFIER Class

  • Definition

  • Effective

  • BMM

  • UML

Class

DV_IDENTIFIER

Description

Type for representing identifiers of real-world entities. Typical identifiers include drivers licence number, social security number, veterans affairs number, prescription id, order id, and so on.

DV_IDENTIFIER is used to represent any identifier of a real thing, issued by some authority or agency.

Misuse: DV_IDENTIFIER is not used to express identifiers generated by the infrastructure to refer to information items; the types OBJECT_ID and OBJECT_REF and subtypes are defined for this purpose.

Inherit

DATA_VALUE

Attributes

Signature

Meaning

0..1

issuer: String

Optional authority which issues the kind of id used in the id field of this object.

0..1

assigner: String

Optional organisation that assigned the id to the item being identified.

1..1

id: String

The identifier value. Often structured, according to the definition of the issuing authority’s rules.

0..1

type: String

Optional identifier type, such as prescription , or Social Security Number . One day a controlled vocabulary might be possible for this.

Invariants

Issuer_valid: not issuer.is_empty

Assigner_valid: not assigner.is_empty

Id_valid: not id.is_empty

Type_valid: not type.is_empty

DV_IDENTIFIER

Type for representing identifiers of real-world entities. Typical identifiers include drivers licence number, social security number, veterans affairs number, prescription id, order id, and so on.

DV_IDENTIFIER is used to represent any identifier of a real thing, issued by some authority or agency.

Misuse: DV_IDENTIFIER is not used to express identifiers generated by the infrastructure to refer to information items; the types OBJECT_ID and OBJECT_REF and subtypes are defined for this purpose.

Inherits: BASIC_DEFINITIONS, OPENEHR_DEFINITIONS, DATA_VALUE

Constants

BASIC_DEFINITIONS.CR: Character = '\015' [1..1]

Carriage return character.

BASIC_DEFINITIONS.LF: Character = '\012' [1..1]

Line feed character.

BASIC_DEFINITIONS.Any_type_name: String = "Any" [1..1]

BASIC_DEFINITIONS.Regex_any_pattern: String = ".*" [1..1]

BASIC_DEFINITIONS.Default_encoding: String = "UTF-8" [1..1]

BASIC_DEFINITIONS.None_type_name: String = "None" [1..1]

OPENEHR_DEFINITIONS.Local_terminology_id: String = "local" [1..1]

Predefined terminology identifier to indicate it is local to the knowledge resource in which it occurs, e.g. an archetype

Attributes

issuer: String [0..1]

Optional authority which issues the kind of id used in the id field of this object.

assigner: String [0..1]

Optional organisation that assigned the id to the item being identified.

id: String [1..1]

The identifier value. Often structured, according to the definition of the issuing authority’s rules.

type: String [0..1]

Optional identifier type, such as prescription , or Social Security Number . One day a controlled vocabulary might be possible for this.

Invariants

Issuer_valid: not issuer.is_empty

Assigner_valid: not assigner.is_empty

Id_valid: not id.is_empty

Type_valid: not type.is_empty

{
    "name": "DV_IDENTIFIER",
    "documentation": "Type for representing identifiers of real-world entities. Typical identifiers include drivers licence number, social security number, veterans affairs number, prescription id, order id, and so on.\n\nDV_IDENTIFIER is used to represent any identifier of a real thing, issued by some authority or agency. \n\nMisuse: DV_IDENTIFIER is not used to express identifiers generated by the infrastructure to refer to information items; the types OBJECT_ID and OBJECT_REF and subtypes are defined for this purpose.",
    "ancestors": [
        "DATA_VALUE"
    ],
    "properties": {
        "issuer": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "issuer",
            "documentation": "Optional authority which issues the kind of id used in the id field of this object. ",
            "type": "String"
        },
        "assigner": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "assigner",
            "documentation": "Optional organisation that assigned the id to the item being identified.",
            "type": "String"
        },
        "id": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "id",
            "documentation": "The identifier value. Often structured, according to the definition of the issuing authority's rules. ",
            "is_mandatory": true,
            "type": "String"
        },
        "type": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "type",
            "documentation": "Optional identifier type, such as  prescription , or  Social Security Number . One day a controlled vocabulary might be possible for this.",
            "type": "String"
        }
    },
    "invariants": {
        "Issuer_valid": "not issuer.is_empty",
        "Assigner_valid": "not assigner.is_empty",
        "Id_valid": "not id.is_empty",
        "Type_valid": "not type.is_empty"
    }
}
DV_IDENTIFIER