Item Structure Package

Overview

The item_structure package classes presented here are a formalisation of the need for generic, archetypable data structures, and are used by all openEHR reference models.

The subtypes of the ITEM_STRUCTURE class explicitly model the logical data structure types which typically occur in health record data, and include ITEM_SINGLE (for single values such as a patient weight), ITEM_LIST (for lists such as parts of an address), ITEM_TREE (for hierarchically structured data such as a microbiology report) and ITEM_TABLE (for tabular data such as visual acuity or reflex test results). Each of these classes defines a functional interface, has an optimal physical representation using the basic types CLUSTER and ELEMENT from the representation package, and can generate a ISO 13606 compliant hierarchical representation of its data. Any system implementing these types is guaranteed to create data which represents the logical structures of lists, tables and trees identically.

Data values are connected to spatial structures via the value attribute of the ELEMENT class of the representation cluster. This class also carries the attribute null_flavour, whose value indicates how to read the contents of the value attribute. Values from the openEHR null flavours vocabulary, including 253|unknown|, 271|no information|, 272|masked|, and 273|not applicable| are used to populate it. Only a small number of generic codes are defined, in order to avoid complex processing for most data instances, for which this simple classification of null is sufficient.

In some circumstances however, additional detail is required in addition to the null flavour code. Examples include reporting and where specific reasons for lack of data have medico-legal ramifications, e.g. 'patient was unconscious', 'patient refused to tell me', 'no reason provided'. For these situations, the optional null_reason field may be used to record a specific reason.

The openEHR class model for spatial structures is illustrated on the right-hand side of [data_structures_package]. It should be noted that these classes (ITEM_LIST etc) are not equivalents of similarly named classes (such as List<T>) in most data structure libraries - they also include per-node name, archetype_node_id and leaf node value and null flavour, and path capabilities.

ISO 13606 Encoding Rules

ITEM_SINGLE

An ITEM_SINGLE object is encoded in ISO 13606 as a single ELEMENT object.

ITEM_LIST

An ITEM_LIST object is encoded in ISO 13606 as a CLUSTER object containing the set of ELEMENTs from the openEHR list.

ITEM_TABLE

The ITEM_TABLE encoding rules are as follows:

  • Each row is encoded as a Cluster containing a number of ELEMENTs, each corresponding to the value of a column in that row.

  • An empty/void column value for a row is represented by an ELEMENT containing no value, and with null_flavour set.

  • The names of the ELEMENT in a row are the column names.

  • The names of the containing CLUSTER of each row is the stringified number of the row in the overall table.

ITEM_TREE

Data of an ITEM_TREE instance are simply replicated as is to produce the correct ISO 13606 hierarchical form.

Class Descriptions

ITEM_STRUCTURE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

ITEM_STRUCTURE (abstract)

Description

Abstract parent class of all spatial data types.

Inherit

DATA_STRUCTURE

ITEM_STRUCTURE (abstract)

Abstract parent class of all spatial data types.

Inherits: Any, PATHABLE, LOCATABLE, DATA_STRUCTURE

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.

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.

DATA_STRUCTURE.as_hierarchy (): ITEM [1..1]

Hierarchical equivalent of the physical representation of each subtype, compatible with CEN EN 13606 structures.

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

{
    "name": "ITEM_STRUCTURE",
    "documentation": "Abstract parent class of all spatial data types. ",
    "is_abstract": true,
    "ancestors": [
        "DATA_STRUCTURE"
    ]
}
ITEM_STRUCTURE

ITEM_SINGLE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

ITEM_SINGLE

Description

Logical single value data structure. Used to represent any data which is logically a single value, such as a person’s height or weight.

Inherit

ITEM_STRUCTURE

Attributes

Signature

Meaning

1..1

item: ELEMENT

Functions

Signature

Meaning

1..1
(redefined)

as_hierarchy (): ELEMENT

Generate a CEN EN13606-compatible hierarchy consisting of a single ELEMENT.

ITEM_SINGLE

Logical single value data structure. Used to represent any data which is logically a single value, such as a person’s height or weight.

Inherits: Any, PATHABLE, LOCATABLE, DATA_STRUCTURE, ITEM_STRUCTURE

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.

item: ELEMENT [1..1]

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.

as_hierarchy (): ELEMENT [1..1]

