Directory Package

Overview

The directory package is illustrated below. It provides a simple abstraction of a versioned folder structure. The VERSIONED_FOLDER class is the binding of VERSIONED_OBJECT<T> to the class FOLDER, i.e. it is a VERSIONED_OBJECT<FOLDER>. This means that each of its versions is a Folder structure rather than a single Folder. It provides a means of versioning FOLDER structures over time, which is useful in the EHR, Demographics service or anywhere else where Folders are used to group things. A FOLDER instance contains more FOLDERs and/or items, which are references to other (usually versioned) objects. A FOLDER structure is therefore like a directory containing references to objects. Since they are references, multiple references to the same object are possible, allowing the structure to be used to mutiply classify other objects. If it is used with VERSIONED_COMPOSITIONs for example, the folders might be used to represent episodes and at the same time problem groups.

RM common.directory
Figure 1. common.directory Package

FOLDER structures inside the VERSIONED_FOLDER are archetypable structures, and FOLDER archetypes can be created in the same fashion as say SECTION archetypes for the EHR.

Paths

Directory paths are built using the name attribute values inherited from LOCATABLE into each FOLDER object. In real data, these will usually be derived from the value of the archetype_node_id attribute, plus a uniqueness modifier if required. Example paths (e.g. within the EHR):

    /folders[hospital episodes]/items[1]
    /folders[patient entered data]/folders[diabetes monitoring]
    /folders[homeopathy contacts]

Uniqueness modifiers are appended in brackets, and are only needed to differentiate folders at the same node that would otherwise have the same names, e.g.

    [hospital episodes]
    [hospital episodes(car accident Aug 1998)]

Class Descriptions

VERSIONED_FOLDER Class

  • Definition

  • Effective

  • BMM

  • UML

Class

VERSIONED_FOLDER

Description

A version-controlled hierarchy of FOLDERs giving the effect of a directory.

Inherit

VERSIONED_OBJECT

VERSIONED_FOLDER

A version-controlled hierarchy of FOLDERs giving the effect of a directory.

Inherits: VERSIONED_OBJECT

Attributes

uid: HIER_OBJECT_ID [1..1]

Unique identifier of this version container in the form of a UID with no extension. This id will be the same in all instances of the same container in a distributed environment, meaning that it can be understood as the uid of the virtual version tree.
Inherited from VERSIONED_OBJECT

owner_id: OBJECT_REF [1..1]

Reference to object to which this version container belongs, e.g. the id of the containing EHR or other relevant owning entity.
Inherited from VERSIONED_OBJECT

time_created: DV_DATE_TIME [1..1]

Time of initial creation of this versioned object.
Inherited from VERSIONED_OBJECT

Functions

version_count (): Integer [1..1]

Return the total number of versions in this object.
Inherited from VERSIONED_OBJECT

all_version_ids (): List<OBJECT_VERSION_ID> [1..1]

Return a list of ids of all versions in this object.
Inherited from VERSIONED_OBJECT

all_versions (): List<VERSION<T>> [1..1]

Return a list of all versions in this object.
Inherited from VERSIONED_OBJECT

has_version_at_time (
a_ver_id: OBJECT_VERSION_ID[1]
): Boolean [1..1]

True if a version for time a_time exists.
Inherited from VERSIONED_OBJECT

has_version_id (
a_ver_id: OBJECT_VERSION_ID[1]
): Boolean [1..1]

True if a version with an_id exists.
Inherited from VERSIONED_OBJECT

version_with_id (
a_ver_id: OBJECT_VERSION_ID[1]
): VERSION

Pre: has_version_id (a_ver_id) [1..1]

Return the version with uid = a_ver_id.
Inherited from VERSIONED_OBJECT

is_original_version (
a_ver_id: OBJECT_VERSION_ID[1]
): Boolean

Pre: has_version_id(a_ver_id) [1..1]

True if version with an_id is an ORIGINAL_VERSION.
Inherited from VERSIONED_OBJECT

version_at_time (
a_time: DV_DATE_TIME[1]
): VERSION

Pre: has_version_at_time (a_time) [1..1]

Return the version for time a_time.
Inherited from VERSIONED_OBJECT

revision_history (): REVISION_HISTORY [1..1]

History of all audits and attestations in this versioned repository.
Inherited from VERSIONED_OBJECT

latest_version (): VERSION [1..1]

Return the most recently added version (i.e. on trunk or any branch).
Inherited from VERSIONED_OBJECT

latest_trunk_version (): VERSION [1..1]

Return the most recently added trunk version.
Inherited from VERSIONED_OBJECT

trunk_lifecycle_state (): DV_CODED_TEXT

Post: Result = latest_trunk_version.lifecycle_state [1..1]

Return the lifecycle state from the latest trunk version. Useful for determining if the version container is logically deleted.
Inherited from VERSIONED_OBJECT

commit_original_version (
a_contribution: OBJECT_REF[1],
a_new_version_uid: OBJECT_VERSION_ID[1],
a_preceding_version_id: OBJECT_VERSION_ID[1],
an_audit: AUDIT_DETAILS[1],
a_lifecycle_state: DV_CODED_TEXT[1],
a_data: T[1],
signing_key: String[1]
): void

