Terminology Package

Overview

All linguistic and terminological entities in an archetype are represented in the ontology part of an archetype, whose semantics are given in the ontology package, shown below.

AM aom14.archetype.ontology
Figure 1. aom14.archetype.ontology Package

An archetype ontology consists of the following things.

  • A list of terms defined local to the archetype. These are identified by 'atNNNN' codes, and perform the function of archetype node identifiers from which paths are created. There is one such list for each natural language in the archetype. A term 'at0001' defined in English as 'blood group' is an example.

  • A list of external constraint definitions, identified by 'acNNNN' codes, for constraints defined external to the archetype, and referenced using an instance of a CONSTRAINT_REF. There is one such list for each natural language in the archetype. A term 'ac0001' corresponding to 'any term which is-a blood group', which can be evaluated against some external terminology service.

  • Optionally, a set of one or more bindings of term definitions to term codes from external terminologies.

  • Optionally, a set of one or more bindings of the external constraint definitions to external resources such as terminologies.

Semantics

Specialisation Depth

Any given archetype occurs at some point in a lineage of archetypes related by specialisation, where the depth is reflected by the specialisation_depth attribute. An archetype which is not a specialisation of another has a specialisation_depth of 0. Term and constraint codes introduced in the terminology of specialised archetypes (i.e. which did not exist in the terminology of the parent archetype) are defined in a strict way, using '.' (period) markers. For example, an archetype of specialisation depth 2 will use term definition codes like the following:

  • at0.0.1 - a new term introduced in this archetype, which is not a specialisation of any previous term in any of the parent archetypes;

  • at0001.0.1 - a term which specialises the 'at0001' term from the top parent. An intervening '.0' is required to show that the new term is at depth 2, not depth 1;

  • at0001.1.1 - a term which specialises the term 'at0001.1' from the immediate parent, which itself specialises the term 'at0001' from the top parent.

This systematic definition of codes enables software to use the structure of the codes to more quickly and accurately make inferences about term definitions up and down specialisation hierarchies. Constraint codes on the other hand do not follow these rules, and exist in a flat code space instead.

Term and Constraint Definitions

Local term and constraint definitions are modelled as instances of the class ARCHETYPE_TERM, which is a code associated with a list of name/value pairs. For any term or constraint definition, this list must at least include the name/value pairs for the names "text" and "description". It might also include such things as "provenance", which would be used to indicate that a term was sourced from an external terminology. The attribute term_attribute_names in ARCHETYPE_ONTOLOGY provides a list of attribute names used in term and constraint definitions in the archetype, including "text" and "description", as well as any others which are used in various places.

Class Descriptions

ARCHETYPE_ONTOLOGY Class

  • Definition

  • Effective

  • BMM

  • UML

Class

ARCHETYPE_ONTOLOGY

Description

Local ontology of an archetype.

Attributes

Signature

Meaning

1..1

term_codes: List<String>

List of all term codes in the ontology. Most of these correspond to “at” codes in an ADL archetype, which are the node_ids on C_OBJECT descendants. There may be an extra one, if a different term is used as the overall archetype concept from that used as the node_id of the outermost C_OBJECT in the definition part.

1..1

constraint_codes: List<String>

List of all term codes in the ontology. These correspond to the “ac” codes in an ADL archetype, or equivalently, the CONSTRAINT_REF.reference values in the archetype definition.

1..1

parent_archetype: ARCHETYPE

Archetype which owns this terminology.

0..1

terminologies_available: List<String>

List of terminologies to which term or constraint bindings exist in this terminology.

1..1

specialisation_depth: Integer

Specialisation depth of this archetype. Unspecialised archetypes have depth 0, with each additional level of specialisation adding 1 to the specialisation_depth.

1..1

term_attribute_names: List<String>

Functions

Signature

Meaning

1..1

has_language (
a_lang: String[1]
): Boolean

True if terminology ‘a_terminology’ is present in archetype ontology.

1..1

has_terminology (
a_terminology_id: String[1]
): Boolean

True if terminology `a_terminology' is present in archetype ontology.

1..1

has_term_code (
a_code: String[1]
): Boolean

True if term_codes has a_code.

1..1

has_constraint_code (
a_code: String[1]
): Boolean

True if constraint_codes has a_code.

1..1

term_definition (
a_lang: String[1],
a_code: String[1]
): ARCHETYPE_TERM

Pre: has_language (a_lang)
Pre2: has_term_code (a_code)

Term definition for a code, in a specified language.

1..1

constraint_definition (
a_code: String[1],
a_lang: String[1]
): ARCHETYPE_TERM

Pre: has_language (a_lang)
Pre_2: has_constraint_code (a_code)

Constraint definition for a code, in a specified language.

1..1

term_binding (
a_terminology: String[1],
a_code: String[1]
): CODE_PHRASE `

