The openehr_extract Package

Overview

The rm.extract.openehr_extract package defines an openEHR-specific variant of an EXTRACT_ITEM, which consists of a form of the VERSIONED_OBJECT<T> class from the rm.common. change_control package suitable for use in Extracts. The Extract form of the class is X_VERSIONED_OBJECT<T>, and consists of attributes which replicate functional values from the EHR form of the class. This class is further subtyped via binding to non-generic types corresponding to the top-level object types of the openEHR EHR.

The UML diagram below illustrates the rm.extract.openehr_extract package.

RM ehr extract.openehr extract
Figure 1. rm.extract.openehr_extract Package

The following figure illustrates a typical instance structure of an EHR Extract.

typical extract structure
Figure 2. Typical EHR Extract structure

Design

openEHR Extract Item

Items from an openEHR sytem included in an EHR Extract are always top-level objects (Composition, Directory, EHR_EXTRACT, PARTY, etc, and descendants) are expressed in the serialisable form of descendants of X_VERSIONED_OBJECT<T>. This type provides a standard interoperable way to serialise all or part of VERSIONED_OBJECTs for lossless transmission between systems, regardless of the likely implementation differences in versioning at each end. Accordingly, X_VERSIONED_OBJECT turns most functional properties of VERSIONED_OBJECT into data attributes. The two attributes of most interest are revision_history, which enables the optional inclusion of the complete revision history from the original VERSIONED_OBJECT, and versions, which allows any or all of the versions to be included form the original. The revision history can be requested on its own using by setting the includes_data flag of the version specification to False.

In most scenarios, versions will be included, and revision_history excluded. Each item in X_VERSIONED_OBJECT.versions consists of a wrapped copy of an ORIGINAL_VERSION from the corresponding VERSIONED_OBJECT object in the source system.

EHR Extract Structure

The overall structure of the openEHR EHR for a subject can be replicated with an archetyped Folder structure that creates the groupings of directory, compositions, ehr_access, and ehr_status that are found in an openEHR EHR. This use of folders is not mandatory, but is likely to be useful in most cases, and is the structure shown in Typical EHR Extract structure above.

Demographic Referencing

Within the content an EHR Extract, wherever PARTICIPATION and PARTY_PROXY structures occur (for the latter, the PARTY_SELF and PARTY_IDENTIFIED descendants), they are preserved intact, for reasons of fidelity. However, the final 'pointer', i.e. the OBJECT_ID.value may be rewritten within the Extract to correctly refer to the intended demographic. A typical S_PARTICIPATION structure is illustrated at the bottom of Typical EHR Extract structure. In this figure, the OBJECT_ID.value has been rewritten to refer to the uid (11111111) of the first OPENEHR_CONTENT_ITEM object shown in the figure.

Class Descriptions

OPENEHR_CONTENT_ITEM Class

  • Definition

  • Effective

  • BMM

  • UML

Class

OPENEHR_CONTENT_ITEM

Description

Form of EHR EXTRACT_ITEM containing openEHR serialised VERSIONED_OBJECTs.

Inherit

EXTRACT_CONTENT_ITEM

Attributes

Signature

Meaning

0..1
(effected)

item: X_VERSIONED_OBJECT

Content object.

OPENEHR_CONTENT_ITEM

Form of EHR EXTRACT_ITEM containing openEHR serialised VERSIONED_OBJECTs.

Inherits: Any, PATHABLE, LOCATABLE, EXTRACT_ITEM, EXTRACT_CONTENT_ITEM

Attributes

LOCATABLE.name: DV_TEXT [1..1]

Runtime name of this fragment, used to build runtime paths. This is the term provided via a clinical application or batch process to name this EHR construct: its retention in the EHR faithfully preserves the original label by which this entry was known to end users.

LOCATABLE.archetype_node_id: String [1..1]

Design-time archetype identifier of this node taken from its generating archetype; used to build archetype paths. Always in the form of an at-code, e.g. at0005. This value enables a 'standardised' name for this node to be generated, by referring to the generating archetype local terminology.

At an archetype root point, the value of this attribute is always the stringified form of the archetype_id found in the archetype_details object.

LOCATABLE.uid: UID_BASED_ID [0..1]

Optional globally unique object identifier for root points of archetyped structures.

LOCATABLE.links: List<LINK> [0..1]

Links to other archetyped structures (data whose root object inherits from ARCHETYPED, such as ENTRY, SECTION and so on). Links may be to structures in other compositions.

