Terminology Package
Overview
All local terminology as well as terminological and terminology binding elements of an archetype are represented in the terminology section of an archetype, whose semantics are defined by the aom2.terminology package, shown below.
am.aom2.terminology PackageAn archetype terminology consists of the following elements.
-
term_definitions: a mandatory structure consisting of lists of term definitions defined local to the archetype, one list for each language of translation, as well as the original language of definition. The entries in this table include:-
Some or all id-codes. One of these is a code of the form 'id1', 'id1.1', 'id1.1.1' etc, denoting the concept of the archetype as a whole. This particular code is recorded in the
concept_codeattribute and is used as the id-code on the root node in the archetype definition. Not all id-codes are required to be in the term_definitions structure - for nodes that are children of single-valued attribute, a term definition is optional (and not typically defined). -
at-codes used to define value terms and inline value sets/ All at-codes will appear within a
C_TERMINOLOGY_CODEconstraint object within the archetype. All at-codes must have a definition in the term_definitions. -
ac-codes used to define external value set references. All ac-codes must have a definition in the term_definitions.
-
-
term_bindings: an optional structure consisting of list of terms and bindings, one list for each external terminology (i.e. the terminology or ontology being 'bound to'). Each 'binding' is a URI to a target. For a binding of an id-code or an at-code, the target will be a single term, and for an ac-code, it will designate a ref-set or value set. -
value_sets: optional structure defining value-set relationships for locally defined value sets. Each value set is identified by an ac-code and has as members one or more at-codes. -
terminology_extracts: an optional structure containing extracts from external terminologies such as SNOMED CT, ICDx, or any local terminology. These extracts include the codes and preferred term rubrics, enabling the terms to be used for both display purposes. This structure is normally only used for templates, enabling small value sets for which no external reference set or subset is defined to be captured locally in the template.
Depending on whether the archetype is in differential or flat form, an instance of the ARCHETYPE_TERMINOLOGY class contains terms, constraints, bindings and terminology extracts that were respectively either introduced in the owning archetype, or all codes and bindings obtained by compressing an archetype lineage through inheritance. A typical instance structure of ARCHETYPE_TERMINOLOGY is illustrated in Terminology Instance Structure.
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 function. 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:
-
id0.0.1- a new term introduced in this archetype, which is not a specialisation of any previous term in any of the parent archetypes; -
id4.0.1- a term which specialises theid4term from the top parent. An intervening.0is required to show that the new term is at depth 2, not depth 1; -
id25.1.1- a term which specialises the termid25.1from the immediate parent, which itself specialises the termid25from 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.
Class Descriptions
ARCHETYPE_TERMINOLOGY Class
-
Definition
-
Effective
-
BMM
-
UML
Class |
ARCHETYPE_TERMINOLOGY |
|
|---|---|---|
Description |
Local terminology of an archetype. This class defines the semantics of the terminology of an archetype. |
|
Attributes |
Signature |
Meaning |
1..1 |
is_differential: |
True if this terminology only contains terms relating to a differential specialisation of the owning artefact, rather than a complete set. |
1..1 |
original_language: |
Original language of the terminology, as set at artefact creation or parsing time; must be a code in the ISO 639-1 2 character language code-set. |
1..1 |
concept_code: |
Term code defining the meaning of the artefact as a whole, and always used as the id-code on the root node of the artefact. Must be defined in the |
1..1 |
term_definitions: |
Directory of term definitions as a two-level table. The outer hash keys are language codes, e.g. |
0..1 |
Directory of bindings to external terminology codes and value sets, as a two-level table. The outer hash keys are terminology ids, e.g. |
|
1..1 |
owner_archetype: |
Archetype that owns this terminology. |
0..1 |
Archetype-local value sets, each keyed by value-set id, i.e. an ac-code. |
|
0..1 |
terminology_extracts: |
Directory of extracts of external terminologies, as a two-level table. The outer hash keys are terminology ids, e.g. |
Functions |
Signature |
Meaning |
1..1 |
specialisation_depth (): |
Specialisation depth of this artefact. Unspecialised artefacts have depth 0, with each additional level of specialisation adding 1 to the specialisation_depth. |
1..1 |
List of all id codes in the terminology., i.e. the 'id' codes in an ADL archetype, which are the |
|
0..1 |
List of all value term codes in the terminology, i.e. the 'at' codes in an ADL archetype, which are used as possible values on terminological constrainer nodes. |
|
0..1 |
List of all value set codes in the terminology defining value sets. These correspond to the 'ac' codes in an ADL archetype. |
|
1..1 |
True if language |
|
1..1 |
True if there are bindings to terminology |
|
1..1 |
True if code |
|
1..1 |
term_definition ( |
Term definition for a code, in a specified language. |
1..1 |
term_binding ( |
Binding of constraint corresponding to |
1..1 |
List of terminologies to which term or constraint bindings exist in this terminology, computed from bindings. |
|
1..1 |
terminology_extract_term ( |
Return an |
1..1 |
has_terminology_extract ( |
True if there is a provided terminology extract present. |
1..1 |
List of languages in which terms in this terminology are available. |
|
Invariants |
Original_language_validity: |
|
concept_code_validity: |
||
Term_bindings_validity: |
||
Parent_archetype_valid: |
||
| ARCHETYPE_TERMINOLOGY | |
|---|---|
Local terminology of an archetype. This class defines the semantics of the terminology of an archetype. |
|
Attributes |
|
is_differential: |
True if this terminology only contains terms relating to a differential specialisation of the owning artefact, rather than a complete set. |
original_language: |
Original language of the terminology, as set at artefact creation or parsing time; must be a code in the ISO 639-1 2 character language code-set. |
concept_code: |
Term code defining the meaning of the artefact as a whole, and always used as the id-code on the root node of the artefact. Must be defined in the |
term_definitions: |
Directory of term definitions as a two-level table. The outer hash keys are language codes, e.g. |
Directory of bindings to external terminology codes and value sets, as a two-level table. The outer hash keys are terminology ids, e.g. |
|
owner_archetype: |
Archetype that owns this terminology. |
Archetype-local value sets, each keyed by value-set id, i.e. an ac-code. |
|
terminology_extracts: |
Directory of extracts of external terminologies, as a two-level table. The outer hash keys are terminology ids, e.g. |
Functions |
|
specialisation_depth (): |
Specialisation depth of this artefact. Unspecialised artefacts have depth 0, with each additional level of specialisation adding 1 to the specialisation_depth. |
List of all id codes in the terminology., i.e. the 'id' codes in an ADL archetype, which are the |
|
List of all value term codes in the terminology, i.e. the 'at' codes in an ADL archetype, which are used as possible values on terminological constrainer nodes. |
|
List of all value set codes in the terminology defining value sets. These correspond to the 'ac' codes in an ADL archetype. |
|
True if language |
|
has_terminology ( |
True if there are bindings to terminology |
True if code |
|
term_definition ( |
Term definition for a code, in a specified language. |
term_binding ( |
Binding of constraint corresponding to |
List of terminologies to which term or constraint bindings exist in this terminology, computed from bindings. |
|
terminology_extract_term ( |
Return an |
has_terminology_extract ( |
True if there is a provided terminology extract present. |
List of languages in which terms in this terminology are available. |
|
Invariants |
|
Original_language_validity: |
|
concept_code_validity: |
|
Term_bindings_validity: |
|
Parent_archetype_valid: |
|
{
"name": "ARCHETYPE_TERMINOLOGY",
"documentation": "Local terminology of an archetype. This class defines the semantics of the terminology of an archetype.",
"properties": {
"is_differential": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "is_differential",
"documentation": "True if this terminology only contains terms relating to a differential specialisation of the owning artefact, rather than a complete set.",
"is_mandatory": true,
"type": "Boolean"
},
"original_language": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "original_language",
"documentation": "Original language of the terminology, as set at artefact creation or parsing time; must be a code in the ISO 639-1 2 character language code-set.\n",
"is_mandatory": true,
"type": "String"
},
"concept_code": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "concept_code",
"documentation": "Term code defining the meaning of the artefact as a whole, and always used as the id-code on the root node of the artefact. Must be defined in the `_term_definitions_` property.",
"is_mandatory": true,
"type": "String"
},
"term_definitions": {
"_type": "P_BMM_GENERIC_PROPERTY",
"name": "term_definitions",
"documentation": "Directory of term definitions as a two-level table. The outer hash keys are language codes, e.g. `\"en\"`, `\"de\"`, while the inner hash keys are term codes, e.g. `\"id17\"`, `\"at4\"`.",
"is_mandatory": true,
"type_def": {
"root_type": "Hash",
"generic_parameter_defs": {
"K": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "String"
},
"V": {
"_type": "P_BMM_GENERIC_TYPE",
"root_type": "Hash",
"generic_parameters": [
"String",
"ARCHETYPE_TERM"
]
}
}
}
},
"term_bindings": {
"_type": "P_BMM_GENERIC_PROPERTY",
"name": "term_bindings",
"documentation": "Directory of bindings to external terminology codes and value sets, as a two-level table. The outer hash keys are terminology ids, e.g. `\"SNOMED_CT\"`, and the inner hash keys are constraint codes, e.g. `\"at4\"`, `\"ac13\"` or paths. The indexed `Uri` objects represent references to externally defined resources, either terms, ontology concepts, or terminology subsets / ref-sets.",
"type_def": {
"root_type": "Hash",
"generic_parameter_defs": {
"K": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "String"
},
"V": {
"_type": "P_BMM_GENERIC_TYPE",
"root_type": "Hash",
"generic_parameters": [
"String",
"Uri"
]
}
}
}
},
"owner_archetype": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "owner_archetype",
"documentation": "Archetype that owns this terminology.",
"is_mandatory": true,
"type": "ARCHETYPE"
},
"value_sets": {
"_type": "P_BMM_CONTAINER_PROPERTY",
"name": "value_sets",
"documentation": "Archetype-local value sets, each keyed by value-set id, i.e. an ac-code.",
"type_def": {
"container_type": "List",
"type": "String"
},
"cardinality": {
"lower": 0,
"upper_unbounded": true
}
},
"terminology_extracts": {
"_type": "P_BMM_GENERIC_PROPERTY",
"name": "terminology_extracts",
"documentation": "Directory of extracts of external terminologies, as a two-level table. The outer hash keys are terminology ids, e.g. `\"SNOMED_CT\"`, while the inner hash keys are term codes or code-phrases from the relevant terminology, e.g. `\"10094842\"`.",
"type_def": {
"root_type": "Hash",
"generic_parameter_defs": {
"K": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "String"
},
"V": {
"_type": "P_BMM_GENERIC_TYPE",
"root_type": "Hash",
"generic_parameters": [
"String",
"ARCHETYPE_TERM"
]
}
}
}
}
},
"functions": {
"specialisation_depth": {
"name": "specialisation_depth",
"documentation": "Specialisation depth of this artefact. Unspecialised artefacts have depth 0, with each additional level of specialisation adding 1 to the specialisation_depth.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"id_codes": {
"name": "id_codes",
"documentation": "List of all id codes in the terminology., i.e. the 'id' codes in an ADL archetype, which are the `_node_id_` values on `C_OBJECT` descendants.",
"result": {
"_type": "P_BMM_CONTAINER_TYPE",
"container_type": "List",
"type": "String"
}
},
"value_codes": {
"name": "value_codes",
"documentation": "List of all value term codes in the terminology, i.e. the 'at' codes in an ADL archetype, which are used as possible values on terminological constrainer nodes.",
"result": {
"_type": "P_BMM_CONTAINER_TYPE",
"container_type": "List",
"type": "String"
},
"is_nullable": true
},
"value_set_codes": {
"name": "value_set_codes",
"documentation": "List of all value set codes in the terminology defining value sets. These correspond to the 'ac' codes in an ADL archetype.",
"result": {
"_type": "P_BMM_CONTAINER_TYPE",
"container_type": "List",
"type": "String"
},
"is_nullable": true
},
"has_language": {
"name": "has_language",
"documentation": "True if language `_a_lang_` is present in archetype terminology. ",
"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 there are bindings to terminology `_a_terminology_id_` present.",
"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 code `_a_code_` defined in this terminology.",
"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_term-definition (a_lang, 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": "Uri"
}
},
"terminologies_available": {
"name": "terminologies_available",
"documentation": "List of terminologies to which term or constraint bindings exist in this terminology, computed from bindings.",
"result": {
"_type": "P_BMM_CONTAINER_TYPE",
"container_type": "List",
"type": "String"
}
},
"terminology_extract_term": {
"name": "terminology_extract_term",
"documentation": "Return an `ARCHETYPE_TERM` from specified terminology extract, for specified term code.",
"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"
}
},
"pre_conditions": {
"Pre": "has_terminology_extract (a_terminology_id) and has_terminology_extract_code (a_code)"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "ARCHETYPE_TERM"
}
},
"has_terminology_extract": {
"name": "has_terminology_extract",
"documentation": "True if there is a provided terminology extract present.",
"parameters": {
"a_terminology_id": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_terminology_id",
"type": "String"
}
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"languages_available": {
"name": "languages_available",
"documentation": "List of languages in which terms in this terminology are available.",
"result": {
"_type": "P_BMM_CONTAINER_TYPE",
"container_type": "List",
"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.terminology = Current"
}
}
TERMINOLOGY_RELATION Class
-
Definition
-
Effective
-
BMM
-
UML
Class |
TERMINOLOGY_RELATION (abstract) |
|
|---|---|---|
Description |
Class whose instances represent any kind of 1:N relationship between a source term and 1-N target terms. |
|
Attributes |
Signature |
Meaning |
1..1 |
id: |
Code of source term of this relation. |
1..1 |
List of target terms in this relation. |
|
| TERMINOLOGY_RELATION (abstract) | |
|---|---|
Class whose instances represent any kind of 1:N relationship between a source term and 1-N target terms. |
|
Attributes |
|
id: |
Code of source term of this relation. |
List of target terms in this relation. |
|
{
"name": "TERMINOLOGY_RELATION",
"documentation": "Class whose instances represent any kind of 1:N relationship between a source term and 1-N target terms.",
"is_abstract": true,
"properties": {
"id": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "id",
"documentation": "Code of source term of this relation.",
"is_mandatory": true,
"type": "String"
},
"members": {
"_type": "P_BMM_CONTAINER_PROPERTY",
"name": "members",
"documentation": "List of target terms in this relation.",
"is_mandatory": true,
"type_def": {
"container_type": "List",
"type": "String"
},
"cardinality": {
"lower": 1,
"upper_unbounded": true
}
}
}
}
VALUE_SET Class
-
Definition
-
Effective
-
BMM
-
UML
Class |
VALUE_SET |
|
|---|---|---|
Description |
Representation of a flat value set within the archetype terminology. |
|
Inherit |
||
| VALUE_SET | |
|---|---|
Representation of a flat value set within the archetype terminology. |
|
Inherits: TERMINOLOGY_RELATION |
|
Attributes |
|
TERMINOLOGY_RELATION.id: |
Code of source term of this relation. |
TERMINOLOGY_RELATION.members: |
List of target terms in this relation. |
{
"name": "VALUE_SET",
"documentation": "Representation of a flat value set within the archetype terminology.",
"ancestors": [
"TERMINOLOGY_RELATION"
]
}
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: |
Code of this term. |
1..1 |
text: |
Short term text, typically for display. |
1..1 |
description: |
Full description text. |
0..1 |
Hash of keys and corresponding values for other items in a term, e.g. provenance. |
|
| ARCHETYPE_TERM | |
|---|---|
Representation of any coded entity (term or constraint) in the archetype ontology. |
|
Attributes |
|
code: |
Code of this term. |
text: |
Short term text, typically for display. |
description: |
Full description text. |
Hash of keys and corresponding values for other items in a term, e.g. provenance. |
|
{
"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"
},
"text": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "text",
"documentation": "Short term text, typically for display.",
"is_mandatory": true,
"type": "String"
},
"description": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "description",
"documentation": "Full description text.",
"is_mandatory": true,
"type": "String"
},
"other_items": {
"_type": "P_BMM_GENERIC_PROPERTY",
"name": "other_items",
"documentation": "Hash of keys and corresponding values for other items in a term, e.g. provenance.",
"type_def": {
"root_type": "Hash",
"generic_parameters": [
"String",
"String"
]
}
}
}
}
Validity Rules
The following validity rules apply to instances of this class in an archetype:
VTVSID: value-set id defined. The identifying code of a value set must be defined in the term definitions of the terminology of the current archetype.
VTVSMD: value-set members defined. The member codes of a value set must be defined in the term definitions of the terminology of the flattened form of the current archetype.
VTVSUQ: value-set members unique. The member codes of a value set must be unique within the value set.
VTSD specialisation level of codes. Term or constraint code defined in archetype terminology must be of the same specialisation level as the archetype (differential archetypes), or the same or a less specialised level (flat archetypes).
VTLC: language consistency. Languages consistent: all term codes and constraint codes exist in all languages.
VTTBK: terminology term binding key valid. Every term binding must be to either a defined archetype term ('at-code') or to a path that is valid in the flat archetype.
VTCBK: terminology constraint binding key valid. Every constraint binding must be to a defined archetype constraint code ('ac-code').