Pre: `has_term_binding (a_terminology_id, a_code)

Binding of constraint corresponding to a_code in target external terminology a_terminology_id, as a string, which is usually a formal query expression.

1..1

constraint_binding (
a_terminology_id: String[1],
a_code: String[1]
): String

Binding of constraint corresponding to a_code in target external terminology a_terminology_id, as a string, which is usually a formal query expression.

Invariants

Original_language_validity: code_set (Code_set_id_languages).has_concept_id (original_language)

concept_code_validity: id_codes.has (concept_code)

Term_bindings_validity: bindings /= void implies not bindings.is_empty

Parent_archetype_valid: parent_archetype.ontology = Current

ARCHETYPE_ONTOLOGY

Local ontology of an archetype.

Attributes

term_codes: List<String> [1..1]

List of all term codes in the ontology. Most of these correspond to “at” codes in an ADL archetype, which are the node_ids on C_OBJECT descendants. There may be an extra one, if a different term is used as the overall archetype concept from that used as the node_id of the outermost C_OBJECT in the definition part.

constraint_codes: List<String> [1..1]

List of all term codes in the ontology. These correspond to the “ac” codes in an ADL archetype, or equivalently, the CONSTRAINT_REF.reference values in the archetype definition.

parent_archetype: ARCHETYPE [1..1]

Archetype which owns this terminology.

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

List of terminologies to which term or constraint bindings exist in this terminology.

specialisation_depth: Integer [1..1]

Specialisation depth of this archetype. Unspecialised archetypes have depth 0, with each additional level of specialisation adding 1 to the specialisation_depth.

term_attribute_names: List<String> [1..1]

Functions

has_language (
a_lang: String[1]
): Boolean [1..1]

True if terminology ‘a_terminology’ is present in archetype ontology.

has_terminology (
a_terminology_id: String[1]
): Boolean [1..1]

True if terminology `a_terminology' is present in archetype ontology.

has_term_code (
a_code: String[1]
): Boolean [1..1]

True if term_codes has a_code.

has_constraint_code (
a_code: String[1]
): Boolean [1..1]

True if constraint_codes has a_code.

term_definition (
a_lang: String[1],
a_code: String[1]
): ARCHETYPE_TERM

Pre: has_language (a_lang)
Pre2: has_term_code (a_code) [1..1]

Term definition for a code, in a specified language.

constraint_definition (
a_code: String[1],
a_lang: String[1]
): ARCHETYPE_TERM

Pre: has_language (a_lang)
Pre_2: has_constraint_code (a_code) [1..1]

Constraint definition for a code, in a specified language.

term_binding (
a_terminology: String[1],
a_code: String[1]
): CODE_PHRASE `

Pre: `has_term_binding (a_terminology_id, a_code)
[1..1]

Binding of constraint corresponding to a_code in target external terminology a_terminology_id, as a string, which is usually a formal query expression.

constraint_binding (
a_terminology_id: String[1],
a_code: String[1]
): String [1..1]

Binding of constraint corresponding to a_code in target external terminology a_terminology_id, as a string, which is usually a formal query expression.

Invariants

Original_language_validity: code_set (Code_set_id_languages).has_concept_id (original_language)

concept_code_validity: id_codes.has (concept_code)

Term_bindings_validity: bindings /= void implies not bindings.is_empty

Parent_archetype_valid: parent_archetype.ontology = Current