LOCATABLE.archetype_details: ARCHETYPED [0..1]

Details of archetyping used on this node.

LOCATABLE.feeder_audit: FEEDER_AUDIT [0..1]

Audit trail from non-openEHR system of original commit of information forming the content of this node, or from a conversion gateway which has synthesised this node.

EXTRACT_CONTENT_ITEM.is_primary: Boolean [1..1]

True if the content item carried in this container was part of the primary set for the Extract, i.e. not added due to link-following.

EXTRACT_CONTENT_ITEM.is_changed: Boolean [0..1]

True if the content item carried in this container is any kind of change since last send, in repeat sending situations.

EXTRACT_CONTENT_ITEM.is_masked: Boolean [0..1]

True if the content of this item has not been included due to insufficient access rights of requestor.

item: X_VERSIONED_OBJECT [0..1]

Content object.

Functions

(abstract) Any.is_equal (
other: Any[1]
): Boolean [1..1]

Value equality: return True if this and other are attached to objects considered to be equal in value.

Parameters
other

Other object for comparison.

Any.equal alias "=", "==" (
other: Any[1]
): Boolean [1..1]

Reference equality for reference types, value equality for value types.

Parameters
other

Other object for comparison.

Any.instance_of (
a_type: String[1]
): Any [1..1]

Create new instance of a type.

Any.type_of (
an_object: Any[1]
): String [1..1]

Type name of an object as a string. May include generic parameters, as in "Interval<Time>".

Any.not_equal alias "!=", "≠" (
other: Ordered[1]
): Boolean [1..1]

True if current object not equal to other. Returns not equal().

PATHABLE.parent (): PATHABLE [1..1]

Parent of this node in a compositional hierarchy.

PATHABLE.item_at_path (
a_path: String[1]
): Any

Pre: path_unique (a_path) [1..1]

The item at a path (relative to this item); only valid for unique paths, i.e. paths that resolve to a single item.

PATHABLE.items_at_path (
a_path: String[1]
): List<Any> [0..1]

List of items corresponding to a non-unique path.

PATHABLE.path_exists (
a_path: String[1]
): Boolean

Pre: not a_path.is_empty [1..1]

True if the path exists in the data with respect to the current item.

PATHABLE.path_unique (
a_path: String[1]
): Boolean

Pre: path_exists (a_path) [1..1]

True if the path corresponds to a single item in the data.

PATHABLE.path_of_item (
a_loc: PATHABLE[1]
): String [1..1]

The path to an item relative to the root of this archetyped structure.

LOCATABLE.concept (): DV_TEXT [1..1]

Clinical concept of the archetype as a whole (= derived from the archetype_node_id' of the root node)

LOCATABLE.is_archetype_root (): Boolean [1..1]

True if this node is the root of an archetyped structure.

Invariants

LOCATABLE.Links_valid: links /= Void implies not links.is_empty

LOCATABLE.Archetyped_valid: is_archetype_root xor archetype_details = Void

LOCATABLE.Archetype_node_id_valid: not archetype_node_id.is_empty

EXTRACT_CONTENT_ITEM.Item_validity: is_masked xor item /= Void

{
    "name": "OPENEHR_CONTENT_ITEM",
    "documentation": "Form of `EHR EXTRACT_ITEM` containing openEHR serialised `VERSIONED_OBJECTs`.",
    "ancestors": [
        "EXTRACT_CONTENT_ITEM"
    ],
    "properties": {
        "item": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "item",
            "documentation": "Content object.",
            "type": "X_VERSIONED_OBJECT"
        }
    }
}
OPENEHR_CONTENT_ITEM

X_VERSIONED_OBJECT Class

  • Definition

  • Effective

  • BMM

  • UML

Class

X_VERSIONED_OBJECT<T>

Description

Variety of Extract content that consists is a sharable data-oriented version of VERSIONED_OBJECT<T>.

Attributes

Signature

Meaning

1..1

uid: HIER_OBJECT_ID

Uid of original VERSIONED_OBJECT.

1..1

owner_id: OBJECT_REF

Owner_id from original VERSIONED_OBJECT, which identifies source EHR.

1..1

time_created: DV_DATE_TIME

Creation time of original VERSIONED_OBJECT.

1..1

total_version_count: Integer

Total number of versions in original VERSIONED_OBJECT at time of creation of this X_VERSIONED_OBJECT.

1..1

extract_version_count: Integer