Generate a CEN EN13606-compatible hierarchy consisting of a single ELEMENT.

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

{
    "name": "ITEM_SINGLE",
    "documentation": "Logical single value data structure. Used to represent any data which is logically a single value, such as a person's height or weight.",
    "ancestors": [
        "ITEM_STRUCTURE"
    ],
    "properties": {
        "item": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "item",
            "is_mandatory": true,
            "type": "ELEMENT"
        }
    },
    "functions": {
        "as_hierarchy": {
            "name": "as_hierarchy",
            "documentation": "Generate a CEN EN13606-compatible hierarchy consisting of a single `ELEMENT`.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "ELEMENT"
            }
        }
    }
}
ITEM_SINGLE

ITEM_LIST Class

  • Definition

  • Effective

  • BMM

  • UML

Class

ITEM_LIST

Description

Logical list data structure, where each item has a value and can be referred to by a name and a positional index in the list. The list may be empty.

ITEM_LIST is used to represent any data which is logically a list of values, such as blood pressure, most protocols, many blood tests etc.

Not to be used for time-based lists, which should be represented with the proper temporal class, i.e. HISTORY.

Inherit

ITEM_STRUCTURE

Attributes

Signature

Meaning

0..1

items: List<ELEMENT>

Physical representation of the list.

Functions

Signature

Meaning

1..1

item_count (): Integer

Count of all items.

0..1

names (): List<DV_TEXT>

Retrieve the names of all items.

1..1

named_item (
a_name: String[1]
): ELEMENT

Retrieve the item with name ‘a_name’.

1..1

ith_item (
i: Integer[1]
): ELEMENT

Retrieve the i-th item with name.

1..1
(redefined)

as_hierarchy (): CLUSTER

Generate a CEN EN13606-compatible hierarchy consisting of a single CLUSTER containing the ELEMENTs of this list.

Invariants

Valid_structure: items.forall (i:ITEM | i.type = "ELEMENT")

ITEM_LIST

Logical list data structure, where each item has a value and can be referred to by a name and a positional index in the list. The list may be empty.

ITEM_LIST is used to represent any data which is logically a list of values, such as blood pressure, most protocols, many blood tests etc.

Not to be used for time-based lists, which should be represented with the proper temporal class, i.e. HISTORY.

Inherits: Any, PATHABLE, LOCATABLE, DATA_STRUCTURE, ITEM_STRUCTURE

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.

items: List<ELEMENT> [0..1]

Physical representation of the list.

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.

as_hierarchy (): CLUSTER [1..1]

Generate a CEN EN13606-compatible hierarchy consisting of a single CLUSTER containing the ELEMENTs of this list.

item_count (): Integer [1..1]

Count of all items.

names (): List<DV_TEXT> [0..1]

Retrieve the names of all items.

named_item (
a_name: String[1]
): ELEMENT [1..1]

Retrieve the item with name ‘a_name’.

ith_item (
i: Integer[1]
): ELEMENT [1..1]

Retrieve the i-th item with name.

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

Valid_structure: items.forall (i:ITEM | i.type = "ELEMENT")

{
    "name": "ITEM_LIST",
    "documentation": "Logical list data structure, where each item has a value and can be referred to by a name and a positional index in the list. The list may be empty. \n\n`ITEM_LIST` is used to represent any data which is logically a list of values, such as blood pressure, most protocols, many blood tests etc. \n\nNot to be used for time-based lists, which should be represented with the proper temporal class, i.e. `HISTORY`.",
    "ancestors": [
        "ITEM_STRUCTURE"
    ],
    "properties": {
        "items": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "items",
            "documentation": "Physical representation of the list. ",
            "type_def": {
                "container_type": "List",
                "type": "ELEMENT"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        }
    },
    "functions": {
        "item_count": {
            "name": "item_count",
            "documentation": "Count of all items.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Integer"
            }
        },
        "names": {
            "name": "names",
            "documentation": "Retrieve the names of all items.",
            "result": {
                "_type": "P_BMM_CONTAINER_TYPE",
                "container_type": "List",
                "type": "DV_TEXT"
            },
            "is_nullable": true
        },
        "named_item": {
            "name": "named_item",
            "documentation": "Retrieve the item with name ‘a_name’.",
            "parameters": {
                "a_name": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_name",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "ELEMENT"
            }
        },
        "ith_item": {
            "name": "ith_item",
            "documentation": "Retrieve the i-th item with name.",
            "parameters": {
                "i": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "i",
                    "type": "Integer"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "ELEMENT"
            }
        },
        "as_hierarchy": {
            "name": "as_hierarchy",
            "documentation": "Generate a CEN EN13606-compatible hierarchy consisting of a single `CLUSTER` containing the `ELEMENTs` of this list.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "CLUSTER"
            }
        }
    },
    "invariants": {
        "Valid_structure": " items.forall (i:ITEM | i.type = \"ELEMENT\")"
    }
}
ITEM_LIST