{
    "name": "ARCHETYPE_ONTOLOGY",
    "documentation": "Local ontology of an archetype.",
    "properties": {
        "term_codes": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "term_codes",
            "documentation": "List of all term codes in the ontology. Most of these correspond to “at” codes in an ADL archetype, which are the node_ids on C_OBJECT descendants. There may be an extra one, if a different term is used as the overall archetype concept from that used as the node_id of the outermost C_OBJECT in the definition part.",
            "is_mandatory": true,
            "type_def": {
                "container_type": "List",
                "type": "String"
            },
            "cardinality": {
                "lower": 1,
                "upper_unbounded": true
            }
        },
        "constraint_codes": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "constraint_codes",
            "documentation": "List of all term codes in the ontology. These correspond to the “ac” codes in an ADL archetype, or equivalently, the CONSTRAINT_REF.reference values in the archetype definition.",
            "is_mandatory": true,
            "type_def": {
                "container_type": "List",
                "type": "String"
            },
            "cardinality": {
                "lower": 1,
                "upper_unbounded": true
            }
        },
        "parent_archetype": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "parent_archetype",
            "documentation": "Archetype which owns this terminology.",
            "is_mandatory": true,
            "type": "ARCHETYPE"
        },
        "terminologies_available": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "terminologies_available",
            "documentation": "List of terminologies to which term or constraint bindings exist in this terminology.",
            "type_def": {
                "container_type": "List",
                "type": "String"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "specialisation_depth": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "specialisation_depth",
            "documentation": "Specialisation depth of this archetype. Unspecialised archetypes have depth 0, with each additional level of specialisation adding 1 to the specialisation_depth.",
            "is_mandatory": true,
            "type": "Integer"
        },
        "term_attribute_names": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "term_attribute_names",
            "is_mandatory": true,
            "type_def": {
                "container_type": "List",
                "type": "String"
            },
            "cardinality": {
                "lower": 1,
                "upper_unbounded": true
            }
        }
    },
    "functions": {
        "has_language": {
            "name": "has_language",
            "documentation": "True if terminology ‘a_terminology’ is present in archetype ontology.",
            "parameters": {
                "a_lang": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_lang",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "has_terminology": {
            "name": "has_terminology",
            "documentation": "True if terminology `a_terminology' is present in archetype ontology. ",
            "parameters": {
                "a_terminology_id": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_terminology_id",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "has_term_code": {
            "name": "has_term_code",
            "documentation": "True if term_codes has a_code.",
            "parameters": {
                "a_code": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_code",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "has_constraint_code": {
            "name": "has_constraint_code",
            "documentation": "True if constraint_codes has a_code.",
            "parameters": {
                "a_code": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_code",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "term_definition": {
            "name": "term_definition",
            "documentation": "Term definition for a code, in a specified language. ",
            "parameters": {
                "a_lang": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_lang",
                    "type": "String"
                },
                "a_code": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_code",
                    "type": "String"
                }
            },
            "pre_conditions": {
                "Pre": "has_language (a_lang)",
                "Pre2": "has_term_code (a_code)"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "ARCHETYPE_TERM"
            }
        },
        "constraint_definition": {
            "name": "constraint_definition",
            "documentation": "Constraint definition for a code, in a specified language.",
            "parameters": {
                "a_code": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_code",
                    "type": "String"
                },
                "a_lang": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_lang",
                    "type": "String"
                }
            },
            "pre_conditions": {
                "Pre": "has_language (a_lang)",
                "Pre_2": "has_constraint_code (a_code)"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "ARCHETYPE_TERM"
            }
        },
        "term_binding": {
            "name": "term_binding",
            "documentation": "Binding of constraint corresponding to a_code in target external terminology a_terminology_id, as a string, which is usually a formal query expression.",
            "parameters": {
                "a_terminology": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_terminology",
                    "type": "String"
                },
                "a_code": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_code",
                    "type": "String"
                }
            },
            "pre_conditions": {
                "Pre": "has_term_binding (a_terminology_id, a_code)"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "CODE_PHRASE"
            }
        },
        "constraint_binding": {
            "name": "constraint_binding",
            "documentation": "Binding of constraint corresponding to a_code in target external terminology a_terminology_id, as a string, which is usually a formal query expression.",
            "parameters": {
                "a_terminology_id": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_terminology_id",
                    "type": "String"
                },
                "a_code": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_code",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "String"
            }
        }
    },
    "invariants": {
        "Original_language_validity": "code_set (Code_set_id_languages).has_concept_id (original_language)",
        "concept_code_validity": "id_codes.has (concept_code)",
        "Term_bindings_validity": "bindings /= void implies not bindings.is_empty",
        "Parent_archetype_valid": "parent_archetype.ontology = Current"
    }
}
aom14.archetype ontology

ARCHETYPE_TERM Class

  • Definition

  • Effective

  • BMM

  • UML

Class

ARCHETYPE_TERM

Description

Representation of any coded entity (term or constraint) in the archetype ontology.

Attributes

Signature

Meaning

1..1

code: String

Code of this term.

0..1

items: Hash<String,String>

Hash of keys (“text”, “description” etc) and corresponding values.

Functions

Signature

Meaning

0..1

keys (): List<String>

List of all keys used in this term.

Invariants

Code_valid: not code.is_empty

ARCHETYPE_TERM

Representation of any coded entity (term or constraint) in the archetype ontology.

Attributes

code: String [1..1]

Code of this term.

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

Hash of keys (“text”, “description” etc) and corresponding values.

Functions

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

List of all keys used in this term.

Invariants

Code_valid: not code.is_empty

{
    "name": "ARCHETYPE_TERM",
    "documentation": "Representation of any coded entity (term or constraint) in the archetype ontology.",
    "properties": {
        "code": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "code",
            "documentation": "Code of this term. ",
            "is_mandatory": true,
            "type": "String"
        },
        "items": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "items",
            "documentation": "Hash of keys (“text”, “description” etc) and corresponding values.",
            "type_def": {
                "root_type": "Hash",
                "generic_parameters": [
                    "String",
                    "String"
                ]
            }
        }
    },
    "functions": {
        "keys": {
            "name": "keys",
            "documentation": "List of all keys used in this term.",
            "result": {
                "_type": "P_BMM_CONTAINER_TYPE",
                "container_type": "List",
                "type": "String"
            },
            "is_nullable": true
        }
    },
    "invariants": {
        "Code_valid": "not code.is_empty"
    }
}
aom14.archetype term