Pre: all_version_ids.has (a_preceding_version_uid) or else version_count = 0 [1..1]

Add a new original version.
Inherited from VERSIONED_OBJECT

commit_original_merged_version (
a_contribution: OBJECT_REF[1],
a_new_version_uid: OBJECT_VERSION_ID[1],
a_preceding_version_id: OBJECT_VERSION_ID[1],
an_audit: AUDIT_DETAILS[1],
a_lifecycle_state: DV_CODED_TEXT[1],
a_data: T[1],
an_other_input_uids: List<OBJECT_VERSION_ID>[1],
signing_key: String[1]
): void

Pre: all_version_ids.has (a_preceding_version_uid) or else version_count = 0 [1..1]

Add a new original merged version. This commit function adds a parameter containing the ids of other versions merged into the current one.
Inherited from VERSIONED_OBJECT

commit_imported_version (
a_contribution: OBJECT_REF[1],
an_audit: AUDIT_DETAILS[1],
a_version: ORIGINAL_VERSION[1]
): void [1..1]

Add a new imported version. Details of version id etc come from the ORIGINAL_VERSION being committed.
Inherited from VERSIONED_OBJECT

commit_attestation (
an_attestation: ATTESTATION[1],
a_ver_id: OBJECT_VERSION_ID[1],
signing_key: String[1]
): void

Pre: has_version_id(a_ver_id) and is_original_version(a_ver_id) [1..1]

Add a new attestation to a specified original version. Attestations can only be added to Original versions.
Inherited from VERSIONED_OBJECT

Invariants

Version_count_valid: version_count >= 0
Inherited from VERSIONED_OBJECT

All_version_ids_valid: all_version_ids.count = version_count
Inherited from VERSIONED_OBJECT

All_versions_valid: all_versions.count = version_count
Inherited from VERSIONED_OBJECT

Latest_version_valid: version_count > 0 implies latest_version /= Void
Inherited from VERSIONED_OBJECT

Uid_validity: extension.is_empty
Inherited from VERSIONED_OBJECT

{
    "name": "VERSIONED_FOLDER",
    "documentation": "A version-controlled hierarchy of `FOLDERs` giving the effect of a directory. ",
    "ancestors": [
        "VERSIONED_OBJECT"
    ]
}
versioned folder

FOLDER Class

  • Definition

  • Effective

  • BMM

  • UML

Class

FOLDER

Description

The concept of a named folder.

Inherit

LOCATABLE

Attributes

Signature

Meaning

0..1

items: List<OBJECT_REF>

The list of references to other (usually) versioned objects logically in this folder.

0..1

folders: List<FOLDER>

Sub-folders of this FOLDER.

0..1

details: ITEM_STRUCTURE

Archetypable extra meta-data for FOLDER.

FOLDER

The concept of a named folder.

Inherits: Any, PATHABLE, LOCATABLE

Attributes

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.
Inherited from LOCATABLE

archetype_node_id: String [1..1]

Design-time archetype id 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 ontology.

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.
Inherited from LOCATABLE

uid: UID_BASED_ID [0..1]

Optional globally unique object identifier for root points of archetyped structures.
Inherited from 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.
Inherited from LOCATABLE

archetype_details: ARCHETYPED [0..1]

Details of archetyping used on this node.
Inherited from 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.
Inherited from LOCATABLE

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

The list of references to other (usually) versioned objects logically in this folder.

folders: List<FOLDER> [0..1]

Sub-folders of this FOLDER.

details: ITEM_STRUCTURE [0..1]

Archetypable extra meta-data for FOLDER.

Functions

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

Value equality.
Inherited from Any

infix = (
other: Any[1]
): Boolean [1..1]

Reference equality.
Inherited from Any

Parameters
other

Reference equality.

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

Create new instance of a type.
Inherited from 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>".
Inherited from Any

parent (): PATHABLE [1..1]

Parent of this node in a compositional hierarchy.
Inherited from 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.
Inherited from PATHABLE

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

List of items corresponding to a non-unique path.
Inherited from 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.
Inherited from 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.
Inherited from PATHABLE

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

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

concept (): DV_TEXT [1..1]

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

is_archetype_root (): Boolean [1..1]

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

Invariants

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

Archetyped_valid: is_archetype_root xor archetype_details = Void
Inherited from LOCATABLE

Archetype_node_id_valid: not archetype_node_id.is_empty
Inherited from LOCATABLE

{
    "name": "FOLDER",
    "documentation": "The concept of a named folder.",
    "ancestors": [
        "LOCATABLE"
    ],
    "properties": {
        "items": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "items",
            "documentation": "The list of references to other (usually) versioned objects logically in this folder. ",
            "type_def": {
                "container_type": "List",
                "type": "OBJECT_REF"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "folders": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "folders",
            "documentation": "Sub-folders of this FOLDER. ",
            "type_def": {
                "container_type": "List",
                "type": "FOLDER"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "details": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "details",
            "documentation": "Archetypable extra meta-data for `FOLDER`.",
            "type": "ITEM_STRUCTURE"
        }
    }
}
folder