The Archetype Package
Overview
The model of an archetype, illustrated in the following figure, is straightforward at an abstract level, mimicking the structure of an archetype document as defined in the openEHR Archetype Definition Language (ADL) document. An archetype is modelled as a particular kind of AUTHORED_RESOURCE, and as such, includes descriptive meta-data, language information and revision history. The ARCHETYPE class adds identifying information, a definition - expressed in terms of constraints on instances of an object model, and an ontology. The archetype definition, the 'main' part of an archetype, is an instance of a C_COMPLEX_OBJECT, which is to say, the root of the constraint structure of an archetype always takes the form of a constraint on a non-primitive object type. The last section of an archetype, the ontology, is represented by its own class, and is what allows the archetypes to be natural language- and terminology-neutral.
Class Descriptions
ARCHETYPE Class
-
Definition
-
Effective
-
BMM
-
UML
Class |
ARCHETYPE |
|
|---|---|---|
Description |
Archetype equivalent to ARCHETYPED class in Common reference model. Defines semantics of identfication, lifecycle, versioning, composition and specialisation. |
|
Inherit |
||
Attributes |
Signature |
Meaning |
1..1 |
definition: |
Root node of the definition of this archetype. |
1..1 |
ontology: |
The ontology of the archetype. |
0..1 |
adl_version: |
ADL version if archetype was read in from an ADL sharable archetype. |
1..1 |
archetype_id: |
Multi-axial identifier of this archetype in archetype space. |
0..1 |
uid: |
OID identifier of this archetype. |
1..1 |
concept: |
The normative meaning of the archetype as a whole, expressed as a local archetype code, typically “at0000”. |
0..1 |
parent_archetype_id: |
Identifier of the specialisation parent of this archetype. |
0..1 |
Invariant statements about this object. Statements are expressed in first order predicate logic, and usually refer to at least two attributes. |
|
Functions |
Signature |
Meaning |
1..1 |
concept_name ( |
The concept name of the archetype in language a_lang; corresponds to the term definition of the concept attribute in the archetype ontology. |
1..1 |
Set of language-independent paths extracted from archetype. Paths obey Xpath-like syntax and are formed from alternations of C_OBJECT.node_id and C_ATTRIBUTE.rm_attribute_name values. |
|
1..1 |
Set of language-dependent paths extracted from archetype. Paths obey the same syntax as physical_paths, but with node_ids replaced by their meanings from the ontology. |
|
1..1 |
specialisation_depth (): |
Specialisation depth of this archetype; larger than 0 if this archetype has a parent. Derived from terminology.specialisation_depth. |
1..1 |
is_specialised (): |
True if this archetype is a specialisation of another. |
1..1 |
is_valid (): |
True if the archetype is valid overall; various tests should be used, including checks on node_ids, internal references, and constraint references. |
1..1 |
node_ids_valid (): |
True if every node_id found on a C_OBJECT node is found in ontology.term_codes. |
0..1 |
previous_version (): |
Version of predecessor archetype of this archetype, if any. |
1..1 |
internal_references_valid (): |
True if every ARCHETYPE_INTERNAL_REF. target_path refers to a legitimate node in the archetype definition. |
1..1 |
constraint_references_valid (): |
True if every CONSTRAINT_REF.reference found on a C_OBJECT node in the archetype definition is found in ontology.constraint_codes. |
1..1 |
short_concept_name (): |
The short concept name of the archetype extracted from the archetype_id. |
1..1 |
version (): |
|
Invariants |
Inv_concept_valid: |
|
Inv_specialisation_validity: |
||
Inv_invariants_valid: |
||
Inv_uid_validity: |
||
Inv_version_validity: |
||
Inv_description_valid: |
||
Inv_original_language_valid: |
||
| ARCHETYPE | |
|---|---|
Archetype equivalent to ARCHETYPED class in Common reference model. Defines semantics of identfication, lifecycle, versioning, composition and specialisation. |
|
Inherits: AUTHORED_RESOURCE |
|
Attributes |
|
uid: |
OID identifier of this archetype. |
original_language: |
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. |
description: |
Description and lifecycle information of the resource. |
is_controlled: |
True if this resource is under any kind of change control (even file copying), in which case revision history is created. |
annotations: |
Annotations on individual items within the resource, keyed by path. The inner table takes the form of a Hash table of String values keyed by String tags. |
translations: |
List of details for each natural translation made of this resource, keyed by language code. For each translation listed here, there must be corresponding sections in all language-dependent parts of the resource. The |
definition: |
Root node of the definition of this archetype. |
ontology: |
The ontology of the archetype. |
adl_version: |
ADL version if archetype was read in from an ADL sharable archetype. |
archetype_id: |
Multi-axial identifier of this archetype in archetype space. |
concept: |
The normative meaning of the archetype as a whole, expressed as a local archetype code, typically “at0000”. |
parent_archetype_id: |
Identifier of the specialisation parent of this archetype. |
Invariant statements about this object. Statements are expressed in first order predicate logic, and usually refer to at least two attributes. |
|
Functions |
|
current_revision (): |
Most recent revision in revision_history if is_controlled else (uncontrolled) . |
Total list of languages available in this resource, derived from original_language and translations. |
|
concept_name ( |
The concept name of the archetype in language a_lang; corresponds to the term definition of the concept attribute in the archetype ontology. |
Set of language-independent paths extracted from archetype. Paths obey Xpath-like syntax and are formed from alternations of C_OBJECT.node_id and C_ATTRIBUTE.rm_attribute_name values. |
|
Set of language-dependent paths extracted from archetype. Paths obey the same syntax as physical_paths, but with node_ids replaced by their meanings from the ontology. |
|
specialisation_depth (): |
Specialisation depth of this archetype; larger than 0 if this archetype has a parent. Derived from terminology.specialisation_depth. |
is_specialised (): |
True if this archetype is a specialisation of another. |
is_valid (): |
True if the archetype is valid overall; various tests should be used, including checks on node_ids, internal references, and constraint references. |
node_ids_valid (): |
True if every node_id found on a C_OBJECT node is found in ontology.term_codes. |
previous_version (): |
Version of predecessor archetype of this archetype, if any. |
internal_references_valid (): |
True if every ARCHETYPE_INTERNAL_REF. target_path refers to a legitimate node in the archetype definition. |
constraint_references_valid (): |
True if every CONSTRAINT_REF.reference found on a C_OBJECT node in the archetype definition is found in ontology.constraint_codes. |
short_concept_name (): |
The short concept name of the archetype extracted from the archetype_id. |
version (): |
|
Invariants |
|
Original_language_valid: |
|
Current_revision_valid: |
|
Translations_valid: |
|
Description_valid: |
|
Languages_available_valid: |
|
Revision_history_valid: |
|
Inv_concept_valid: |
|
Inv_specialisation_validity: |
|
Inv_invariants_valid: |
|
Inv_uid_validity: |
|
Inv_version_validity: |
|
Inv_description_valid: |
|
Inv_original_language_valid: |
|
{
"name": "ARCHETYPE",
"documentation": "Archetype equivalent to ARCHETYPED class in Common reference model. Defines semantics of identfication, lifecycle, versioning, composition and specialisation.",
"ancestors": [
"AUTHORED_RESOURCE"
],
"properties": {
"definition": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "definition",
"documentation": "Root node of the definition of this archetype.",
"is_mandatory": true,
"type": "C_COMPLEX_OBJECT"
},
"ontology": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "ontology",
"documentation": "The ontology of the archetype.",
"is_mandatory": true,
"type": "ARCHETYPE_ONTOLOGY"
},
"adl_version": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "adl_version",
"documentation": "ADL version if archetype was read in from an ADL sharable archetype.",
"type": "String"
},
"archetype_id": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "archetype_id",
"documentation": "Multi-axial identifier of this archetype in archetype space.",
"is_mandatory": true,
"type": "ARCHETYPE_ID"
},
"uid": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "uid",
"documentation": "OID identifier of this archetype.",
"type": "HIER_OBJECT_ID"
},
"concept": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "concept",
"documentation": "The normative meaning of the archetype as a whole, expressed as a local archetype code, typically “at0000”.",
"is_mandatory": true,
"type": "String"
},
"parent_archetype_id": {
"_type": "P_BMM_SINGLE_PROPERTY",
"name": "parent_archetype_id",
"documentation": "Identifier of the specialisation parent of this archetype.",
"type": "ARCHETYPE_ID"
},
"invariants": {
"_type": "P_BMM_CONTAINER_PROPERTY",
"name": "invariants",
"documentation": "Invariant statements about this object. Statements are expressed in first order predicate logic, and usually refer to at least two attributes.",
"type_def": {
"container_type": "List",
"type": "ASSERTION"
},
"cardinality": {
"lower": 0,
"upper_unbounded": true
}
}
},
"functions": {
"concept_name": {
"name": "concept_name",
"documentation": "The concept name of the archetype in language a_lang; corresponds to the term definition of the concept attribute in the archetype ontology.",
"parameters": {
"a_lang": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "a_lang",
"type": "String"
}
},
"post_conditions": {
"post-condition": "Result.is_equal (definition.node_id)"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "String"
}
},
"physical_paths": {
"name": "physical_paths",
"documentation": "Set of language-independent paths extracted from archetype. Paths obey Xpath-like syntax and are formed from alternations of C_OBJECT.node_id and C_ATTRIBUTE.rm_attribute_name values. ",
"result": {
"_type": "P_BMM_CONTAINER_TYPE",
"container_type": "List",
"type": "String"
}
},
"logical_paths": {
"name": "logical_paths",
"documentation": "Set of language-dependent paths extracted from archetype. Paths obey the same syntax as physical_paths, but with node_ids replaced by their meanings from the ontology. ",
"parameters": {
"lang": {
"_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
"name": "lang",
"type": "String"
}
},
"result": {
"_type": "P_BMM_CONTAINER_TYPE",
"container_type": "List",
"type": "String"
}
},
"specialisation_depth": {
"name": "specialisation_depth",
"documentation": "Specialisation depth of this archetype; larger than 0 if this archetype has a parent. Derived from terminology.specialisation_depth.",
"post_conditions": {
"post-condition": "Result = terminology.specialisation_depth"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Integer"
}
},
"is_specialised": {
"name": "is_specialised",
"documentation": "True if this archetype is a specialisation of another. ",
"post_conditions": {
"post-condition": "Result implies parent_archetype_id /= Void"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"is_valid": {
"name": "is_valid",
"documentation": "True if the archetype is valid overall; various tests should be used, including checks on node_ids, internal references, and constraint references.",
"post_conditions": {
"Post": "not (node_ids_valid and internal_references_valid and constraint_references_valid) implies not Result"
},
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"node_ids_valid": {
"name": "node_ids_valid",
"documentation": "True if every node_id found on a C_OBJECT node is found in ontology.term_codes.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"previous_version": {
"name": "previous_version",
"documentation": "Version of predecessor archetype of this archetype, if any.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "String"
},
"is_nullable": true
},
"internal_references_valid": {
"name": "internal_references_valid",
"documentation": "True if every ARCHETYPE_INTERNAL_REF. target_path refers to a legitimate node in the archetype definition.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"constraint_references_valid": {
"name": "constraint_references_valid",
"documentation": "True if every CONSTRAINT_REF.reference found on a C_OBJECT node in the archetype definition is found in ontology.constraint_codes.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "Boolean"
}
},
"short_concept_name": {
"name": "short_concept_name",
"documentation": "The short concept name of the archetype extracted from the archetype_id.",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "String"
}
},
"version": {
"name": "version",
"result": {
"_type": "P_BMM_SIMPLE_TYPE",
"type": "String"
}
}
},
"invariants": {
"Inv_concept_valid": "ontology.has_term_code (concept_code)",
"Inv_specialisation_validity": "is_specialised implies specialisation_depth > 0",
"Inv_invariants_valid": "invariants /= Void implies not invariants.is_empty",
"Inv_uid_validity": "uid /= Void implies not uid.is_empty",
"Inv_version_validity": "version /= Void and then version.is_equal(archetype_id.version_id)",
"Inv_description_valid": "description /= Void",
"Inv_original_language_valid": "original_language /= void and then language /= Void"
}
}