The number of Versions in this extract for this Versioned object, i.e. the count of items in the versions attribute. May be 0 if only revision history is requested.

0..1

revision_history: REVISION_HISTORY

Optional revision history of the original VERSIONED_OBJECT. If included, it is the complete revision history.

0..1

versions: List<ORIGINAL_VERSION<T>>

0 or more Versions from the original VERSIONED_OBJECT, according to the Extract specification.

X_VERSIONED_OBJECT<T>

Variety of Extract content that consists is a sharable data-oriented version of VERSIONED_OBJECT<T>.

Attributes

uid: HIER_OBJECT_ID [1..1]

Uid of original VERSIONED_OBJECT.

owner_id: OBJECT_REF [1..1]

Owner_id from original VERSIONED_OBJECT, which identifies source EHR.

time_created: DV_DATE_TIME [1..1]

Creation time of original VERSIONED_OBJECT.

total_version_count: Integer [1..1]

Total number of versions in original VERSIONED_OBJECT at time of creation of this X_VERSIONED_OBJECT.

extract_version_count: Integer [1..1]

The number of Versions in this extract for this Versioned object, i.e. the count of items in the versions attribute. May be 0 if only revision history is requested.

revision_history: REVISION_HISTORY [0..1]

Optional revision history of the original VERSIONED_OBJECT. If included, it is the complete revision history.

versions: List<ORIGINAL_VERSION<T>> [0..1]

0 or more Versions from the original VERSIONED_OBJECT, according to the Extract specification.

{
    "name": "X_VERSIONED_OBJECT",
    "documentation": "Variety of Extract content that consists is a sharable data-oriented version of `VERSIONED_OBJECT<T>`.",
    "generic_parameter_defs": {
        "T": {
            "name": "T"
        }
    },
    "properties": {
        "uid": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "uid",
            "documentation": "Uid of original `VERSIONED_OBJECT`.",
            "is_mandatory": true,
            "type": "HIER_OBJECT_ID"
        },
        "owner_id": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "owner_id",
            "documentation": "Owner_id from original `VERSIONED_OBJECT`, which identifies source EHR.",
            "is_mandatory": true,
            "type": "OBJECT_REF"
        },
        "time_created": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "time_created",
            "documentation": "Creation time of original `VERSIONED_OBJECT`.",
            "is_mandatory": true,
            "type": "DV_DATE_TIME"
        },
        "total_version_count": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "total_version_count",
            "documentation": "Total number of versions in original `VERSIONED_OBJECT` at time of creation of this `X_VERSIONED_OBJECT`.",
            "is_mandatory": true,
            "type": "Integer"
        },
        "extract_version_count": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "extract_version_count",
            "documentation": "The number of Versions in this extract for this Versioned object, i.e. the count of items in the versions attribute. May be 0 if only revision history is requested.",
            "is_mandatory": true,
            "type": "Integer"
        },
        "revision_history": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "revision_history",
            "documentation": "Optional revision history of the original `VERSIONED_OBJECT`. If included, it is the complete revision history.",
            "type": "REVISION_HISTORY"
        },
        "versions": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "versions",
            "documentation": "0 or more Versions from the original `VERSIONED_OBJECT`, according to the Extract specification.",
            "type_def": {
                "container_type": "List",
                "type_def": {
                    "_type": "P_BMM_GENERIC_TYPE",
                    "root_type": "ORIGINAL_VERSION",
                    "generic_parameters": [
                        "T"
                    ]
                }
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        }
    }
}
X_VERSIONED_OBJECT

X_VERSIONED_EHR_ACCESS Class

  • Definition

  • Effective

  • BMM

  • UML

Class

X_VERSIONED_EHR_ACCESS

Description

Form of X_VERSIONED_OBJECT for EHR_ACCESS EHR object.

Inherit

X_VERSIONED_OBJECT

X_VERSIONED_EHR_ACCESS

Form of X_VERSIONED_OBJECT for EHR_ACCESS EHR object.

Inherits: X_VERSIONED_OBJECT

Attributes

X_VERSIONED_OBJECT.uid: HIER_OBJECT_ID [1..1]

Uid of original VERSIONED_OBJECT.

X_VERSIONED_OBJECT.owner_id: OBJECT_REF [1..1]

Owner_id from original VERSIONED_OBJECT, which identifies source EHR.

X_VERSIONED_OBJECT.time_created: DV_DATE_TIME [1..1]

Creation time of original VERSIONED_OBJECT.