ITEM_TABLE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

ITEM_TABLE

Description

Logical relational database style table data structure, in which columns are named and ordered with respect to each other. Implemented using Cluster-per-row encoding. Each row Cluster must have an identical number of Elements, each of which in turn must have identical names and value types in the corresponding positions in each row.

Some columns may be designated key' columns, containing key data for each row, in the manner of relational tables. This allows row-naming, where each row represents a body site, a blood antigen etc. All values in a column have the same data type.

Used for representing any data which is logically a table of values, such as blood pressure, most protocols, many blood tests etc.

Misuse: Not to be used for time-based data, which should be represented with the temporal class HISTORY. The table may be empty.

Inherit

ITEM_STRUCTURE

Attributes

Signature

Meaning

0..1

rows: List<CLUSTER>

Physical representation of the table as a list of CLUSTERs, each containing the data of one row of the table.

Functions

Signature

Meaning

1..1

row_count (): Integer

Number of rows in the table.

1..1

column_count (): Integer

Return number of columns in the table.

0..1

row_names (): List<DV_TEXT>

Return set of row names.

0..1

column_names (): List<DV_TEXT>

Return set of column names.

1..1

ith_row (
i: Integer[1]
): CLUSTER

Return i-th row.

1..1

has_row_with_name (
a_key: String[1]
): Boolean

Return True if there is a column with name = a_key.

1..1

has_column_with_name (
a_key: String[1]
): Boolean

Return True if there is a column with name = a_key.

1..1

named_row (
a_key: String[1]
): CLUSTER

Return row with name = a_key.

1..1

has_row_with_key (
keys: List<String>
): Boolean

Return True if there is a row with key keys.

1..1

row_with_key (
keys: List<String>
): CLUSTER

Return rows with particular keys.

1..1

element_at_cell_ij (
i: Integer[1],
j: Integer[1]
): ELEMENT

Return cell at a particular location.

1..1
(redefined)

as_hierarchy (): CLUSTER

Generate a CEN EN13606-compatible hierarchy consisting of a single CLUSTER containing the CLUSTERs representing the columns of this table.

Invariants

Valid_structure: rows.for_all (items.for_all (instance_of ("ELEMENT")))

ITEM_TABLE

Logical relational database style table data structure, in which columns are named and ordered with respect to each other. Implemented using Cluster-per-row encoding. Each row Cluster must have an identical number of Elements, each of which in turn must have identical names and value types in the corresponding positions in each row.

Some columns may be designated key' columns, containing key data for each row, in the manner of relational tables. This allows row-naming, where each row represents a body site, a blood antigen etc. All values in a column have the same data type.

Used for representing any data which is logically a table of values, such as blood pressure, most protocols, many blood tests etc.

Misuse: Not to be used for time-based data, which should be represented with the temporal class HISTORY. The table may be empty.

Inherits: Any, PATHABLE, LOCATABLE, DATA_STRUCTURE, ITEM_STRUCTURE

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.

rows: List<CLUSTER> [0..1]

Physical representation of the table as a list of CLUSTERs, each containing the data of one row of the table.

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.

as_hierarchy (): CLUSTER [1..1]

Generate a CEN EN13606-compatible hierarchy consisting of a single CLUSTER containing the CLUSTERs representing the columns of this table.

row_count (): Integer [1..1]

Number of rows in the table.

column_count (): Integer [1..1]

Return number of columns in the table.

row_names (): List<DV_TEXT> [0..1]

Return set of row names.

column_names (): List<DV_TEXT> [0..1]

Return set of column names.

ith_row (
i: Integer[1]
): CLUSTER [1..1]

Return i-th row.

has_row_with_name (
a_key: String[1]
): Boolean [1..1]

