Resource Package

the version of the Resource package described below is used only in ADL 1.4 archetypes, i.e. via the AOM 1.4 archetype model. A newer version of this package is defined in the openEHR Resource Specfication in the BASE component, and is used in ADL 2 archetypes (via the AOM 2 archetype model) and in the Task Planning specification. The newer specification is almost completely backwards compatible, enabling for example easy upgrading of ADL1.4 archetype meta-data to the ADL2 form. It also specifies more comprehensive meta-data as well as annotations. The new specification should be used for all relevant needs in the future, with the older form here retained only while needed by AOM 1.4 based archetypes and tools.

Overview

The common.resource package defines the structure and semantics of the general notion of an online resource which has been created by a human author, and consequently for which natural language is a factor. The package is illustrated below.

RM common.resource
Figure 1. common.resource Package

Natural Languages and Translation

Authored resources contain natural language elements, and are therefore created in some original language, recorded in the orginal_language attribute of the AUTHORED_RESOURCE class. Information about translations is included in the translations attribute, which allows for one or more sets of translation details to be recorded. A resource is translated by doing the following:

  • translating every language-dependent element to the new language;

  • adding a new TRANSLATION_DETAILS instance to translations, containing details about the translator, organisation, quality assurance and so on.

  • any further translations to language-specific elements in a instances of descendent type of AUTHORED_RESOURCE.

The languages_available function provides a complete list of languages in the resource.

Meta-data

What is normally considered the 'meta-data' of a resource, i.e. its author, date of creation, purpose, and other descriptive items, is described by the RESOURCE_DESCRIPTION and RESOURCE_DESCRIPTION_ITEM classes. The parts of this that are in natural language, and therefore may require translated versions, are represented in instances of the RESOURCE_DESCRIPTION_ITEM class. Thus, if a RESOURCE_DESCRIPTION has more than one RESOURCE_DESCRIPTION_ITEM, each of these should carry exactly the same information in a different natural language.

The AUTHORED_RESOURCE.description attribute is optional, allowing for resources with no meta-data at all, e.g. resources in a partial state of construction. The translations attribute may still be required, since there may be other parts of the resource object (specified by a class into which AUTHORED_RESOURCE is inherited) that are language-dependent.

Revision History

When the resource is considered to be in a state where changes to it should be controlled, the is_controlled attribute is set to True, and all subsequent changes should have an audit trail recorded. Usually controlled resources would be managed in a versioned repository (e.g. implemented by CVS, Subversion or similar systems), and audit information will be stored somewhere in the repository (e.g. in version control files). The revision_history attribute defined in the AUTHROED_RESOURCE class is intended to act as a documentary copy of the revision history as known inside the repository, for the benefit of users of the resource. Given that resources in different places may well be managed in different kinds of repositories, having a copy of the revision history in a standardised form within the resource enables it to be used interoperably by authoring and other tools.

Every change to a resource committed to the relevant repository causes a new addition to the revision_history.

Class Descriptions

AUTHORED_RESOURCE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

AUTHORED_RESOURCE (abstract)

Description

Abstract idea of an online resource created by a human author.

Attributes

Signature

Meaning

1..1

original_language: CODE_PHRASE

Language in which this resource was initially authored. Although there is no language primacy of resources overall, the language of original authoring is required to ensure natural language translations can preserve quality. Language is relevant in both the description and ontology sections.

0..1

is_controlled: Boolean

True if this resource is under any kind of change control (even file copying), in which case revision history is created.

0..1

translations: Hash<String,TRANSLATION_DETAILS>

List of details for each natural-language translation made of this resource, keyed by language. For each translation listed here, there must be corresponding sections in all language-dependent parts of the resource. The original_language does not appear in this list.

0..1

description: RESOURCE_DESCRIPTION

Description and lifecycle information of the resource.

0..1

revision_history: REVISION_HISTORY

The revision history of the resource. Only required if is_controlled = True (avoids large revision histories for informal or private editing situations).

Functions

Signature

Meaning

1..1

current_revision (): String

Post: Result = revision_history.most_recent_version

Most recent revision in revision_history if is_controlled else (uncontrolled) .

1..1

languages_available (): List<String>

Total list of languages available in this resource, derived from original_language and translations.

Invariants