X_VERSIONED_OBJECT.total_version_count: Integer [1..1]

Total number of versions in original VERSIONED_OBJECT at time of creation of this X_VERSIONED_OBJECT.

X_VERSIONED_OBJECT.extract_version_count: Integer [1..1]

The number of Versions in this extract for this Versioned object, i.e. the count of items in the versions attribute. May be 0 if only revision history is requested.

X_VERSIONED_OBJECT.revision_history: REVISION_HISTORY [0..1]

Optional revision history of the original VERSIONED_OBJECT. If included, it is the complete revision history.

X_VERSIONED_OBJECT.versions: List<ORIGINAL_VERSION<T>> [0..1]

0 or more Versions from the original VERSIONED_OBJECT, according to the Extract specification.

{
    "name": "X_VERSIONED_EHR_ACCESS",
    "documentation": "Form of `X_VERSIONED_OBJECT` for `EHR_ACCESS` EHR object.",
    "ancestors": [
        "X_VERSIONED_OBJECT"
    ]
}
X_VERSIONED_EHR_ACCESS

X_VERSIONED_EHR_STATUS Class

  • Definition

  • Effective

  • BMM

  • UML

Class

X_VERSIONED_EHR_STATUS

Description

Form of X_VERSIONED_OBJECT for EHR_STATUS EHR object.

Inherit

X_VERSIONED_OBJECT

X_VERSIONED_EHR_STATUS

Form of X_VERSIONED_OBJECT for EHR_STATUS EHR object.

Inherits: X_VERSIONED_OBJECT

Attributes

X_VERSIONED_OBJECT.uid: HIER_OBJECT_ID [1..1]

Uid of original VERSIONED_OBJECT.

X_VERSIONED_OBJECT.owner_id: OBJECT_REF [1..1]

Owner_id from original VERSIONED_OBJECT, which identifies source EHR.

X_VERSIONED_OBJECT.time_created: DV_DATE_TIME [1..1]

Creation time of original VERSIONED_OBJECT.

X_VERSIONED_OBJECT.total_version_count: Integer [1..1]

Total number of versions in original VERSIONED_OBJECT at time of creation of this X_VERSIONED_OBJECT.

X_VERSIONED_OBJECT.extract_version_count: Integer [1..1]

The number of Versions in this extract for this Versioned object, i.e. the count of items in the versions attribute. May be 0 if only revision history is requested.

X_VERSIONED_OBJECT.revision_history: REVISION_HISTORY [0..1]

Optional revision history of the original VERSIONED_OBJECT. If included, it is the complete revision history.

X_VERSIONED_OBJECT.versions: List<ORIGINAL_VERSION<T>> [0..1]

0 or more Versions from the original VERSIONED_OBJECT, according to the Extract specification.

{
    "name": "X_VERSIONED_EHR_STATUS",
    "documentation": "Form of `X_VERSIONED_OBJECT` for `EHR_STATUS` EHR object.",
    "ancestors": [
        "X_VERSIONED_OBJECT"
    ]
}
X_VERSIONED_EHR_STATUS

X_VERSIONED_COMPOSITION Class

  • Definition

  • Effective

  • BMM

  • UML

Class

X_VERSIONED_COMPOSITION

Description

Form of X_VERSIONED_OBJECT for COMPOSITION EHR object.

Inherit

X_VERSIONED_OBJECT

X_VERSIONED_COMPOSITION

Form of X_VERSIONED_OBJECT for COMPOSITION EHR object.

Inherits: X_VERSIONED_OBJECT

Attributes

X_VERSIONED_OBJECT.uid: HIER_OBJECT_ID [1..1]

Uid of original VERSIONED_OBJECT.

X_VERSIONED_OBJECT.owner_id: OBJECT_REF [1..1]

Owner_id from original VERSIONED_OBJECT, which identifies source EHR.

X_VERSIONED_OBJECT.time_created: DV_DATE_TIME [1..1]

Creation time of original VERSIONED_OBJECT.

X_VERSIONED_OBJECT.total_version_count: Integer [1..1]

Total number of versions in original VERSIONED_OBJECT at time of creation of this X_VERSIONED_OBJECT.

X_VERSIONED_OBJECT.extract_version_count: Integer [1..1]

The number of Versions in this extract for this Versioned object, i.e. the count of items in the versions attribute. May be 0 if only revision history is requested.

X_VERSIONED_OBJECT.revision_history: REVISION_HISTORY [0..1]