Return True if there is a column with name = a_key.

has_column_with_name (
a_key: String[1]
): Boolean [1..1]

Return True if there is a column with name = a_key.

named_row (
a_key: String[1]
): CLUSTER [1..1]

Return row with name = a_key.

has_row_with_key (
keys: List<String>
): Boolean [1..1]

Return True if there is a row with key keys.

row_with_key (
keys: List<String>
): CLUSTER [1..1]

Return rows with particular keys.

element_at_cell_ij (
i: Integer[1],
j: Integer[1]
): ELEMENT [1..1]

Return cell at a particular location.

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

Valid_structure: rows.for_all (items.for_all (instance_of ("ELEMENT")))

{
    "name": "ITEM_TABLE",
    "documentation": "Logical relational database style table data structure, in which columns are named and ordered with respect to each other. Implemented using Cluster-per-row encoding. Each row Cluster must have an identical number of Elements, each of which in turn must have identical names and value types in the corresponding positions in each row. \n\nSome columns may be designated  key' columns, containing key data for each row, in the manner of relational tables. This allows row-naming, where each row represents a body site, a blood antigen etc. All values in a column have the same data type. \n\nUsed for representing any data which is logically a table of values, such as blood pressure, most protocols, many blood tests etc. \n\nMisuse: Not to be used for time-based data, which should be represented with the temporal class `HISTORY`. The table may be empty. ",
    "ancestors": [
        "ITEM_STRUCTURE"
    ],
    "properties": {
        "rows": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "rows",
            "documentation": "Physical representation of the table as a list of `CLUSTERs`, each containing the data of one row of the table. ",
            "type_def": {
                "container_type": "List",
                "type": "CLUSTER"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        }
    },
    "functions": {
        "row_count": {
            "name": "row_count",
            "documentation": "Number of rows in the table.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Integer"
            }
        },
        "column_count": {
            "name": "column_count",
            "documentation": "Return number of columns in the table.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Integer"
            }
        },
        "row_names": {
            "name": "row_names",
            "documentation": "Return set of row names.",
            "result": {
                "_type": "P_BMM_CONTAINER_TYPE",
                "container_type": "List",
                "type": "DV_TEXT"
            },
            "is_nullable": true
        },
        "column_names": {
            "name": "column_names",
            "documentation": "Return set of column names.",
            "result": {
                "_type": "P_BMM_CONTAINER_TYPE",
                "container_type": "List",
                "type": "DV_TEXT"
            },
            "is_nullable": true
        },
        "ith_row": {
            "name": "ith_row",
            "documentation": "Return i-th row.",
            "parameters": {
                "i": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "i",
                    "type": "Integer"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "CLUSTER"
            }
        },
        "has_row_with_name": {
            "name": "has_row_with_name",
            "documentation": "Return `True` if there is a column with name = `_a_key_`.",
            "parameters": {
                "a_key": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_key",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "has_column_with_name": {
            "name": "has_column_with_name",
            "documentation": "Return `True` if there is a column with name = `_a_key_`.",
            "parameters": {
                "a_key": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_key",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "named_row": {
            "name": "named_row",
            "documentation": "Return row with name = `_a_key_`.",
            "parameters": {
                "a_key": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_key",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "CLUSTER"
            }
        },
        "has_row_with_key": {
            "name": "has_row_with_key",
            "documentation": "Return `True` if there is a row with key `_keys_`.",
            "parameters": {
                "keys": {
                    "_type": "P_BMM_CONTAINER_FUNCTION_PARAMETER",
                    "name": "keys",
                    "is_nullable": true,
                    "type_def": {
                        "container_type": "List",
                        "type": "String"
                    },
                    "cardinality": {
                        "lower": 0,
                        "upper_unbounded": true
                    }
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "row_with_key": {
            "name": "row_with_key",
            "documentation": "Return rows with particular keys.",
            "parameters": {
                "keys": {
                    "_type": "P_BMM_CONTAINER_FUNCTION_PARAMETER",
                    "name": "keys",
                    "is_nullable": true,
                    "type_def": {
                        "container_type": "List",
                        "type": "String"
                    },
                    "cardinality": {
                        "lower": 0,
                        "upper_unbounded": true
                    }
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "CLUSTER"
            }
        },
        "element_at_cell_ij": {
            "name": "element_at_cell_ij",
            "documentation": "Return cell at a particular location.",
            "parameters": {
                "i": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "i",
                    "type": "Integer"
                },
                "j": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "j",
                    "type": "Integer"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "ELEMENT"
            }
        },
        "as_hierarchy": {
            "name": "as_hierarchy",
            "documentation": "Generate a CEN EN13606-compatible hierarchy consisting of a single `CLUSTER` containing the `CLUSTERs` representing the columns of this table. ",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "CLUSTER"
            }
        }
    },
    "invariants": {
        "Valid_structure": "rows.for_all (items.for_all (instance_of (\"ELEMENT\")))"
    }
}
ITEM_TABLE

ITEM_TREE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

ITEM_TREE

Description

Logical tree data structure. The tree may be empty. Used for representing data which are logically a tree such as audiology results, microbiology results, biochemistry results.

Inherit

ITEM_STRUCTURE

Attributes

Signature

Meaning

0..1

items: List<ITEM>

The items comprising the ITEM_TREE. Can include 0 or more CLUSTERs and/or 0 or more individual ELEMENTs.

Functions

Signature

Meaning

1..1

has_element_path (
a_path: String[1]
): Boolean

True if path a_path' is a valid leaf path.

1..1

element_at_path (
a_path: String[1]
): ELEMENT

Return the leaf element at the path a_path'.

1..1
(redefined)

as_hierarchy (): CLUSTER

Generate a CEN EN13606-compatible hierarchy, which is the same as the tree’s physical representation.

ITEM_TREE

Logical tree data structure. The tree may be empty. Used for representing data which are logically a tree such as audiology results, microbiology results, biochemistry results.

Inherits: Any, PATHABLE, LOCATABLE, DATA_STRUCTURE, ITEM_STRUCTURE

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.

items: List<ITEM> [0..1]

The items comprising the ITEM_TREE. Can include 0 or more CLUSTERs and/or 0 or more individual ELEMENTs.

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.

as_hierarchy (): CLUSTER [1..1]

Generate a CEN EN13606-compatible hierarchy, which is the same as the tree’s physical representation.

has_element_path (
a_path: String[1]
): Boolean [1..1]

True if path a_path' is a valid leaf path.

element_at_path (
a_path: String[1]
): ELEMENT [1..1]

Return the leaf element at the path a_path'.

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

{
    "name": "ITEM_TREE",
    "documentation": "Logical tree data structure. The tree may be empty. Used for representing data which are logically a tree such as audiology results, microbiology results, biochemistry results.",
    "ancestors": [
        "ITEM_STRUCTURE"
    ],
    "properties": {
        "items": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "items",
            "documentation": "The items comprising the `ITEM_TREE`. Can include 0 or more `CLUSTERs` and/or 0 or more individual `ELEMENTs`.",
            "type_def": {
                "container_type": "List",
                "type": "ITEM"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        }
    },
    "functions": {
        "has_element_path": {
            "name": "has_element_path",
            "documentation": "True if path  a_path' is a valid leaf path.\n",
            "parameters": {
                "a_path": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_path",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "element_at_path": {
            "name": "element_at_path",
            "documentation": "Return the leaf element at the path  a_path'.",
            "parameters": {
                "a_path": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_path",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "ELEMENT"
            }
        },
        "as_hierarchy": {
            "name": "as_hierarchy",
            "documentation": "Generate a CEN EN13606-compatible hierarchy, which is the same as the tree's physical representation.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "CLUSTER"
            }
        }
    }
}
ITEM_TREE

Instance Structures

ITEM_SINGLE Instance Structure

The figure below illustrates a ITEM_SINGLE instance, in both physical and logical forms.

instance item single
Figure 1. Instance Structure of ITEM_SINGLE

ITEM_LIST Instance Structure

The following figure illustrates a typical ITEM_LIST structure, in this case for a BP protocol.

instance item list
Figure 2. Instance Structure of ITEM_LIST

ITEM_TABLE Instance Structure

The next figure illustrates a table of visual acuity test results.

instance item table
Figure 3. Instance Structure of ITEM_TABLE

ITEM_TREE Instance Structure

The following figure illustrates the logical and concrete forms of an example ITEM_TREE instance, representing a biochemistry result.

instance item tree
Figure 4. Instance Structure of ITEM_TREE