Original_language_valid: code_set (Code_set_id_languages).has_code (original_language.as_string)

Languages_available_valid: languages_available.has (original_language)

Revision_history_valid: is_controlled xor revision_history = Void

Current_revision_valid: (current_revision /= Void and not is_controlled) implies current_revision.is_equal (“(uncontrolled)”)

Translations_valid: translations /= Void implies (not translations.is_empty and not translations.has (orginal_language.code_string))

Description_valid: translations /= Void implies (description.details.for_all (d | translations.has_key (d.language.code_string)))

AUTHORED_RESOURCE (abstract)

Abstract idea of an online resource created by a human author.

Attributes

original_language: CODE_PHRASE [1..1]

Language in which this resource was initially authored. Although there is no language primacy of resources overall, the language of original authoring is required to ensure natural language translations can preserve quality. Language is relevant in both the description and ontology sections.

is_controlled: Boolean [0..1]

True if this resource is under any kind of change control (even file copying), in which case revision history is created.

translations: Hash<String,TRANSLATION_DETAILS> [0..1]

List of details for each natural-language translation made of this resource, keyed by language. For each translation listed here, there must be corresponding sections in all language-dependent parts of the resource. The original_language does not appear in this list.

description: RESOURCE_DESCRIPTION [0..1]

Description and lifecycle information of the resource.

revision_history: REVISION_HISTORY [0..1]

The revision history of the resource. Only required if is_controlled = True (avoids large revision histories for informal or private editing situations).

Functions

current_revision (): String

Post: Result = revision_history.most_recent_version [1..1]

Most recent revision in revision_history if is_controlled else (uncontrolled) .

languages_available (): List<String> [1..1]

Total list of languages available in this resource, derived from original_language and translations.

Invariants

Original_language_valid: code_set (Code_set_id_languages).has_code (original_language.as_string)

Languages_available_valid: languages_available.has (original_language)

Revision_history_valid: is_controlled xor revision_history = Void

Current_revision_valid: (current_revision /= Void and not is_controlled) implies current_revision.is_equal (“(uncontrolled)”)

Translations_valid: translations /= Void implies (not translations.is_empty and not translations.has (orginal_language.code_string))

Description_valid: translations /= Void implies (description.details.for_all (d | translations.has_key (d.language.code_string)))

{
    "name": "AUTHORED_RESOURCE",
    "documentation": "Abstract idea of an online resource created by a human author. \n",
    "is_abstract": true,
    "properties": {
        "original_language": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "original_language",
            "documentation": "Language in which this resource was initially authored. Although there is no language primacy of resources overall, the language of original authoring is required to ensure natural language translations can preserve quality. Language is relevant in both the description and ontology sections. ",
            "is_mandatory": true,
            "type": "CODE_PHRASE"
        },
        "is_controlled": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "is_controlled",
            "documentation": "True if this resource is under any kind of change control (even file copying), in which case revision history is created. ",
            "type": "Boolean"
        },
        "translations": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "translations",
            "documentation": "List of details for each natural-language translation made of this resource, keyed by language. For each translation listed here, there must be corresponding sections in all language-dependent parts of the resource. The `_original_language_` does not appear in this list.",
            "type_def": {
                "root_type": "Hash",
                "generic_parameters": [
                    "String",
                    "TRANSLATION_DETAILS"
                ]
            }
        },
        "description": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "description",
            "documentation": "Description and lifecycle information of the resource.",
            "type": "RESOURCE_DESCRIPTION"
        },
        "revision_history": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "revision_history",
            "documentation": "The revision history of the resource. Only required if `_is_controlled_ = True` (avoids large revision histories for informal or private editing situations). ",
            "type": "REVISION_HISTORY"
        }
    },
    "functions": {
        "current_revision": {
            "name": "current_revision",
            "documentation": "Most recent revision in `_revision_history_` if `_is_controlled_` else  (uncontrolled) . ",
            "post_conditions": {
                "Post": "Result = revision_history.most_recent_version"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "String"
            }
        },
        "languages_available": {
            "name": "languages_available",
            "documentation": "Total list of languages available in this resource, derived from `_original_language_` and `_translations_`.\n",
            "result": {
                "_type": "P_BMM_CONTAINER_TYPE",
                "container_type": "List",
                "type": "String"
            }
        }
    },
    "invariants": {
        "Original_language_valid": "code_set (Code_set_id_languages).has_code (original_language.as_string)",
        "Languages_available_valid": "languages_available.has (original_language)",
        "Revision_history_valid": "is_controlled xor revision_history = Void",
        "Current_revision_valid": "(current_revision /= Void and not is_controlled) implies current_revision.is_equal (“(uncontrolled)”)",
        "Translations_valid": "translations /= Void implies (not translations.is_empty and not translations.has (orginal_language.code_string))",
        "Description_valid": "translations /= Void implies (description.details.for_all (d |\ntranslations.has_key (d.language.code_string)))"
    }
}
AUTHORED_RESOURCE