Optional revision history of the original VERSIONED_OBJECT. If included, it is the complete revision history.

X_VERSIONED_OBJECT.versions: List<ORIGINAL_VERSION<T>> [0..1]

0 or more Versions from the original VERSIONED_OBJECT, according to the Extract specification.

{
    "name": "X_VERSIONED_COMPOSITION",
    "documentation": "Form of `X_VERSIONED_OBJECT` for `COMPOSITION` EHR object.",
    "ancestors": [
        "X_VERSIONED_OBJECT"
    ]
}
X_VERSIONED_COMPOSITION

X_VERSIONED_FOLDER Class

  • Definition

  • Effective

  • BMM

  • UML

Class

X_VERSIONED_FOLDER

Description

Form of X_VERSIONED_OBJECT for FOLDER EHR object.

Inherit

X_VERSIONED_OBJECT

X_VERSIONED_FOLDER

Form of X_VERSIONED_OBJECT for FOLDER EHR object.

Inherits: X_VERSIONED_OBJECT

Attributes

X_VERSIONED_OBJECT.uid: HIER_OBJECT_ID [1..1]

Uid of original VERSIONED_OBJECT.

X_VERSIONED_OBJECT.owner_id: OBJECT_REF [1..1]

Owner_id from original VERSIONED_OBJECT, which identifies source EHR.

X_VERSIONED_OBJECT.time_created: DV_DATE_TIME [1..1]

Creation time of original VERSIONED_OBJECT.

X_VERSIONED_OBJECT.total_version_count: Integer [1..1]

Total number of versions in original VERSIONED_OBJECT at time of creation of this X_VERSIONED_OBJECT.

X_VERSIONED_OBJECT.extract_version_count: Integer [1..1]

The number of Versions in this extract for this Versioned object, i.e. the count of items in the versions attribute. May be 0 if only revision history is requested.

X_VERSIONED_OBJECT.revision_history: REVISION_HISTORY [0..1]

Optional revision history of the original VERSIONED_OBJECT. If included, it is the complete revision history.

X_VERSIONED_OBJECT.versions: List<ORIGINAL_VERSION<T>> [0..1]

0 or more Versions from the original VERSIONED_OBJECT, according to the Extract specification.

{
    "name": "X_VERSIONED_FOLDER",
    "documentation": "Form of `X_VERSIONED_OBJECT` for `FOLDER` EHR object.",
    "ancestors": [
        "X_VERSIONED_OBJECT"
    ]
}
X_VERSIONED_FOLDER

X_VERSIONED_PARTY Class

  • Definition

  • Effective

  • BMM

  • UML

Class

X_VERSIONED_PARTY

Description

Form of X_VERSIONED_OBJECT for PARTY demographic object.

Inherit

X_VERSIONED_OBJECT

X_VERSIONED_PARTY

Form of X_VERSIONED_OBJECT for PARTY demographic object.

Inherits: X_VERSIONED_OBJECT

Attributes

X_VERSIONED_OBJECT.uid: HIER_OBJECT_ID [1..1]

Uid of original VERSIONED_OBJECT.

X_VERSIONED_OBJECT.owner_id: OBJECT_REF [1..1]

Owner_id from original VERSIONED_OBJECT, which identifies source EHR.

X_VERSIONED_OBJECT.time_created: DV_DATE_TIME [1..1]

Creation time of original VERSIONED_OBJECT.

X_VERSIONED_OBJECT.total_version_count: Integer [1..1]

Total number of versions in original VERSIONED_OBJECT at time of creation of this X_VERSIONED_OBJECT.

X_VERSIONED_OBJECT.extract_version_count: Integer [1..1]

The number of Versions in this extract for this Versioned object, i.e. the count of items in the versions attribute. May be 0 if only revision history is requested.

X_VERSIONED_OBJECT.revision_history: REVISION_HISTORY [0..1]

Optional revision history of the original VERSIONED_OBJECT. If included, it is the complete revision history.

X_VERSIONED_OBJECT.versions: List<ORIGINAL_VERSION<T>> [0..1]

0 or more Versions from the original VERSIONED_OBJECT, according to the Extract specification.

{
    "name": "X_VERSIONED_PARTY",
    "documentation": "Form of `X_VERSIONED_OBJECT` for `PARTY` demographic object.",
    "ancestors": [
        "X_VERSIONED_OBJECT"
    ]
}
X_VERSIONED_PARTY