Tags Package

Overview

The common.tags package defines the structure and semantics of a tag construct that may be used within openEHR, in a similar way to 'tagging' facilities commonly available in web-based email, forum platforms, and other content management systems. The following UML diagram shows the formal model.

RM common.tags
Figure 1. common.tags Package

Semantics

A tag in openEHR is a lightweight annotation that may be associated with any information item, such that searching or querying for a tag will result in retrieval of the items marked with that tag. A tag consists of a key and optional value. Here, 'searching' is understood as a function available on a service interface for the tagged content (e.g. EHR service API), while 'querying' is the use of tags in queries expressed in an openEHR query language such as AQL.

Tags are normally associated with an 'owner' object, identified by owner_id, such that deletion or move of the owner results in deletion or move of the associated tags.

Class Descriptions

ITEM_TAG Class

  • Definition

  • Effective

  • BMM

  • UML

Class

ITEM_TAG

Description

A tag with optional value that is associated with a target information entity identified by a UID.

Attributes

Signature

Meaning

1..1

target: UID_BASED_ID

Identifier of target, which may be a VERSIONED_OBJECT<T> or a VERSION<T>.

0..1

target_path: String

Optional archetype (i.e. AQL) or RM path within target, in order to tag a fine-grained element.

1..1

key: String

The tag key. May not be empty or contain leading or trailing whitespace.

0..1

value: String

The value. If set, may not be empty.

1..1

owner_id: OBJECT_REF

Identifier of owner object, such as EHR.

Invariants

Inv_key_valid: not key.is_empty and key.is_justified

Inv_value_valid: value /= Void implies not value.is_empty

ITEM_TAG

A tag with optional value that is associated with a target information entity identified by a UID.

Attributes

target: UID_BASED_ID [1..1]

Identifier of target, which may be a VERSIONED_OBJECT<T> or a VERSION<T>.

target_path: String [0..1]

Optional archetype (i.e. AQL) or RM path within target, in order to tag a fine-grained element.

key: String [1..1]

The tag key. May not be empty or contain leading or trailing whitespace.

value: String [0..1]

The value. If set, may not be empty.

owner_id: OBJECT_REF [1..1]

Identifier of owner object, such as EHR.

Invariants

Inv_key_valid: not key.is_empty and key.is_justified

Inv_value_valid: value /= Void implies not value.is_empty

{
    "name": "ITEM_TAG",
    "documentation": "A tag with optional value that is associated with a target information entity identified by a UID.",
    "properties": {
        "target": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "target",
            "documentation": "Identifier of target, which may be a `VERSIONED_OBJECT<T>` or a `VERSION<T>`.",
            "is_mandatory": true,
            "type": "UID_BASED_ID"
        },
        "target_path": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "target_path",
            "documentation": "Optional archetype (i.e. AQL) or RM path within `_target_`, in order to tag a fine-grained element.",
            "type": "String"
        },
        "key": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "key",
            "documentation": "The tag key. May not be empty or contain leading or trailing whitespace.",
            "is_mandatory": true,
            "type": "String"
        },
        "value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "value",
            "documentation": "The value. If set, may not be empty.",
            "type": "String"
        },
        "owner_id": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "owner_id",
            "documentation": "Identifier of owner object, such as EHR.",
            "is_mandatory": true,
            "type": "OBJECT_REF"
        }
    },
    "invariants": {
        "Inv_key_valid": "not key.is_empty and key.is_justified",
        "Inv_value_valid": "value /= Void implies not value.is_empty"
    }
}
item tag