TRANSLATION_DETAILS Class

  • Definition

  • Effective

  • BMM

  • UML

Class

TRANSLATION_DETAILS

Description

Class providing details of a natural language translation.

Attributes

Signature

Meaning

1..1

language: CODE_PHRASE

Language of the translation.

1..1

author: Hash<String,String>

Translator name and other demographic details.

0..1

accreditaton: String

Accreditation of translator, usually a national translator’s registration or association membership id.

0..1

other_details: Hash<String,String>

Any other meta-data.

Invariants

Language_valid: code_set (Code_set_id_languages).has_code (language)

TRANSLATION_DETAILS

Class providing details of a natural language translation.

Attributes

language: CODE_PHRASE [1..1]

Language of the translation.

author: Hash<String,String> [1..1]

Translator name and other demographic details.

accreditaton: String [0..1]

Accreditation of translator, usually a national translator’s registration or association membership id.

other_details: Hash<String,String> [0..1]

Any other meta-data.

Invariants

Language_valid: code_set (Code_set_id_languages).has_code (language)

{
    "name": "TRANSLATION_DETAILS",
    "documentation": "Class providing details of a natural language translation. ",
    "properties": {
        "language": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "language",
            "documentation": "Language of the translation.",
            "is_mandatory": true,
            "type": "CODE_PHRASE"
        },
        "author": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "author",
            "documentation": "Translator name and other demographic details.",
            "is_mandatory": true,
            "type_def": {
                "root_type": "Hash",
                "generic_parameters": [
                    "String",
                    "String"
                ]
            }
        },
        "accreditaton": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "accreditaton",
            "documentation": "Accreditation of translator, usually a national translator's registration or association membership id.",
            "type": "String"
        },
        "other_details": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "other_details",
            "documentation": "Any other meta-data.",
            "type_def": {
                "root_type": "Hash",
                "generic_parameters": [
                    "String",
                    "String"
                ]
            }
        }
    },
    "invariants": {
        "Language_valid": "code_set (Code_set_id_languages).has_code (language)"
    }
}
TRANSLATION_DETAILS

RESOURCE_DESCRIPTION Class

  • Definition

  • Effective

  • BMM

  • UML

Class

RESOURCE_DESCRIPTION

Description

Defines the descriptive meta-data of a resource.

Attributes

Signature

Meaning

1..1

original_author: Hash<String,String>

Original author of this resource, with all relevant details, including organisation.

0..1

other_contributors: List<String>

Other contributors to the resource, probably listed in 'name <email>' form.

1..1

lifecycle_state: String

Lifecycle state of the resource, typically including states such as: initial | submitted | experimental | awaiting_approval | approved | superseded | obsolete.

0..1

resource_package_uri: String

URI of package to which this resource belongs.

0..1

other_details: Hash<String,String>

Additional non language-senstive resource meta-data, as a list of name/value pairs.

1..1

parent_resource: AUTHORED_RESOURCE
{default = 0..1}

Reference to owning resource.

1..1

details: Hash<String,RESOURCE_DESCRIPTION_ITEM>

Details of all parts of resource description that are natural language-dependent, keyed by language code.

Invariants

Original_author_valid: not original_author.is_empty

Lifecycle_state_valid: not lifecycle_state.is_empty

Details_valid: not details.is_empty

Language_valid: parent_resource /= Void implies details.for_all (d | parent_resource.languages_available.has (d.language.code_string))

Parent_resource_valid: parent_resource /= Void implies parent_resource.description = self

RESOURCE_DESCRIPTION

Defines the descriptive meta-data of a resource.

Attributes

original_author: Hash<String,String> [1..1]

Original author of this resource, with all relevant details, including organisation.

other_contributors: List<String> [0..1]

Other contributors to the resource, probably listed in 'name <email>' form.

lifecycle_state: String [1..1]

Lifecycle state of the resource, typically including states such as: initial | submitted | experimental | awaiting_approval | approved | superseded | obsolete.

resource_package_uri: String [0..1]

URI of package to which this resource belongs.

other_details: Hash<String,String> [0..1]

Additional non language-senstive resource meta-data, as a list of name/value pairs.

parent_resource: AUTHORED_RESOURCE [1..1]
{default = 0..1}

Reference to owning resource.

details: Hash<String,RESOURCE_DESCRIPTION_ITEM> [1..1]

Details of all parts of resource description that are natural language-dependent, keyed by language code.

Invariants

Original_author_valid: not original_author.is_empty

Lifecycle_state_valid: not lifecycle_state.is_empty

Details_valid: not details.is_empty

Language_valid: parent_resource /= Void implies details.for_all (d | parent_resource.languages_available.has (d.language.code_string))

Parent_resource_valid: parent_resource /= Void implies parent_resource.description = self

{
    "name": "RESOURCE_DESCRIPTION",
    "documentation": "Defines the descriptive meta-data of a resource.",
    "properties": {
        "original_author": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "original_author",
            "documentation": "Original author of this resource, with all relevant details, including organisation.",
            "is_mandatory": true,
            "type_def": {
                "root_type": "Hash",
                "generic_parameters": [
                    "String",
                    "String"
                ]
            }
        },
        "other_contributors": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "other_contributors",
            "documentation": "Other contributors to the resource, probably listed in  `'name <email>'`  form. ",
            "type_def": {
                "container_type": "List",
                "type": "String"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "lifecycle_state": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "lifecycle_state",
            "documentation": "Lifecycle state of the resource, typically including states such as: `initial | submitted | experimental | awaiting_approval | approved | superseded | obsolete`.",
            "is_mandatory": true,
            "type": "String"
        },
        "resource_package_uri": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "resource_package_uri",
            "documentation": "URI of package to which this resource belongs.",
            "type": "String"
        },
        "other_details": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "other_details",
            "documentation": "Additional non language-senstive resource meta-data, as a list of name/value pairs. ",
            "type_def": {
                "root_type": "Hash",
                "generic_parameters": [
                    "String",
                    "String"
                ]
            }
        },
        "parent_resource": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "parent_resource",
            "documentation": "Reference to owning resource. ",
            "is_mandatory": true,
            "type": "AUTHORED_RESOURCE",
            "default": "0..1"
        },
        "details": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "details",
            "documentation": "Details of all parts of resource description that are natural language-dependent, keyed by language code. ",
            "is_mandatory": true,
            "type_def": {
                "root_type": "Hash",
                "generic_parameters": [
                    "String",
                    "RESOURCE_DESCRIPTION_ITEM"
                ]
            }
        }
    },
    "invariants": {
        "Original_author_valid": "not original_author.is_empty",
        "Lifecycle_state_valid": "not lifecycle_state.is_empty",
        "Details_valid": "not details.is_empty",
        "Language_valid": "parent_resource /= Void implies details.for_all (d | parent_resource.languages_available.has (d.language.code_string))",
        "Parent_resource_valid": "parent_resource /= Void implies parent_resource.description = self"
    }
}
RESOURCE_DESCRIPTION

RESOURCE_DESCRIPTION_ITEM Class

  • Definition

  • Effective

  • BMM

  • UML

Class

RESOURCE_DESCRIPTION_ITEM

Description

Language-specific detail of resource description. When a resource is translated for use in another language environment, each RESOURCE_DESCRIPTION_ITEM needs to be copied and translated into the new language.

Attributes

Signature

Meaning

1..1

language: CODE_PHRASE

The localised language in which the items in this description item are written. Coded from openEHR code set languages.

1..1

purpose: String

Purpose of the resource.

0..1

keywords: List<String>

Keywords which characterise this resource, used e.g. for indexing and searching.

0..1

use: String

Description of the uses of the resource, i.e. contexts in which it could be used.

0..1

misuse: String

Description of any misuses of the resource, i.e. contexts in which it should not be used.

0..1

copyright: String

Optional copyright statement for the resource as a knowledge resource.

0..1

original_resource_uri: Hash<String,String>

URIs of original clinical document(s) or description of which resource is a formalisation, in the language of this description item; keyed by meaning.

0..1

other_details: Hash<String,String>

Additional language-senstive resource metadata, as a list of name/value pairs.

Invariants

Language_valid: code_set (Code_set_id_languages).has_code (language)

Purpose_valid: not purpose.is_empty

Use_valid: use /= Void implies not use.is_empty

misuse_valid: misuse /= Void implies not misuse.is_empty

copyright_valid: copyright /= Void implies not copyright.is_empty

RESOURCE_DESCRIPTION_ITEM

Language-specific detail of resource description. When a resource is translated for use in another language environment, each RESOURCE_DESCRIPTION_ITEM needs to be copied and translated into the new language.

Attributes

language: CODE_PHRASE [1..1]

The localised language in which the items in this description item are written. Coded from openEHR code set languages.

purpose: String [1..1]

Purpose of the resource.

keywords: List<String> [0..1]

Keywords which characterise this resource, used e.g. for indexing and searching.

use: String [0..1]

Description of the uses of the resource, i.e. contexts in which it could be used.

misuse: String [0..1]

Description of any misuses of the resource, i.e. contexts in which it should not be used.

copyright: String [0..1]

Optional copyright statement for the resource as a knowledge resource.

original_resource_uri: Hash<String,String> [0..1]

URIs of original clinical document(s) or description of which resource is a formalisation, in the language of this description item; keyed by meaning.

other_details: Hash<String,String> [0..1]

Additional language-senstive resource metadata, as a list of name/value pairs.

Invariants

Language_valid: code_set (Code_set_id_languages).has_code (language)

Purpose_valid: not purpose.is_empty

Use_valid: use /= Void implies not use.is_empty

misuse_valid: misuse /= Void implies not misuse.is_empty

copyright_valid: copyright /= Void implies not copyright.is_empty

{
    "name": "RESOURCE_DESCRIPTION_ITEM",
    "documentation": "Language-specific detail of resource description. When a resource is translated for use in another language environment, each `RESOURCE_DESCRIPTION_ITEM` needs to be copied and translated into the new language.",
    "properties": {
        "language": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "language",
            "documentation": "The localised language in which the items in this description item are written. Coded from openEHR code set `languages`.",
            "is_mandatory": true,
            "type": "CODE_PHRASE"
        },
        "purpose": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "purpose",
            "documentation": "Purpose of the resource.",
            "is_mandatory": true,
            "type": "String"
        },
        "keywords": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "keywords",
            "documentation": "Keywords which characterise this resource, used e.g. for indexing and searching. ",
            "type_def": {
                "container_type": "List",
                "type": "String"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "use": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "use",
            "documentation": "Description of the uses of the resource, i.e. contexts in which it could be used. \n",
            "type": "String"
        },
        "misuse": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "misuse",
            "documentation": "Description of any misuses of the resource, i.e. contexts in which it should not be used.",
            "type": "String"
        },
        "copyright": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "copyright",
            "documentation": "Optional copyright statement for the resource as a knowledge resource. \n",
            "type": "String"
        },
        "original_resource_uri": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "original_resource_uri",
            "documentation": "URIs of original clinical document(s) or description of which resource is a formalisation, in the language of this description item; keyed by meaning. ",
            "type_def": {
                "root_type": "Hash",
                "generic_parameters": [
                    "String",
                    "String"
                ]
            }
        },
        "other_details": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "other_details",
            "documentation": "Additional language-senstive resource metadata, as a list of name/value pairs. ",
            "type_def": {
                "root_type": "Hash",
                "generic_parameters": [
                    "String",
                    "String"
                ]
            }
        }
    },
    "invariants": {
        "Language_valid": "code_set (Code_set_id_languages).has_code (language)",
        "Purpose_valid": "not purpose.is_empty",
        "Use_valid": "use /= Void implies not use.is_empty",
        "misuse_valid": "misuse /= Void implies not misuse.is_empty",
        "copyright_valid": "copyright /= Void implies not copyright.is_empty"
    }
}
RESOURCE_DESCRIPTION_ITEM