Class Definitions

ARCHETYPE_CONSTRAINT Class

  • Definition

  • Effective

  • BMM

  • UML

Class

ARCHETYPE_CONSTRAINT (abstract)

Description

Abstract parent of all constraint model types. Defines conformance and congruence function signatures.

Inherit

ADL_CODE_DEFINITIONS

Attributes

Signature

Meaning

0..1

parent: ARCHETYPE_CONSTRAINT

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

0..1

soc_parent: C_SECOND_ORDER

Functions

Signature

Meaning

1..1
(abstract)

is_prohibited (): Boolean

True if this node is prohibited. Implemented in subtypes.

1..1

has_path (
a_path: String[1]
): Boolean

True if the relative path a_path exists at this node.

1..1

path (): String

Path of this node relative to root of archetype.

1..1
(abstract)

c_conforms_to (
other: ARCHETYPE_CONSTRAINT[1],
rmcc: FUNCTION<>[1]
): Boolean

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

RM conformance checker - a lambda (i.e. function object) that can compute conformance of type-names within the Reference Model on which the current archetype is based. The signature provides two arguments representing respectively, the rm_type_name of the current node and the rm_type_name of the node being redefined in a specialisation parent archetype.

1..1
(abstract)

c_congruent_to (
other: ARCHETYPE_CONSTRAINT[1]
): Boolean

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

1..1

is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained)

True if there is a second order constraint such as a tuple constraint on this node.

1..1

is_root (): Boolean

True if this node is the root of the tree.

1..1

is_leaf (): Boolean

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

Invariants

Post: Result = soc_parent /= Void or parent.soc_parent /= Void

ARCHETYPE_CONSTRAINT (abstract)

Abstract parent of all constraint model types. Defines conformance and congruence function signatures.

Inherits: ADL_CODE_DEFINITIONS

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

soc_parent: C_SECOND_ORDER [0..1]

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

(abstract) is_prohibited (): Boolean [1..1]

True if this node is prohibited. Implemented in subtypes.

has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

path (): String [1..1]

Path of this node relative to root of archetype.

(abstract) c_conforms_to (
other: ARCHETYPE_CONSTRAINT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

RM conformance checker - a lambda (i.e. function object) that can compute conformance of type-names within the Reference Model on which the current archetype is based. The signature provides two arguments representing respectively, the rm_type_name of the current node and the rm_type_name of the node being redefined in a specialisation parent archetype.

(abstract) c_congruent_to (
other: ARCHETYPE_CONSTRAINT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

is_root (): Boolean [1..1]

True if this node is the root of the tree.

is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

Invariants

Post: Result = soc_parent /= Void or parent.soc_parent /= Void

{
    "name": "ARCHETYPE_CONSTRAINT",
    "documentation": "Abstract parent of all constraint model types. Defines conformance and congruence function signatures. ",
    "is_abstract": true,
    "ancestors": [
        "ADL_CODE_DEFINITIONS"
    ],
    "properties": {
        "parent": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "parent",
            "documentation": "Parent node, except in the case of the top of a tree, i.e. root `C_COMPLEX_OBJECT` of an archetype definition.",
            "type": "ARCHETYPE_CONSTRAINT"
        },
        "soc_parent": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "soc_parent",
            "type": "C_SECOND_ORDER"
        }
    },
    "functions": {
        "is_prohibited": {
            "name": "is_prohibited",
            "documentation": "True if this node is prohibited. Implemented in subtypes.",
            "is_abstract": true,
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "has_path": {
            "name": "has_path",
            "documentation": "True if the relative path `_a_path_` exists at this node.",
            "parameters": {
                "a_path": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_path",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "path": {
            "name": "path",
            "documentation": "Path of this node relative to root of archetype.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "String"
            }
        },
        "c_conforms_to": {
            "name": "c_conforms_to",
            "documentation": "True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. \nTypically used during validation of specialised archetype nodes.",
            "is_abstract": true,
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "ARCHETYPE_CONSTRAINT"
                },
                "rmcc": {
                    "_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
                    "name": "rmcc",
                    "documentation": "RM conformance checker - a lambda (i.e. function object) that can compute conformance of type-names within the  Reference Model on which the current archetype is based. The signature provides two arguments representing respectively, the `_rm_type_name_` of the current node and the `_rm_type_name_` of the node being redefined in a specialisation parent archetype.",
                    "type_def": {
                        "root_type": "FUNCTION"
                    }
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_congruent_to": {
            "name": "c_congruent_to",
            "documentation": "True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of `_node_id_` redefinition in `C_OBJECT` nodes. \n\nTypically used to test if an inherited node locally contains any constraints.",
            "is_abstract": true,
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "ARCHETYPE_CONSTRAINT"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "is_second_order_constrained": {
            "name": "is_second_order_constrained",
            "documentation": "True if there is a second order constraint such as a tuple constraint on this node.",
            "post_conditions": {
                "Post": "soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained)"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "is_root": {
            "name": "is_root",
            "documentation": "True if this node is the root of the tree.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "is_leaf": {
            "name": "is_leaf",
            "documentation": "True if this node is a terminal node in the tree structure, i.e. having no child nodes.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    },
    "invariants": {
        "Post": "Result = soc_parent /= Void or parent.soc_parent /= Void"
    }
}
ARCHETYPE_CONSTRAINT

C_ATTRIBUTE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_ATTRIBUTE

Description

Abstract model of constraint on any kind of attribute in a class model.

Inherit

ARCHETYPE_CONSTRAINT

Attributes

Signature

Meaning

1..1

rm_attribute_name: String

Reference model attribute within the enclosing type represented by a C_OBJECT.

0..1

existence: Multiplicity_interval

Constraint settable on every attribute, regardless of whether it is singular or of a container type, which indicates whether its target object exists or not (i.e. is mandatory or not). Only set if it overrides the underlying reference model or parent archetype in the case of specialised archetypes.

0..1

children: List<C_OBJECT>

Child C_OBJECT nodes. Each such node represents a constraint on the type of this attribute in its reference model. Multiples occur both for multiple items in the case of container attributes, and alternatives in the case of singular attributes.

0..1

differential_path: String

Path to the parent object of this attribute (i.e. doesn’t include the name of this attribute). Used only for attributes in differential form, specialised archetypes. Enables only the re-defined parts of a specialised archetype to be expressed, at the path where they occur.

0..1

cardinality: Cardinality

Cardinality constraint of attribute, if a container attribute.

1..1

is_multiple: Boolean

Flag indicating whether this attribute constraint is on a container (i.e. multiply-valued) attribute.

Functions

Signature

Meaning

1..1

any_allowed (): Boolean

Post: Result := children.is_empty and not is_prohibited

True if there is no effective constraint on the children of the RM attribute to which this C_ATTRIBUTE refers.

1..1

is_mandatory (): Boolean

Post: Result = existence /= Void and then existence.is_mandatory

True if this C_ATTRIBUTE has an existence constraint of 1..1, i.e. mandation.

1..1

rm_attribute_path (): String

Path of this attribute with respect to owning C_OBJECT, including differential path where applicable.

1..1

is_single (): Boolean

True if this node logically represents a single-valued attribute. Evaluated as not is_multiple.

1..1
(effected)

c_congruent_to (
other: ARCHETYPE_CONSTRAINT[1]
): Boolean

Post: Result = existence = Void and is_single and other.is_single) or (is_multiple and other.is_multiple and cardinality = Void

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

1..1
(effected)

c_conforms_to (
other: ARCHETYPE_CONSTRAINT[1],
rmcc: FUNCTION<>[1]
): Boolean

Post: Result = existence_conforms_to (other) and is_single and other.is_single) or else (is_multiple and cardinality_conforms_to (other)

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

1..1
(effected)

is_prohibited (): Boolean

Post: Result = existence /= Void and then existence.is_prohibited

True if this C_ATTRIBUTE has an existence constraint of 0..0, i.e. prohibition.

C_ATTRIBUTE

Abstract model of constraint on any kind of attribute in a class model.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

rm_attribute_name: String [1..1]

Reference model attribute within the enclosing type represented by a C_OBJECT.

existence: Multiplicity_interval [0..1]

Constraint settable on every attribute, regardless of whether it is singular or of a container type, which indicates whether its target object exists or not (i.e. is mandatory or not). Only set if it overrides the underlying reference model or parent archetype in the case of specialised archetypes.

children: List<C_OBJECT> [0..1]

Child C_OBJECT nodes. Each such node represents a constraint on the type of this attribute in its reference model. Multiples occur both for multiple items in the case of container attributes, and alternatives in the case of singular attributes.

differential_path: String [0..1]

Path to the parent object of this attribute (i.e. doesn’t include the name of this attribute). Used only for attributes in differential form, specialised archetypes. Enables only the re-defined parts of a specialised archetype to be expressed, at the path where they occur.

cardinality: Cardinality [0..1]

Cardinality constraint of attribute, if a container attribute.

is_multiple: Boolean [1..1]

Flag indicating whether this attribute constraint is on a container (i.e. multiply-valued) attribute.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

is_prohibited (): Boolean

Post: Result = existence /= Void and then existence.is_prohibited [1..1]

True if this C_ATTRIBUTE has an existence constraint of 0..0, i.e. prohibition.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

c_conforms_to (
other: ARCHETYPE_CONSTRAINT[1],
rmcc: FUNCTION<>[1]
): Boolean

Post: Result = existence_conforms_to (other) and is_single and other.is_single) or else (is_multiple and cardinality_conforms_to (other) [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

c_congruent_to (
other: ARCHETYPE_CONSTRAINT[1]
): Boolean

Post: Result = existence = Void and is_single and other.is_single) or (is_multiple and other.is_multiple and cardinality = Void [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

any_allowed (): Boolean

Post: Result := children.is_empty and not is_prohibited [1..1]

True if there is no effective constraint on the children of the RM attribute to which this C_ATTRIBUTE refers.

is_mandatory (): Boolean

Post: Result = existence /= Void and then existence.is_mandatory [1..1]

True if this C_ATTRIBUTE has an existence constraint of 1..1, i.e. mandation.

rm_attribute_path (): String [1..1]

Path of this attribute with respect to owning C_OBJECT, including differential path where applicable.

is_single (): Boolean [1..1]

True if this node logically represents a single-valued attribute. Evaluated as not is_multiple.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

{
    "name": "C_ATTRIBUTE",
    "documentation": "Abstract model of constraint on any kind of attribute in a class model.",
    "ancestors": [
        "ARCHETYPE_CONSTRAINT"
    ],
    "properties": {
        "rm_attribute_name": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "rm_attribute_name",
            "documentation": "Reference model attribute within the enclosing type represented by a `C_OBJECT`.",
            "is_mandatory": true,
            "type": "String"
        },
        "existence": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "existence",
            "documentation": "Constraint settable on every attribute, regardless of whether it is singular or of a container type, which indicates whether its target object exists or not (i.e. is mandatory or not). Only set if it overrides the underlying reference model or parent archetype in the case of specialised archetypes.",
            "type": "Multiplicity_interval"
        },
        "children": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "children",
            "documentation": "Child `C_OBJECT` nodes. Each such node represents a constraint on the type of this attribute in its reference model. Multiples occur both for multiple items in the case of container attributes, and alternatives in the case of singular attributes. ",
            "type_def": {
                "container_type": "List",
                "type": "C_OBJECT"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "differential_path": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "differential_path",
            "documentation": "Path to the parent object of this attribute (i.e. doesn’t include the name of this attribute). Used only for attributes in differential form, specialised archetypes. Enables only the re-defined parts of a specialised archetype to be expressed, at the path where they occur.",
            "type": "String"
        },
        "cardinality": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "cardinality",
            "documentation": "Cardinality constraint of attribute, if a container attribute.",
            "type": "Cardinality"
        },
        "is_multiple": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "is_multiple",
            "documentation": "Flag indicating whether this attribute constraint is on a container (i.e. multiply-valued) attribute.",
            "is_mandatory": true,
            "type": "Boolean"
        }
    },
    "functions": {
        "any_allowed": {
            "name": "any_allowed",
            "documentation": "True if there is no effective constraint on the children of the RM attribute to which this `C_ATTRIBUTE` refers.",
            "post_conditions": {
                "Post": "Result := children.is_empty and not is_prohibited"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "is_mandatory": {
            "name": "is_mandatory",
            "documentation": "True if this `C_ATTRIBUTE` has an existence constraint of 1..1, i.e. mandation.",
            "post_conditions": {
                "Post": "Result = existence /= Void and then existence.is_mandatory"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "rm_attribute_path": {
            "name": "rm_attribute_path",
            "documentation": "Path of this attribute with respect to owning `C_OBJECT`, including differential path where applicable.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "String"
            }
        },
        "is_single": {
            "name": "is_single",
            "documentation": "True if this node logically represents a single-valued attribute. Evaluated as not `_is_multiple_`.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_congruent_to": {
            "name": "c_congruent_to",
            "documentation": "True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of `_node_id_` redefinition in `C_OBJECT` nodes. \n\nTypically used to test if an inherited node locally contains any constraints.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "ARCHETYPE_CONSTRAINT"
                }
            },
            "post_conditions": {
                "Post": "Result = existence = Void and ((is_single and other.is_single) or (is_multiple and other.is_multiple and cardinality = Void))"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_conforms_to": {
            "name": "c_conforms_to",
            "documentation": "True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. \nTypically used during validation of specialised archetype nodes.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "ARCHETYPE_CONSTRAINT"
                },
                "rmcc": {
                    "_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
                    "name": "rmcc",
                    "type_def": {
                        "root_type": "FUNCTION"
                    }
                }
            },
            "post_conditions": {
                "Post": "Result = existence_conforms_to (other) and ((is_single and other.is_single) or else (is_multiple and cardinality_conforms_to (other)))"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "is_prohibited": {
            "name": "is_prohibited",
            "documentation": "True if this `C_ATTRIBUTE` has an existence constraint of `0..0`, i.e. prohibition.",
            "post_conditions": {
                "Post": "Result = existence /= Void and then existence.is_prohibited"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_ATTRIBUTE

Conformance Semantics: C_ATTRIBUTE

The following functions formally define the conformance interfaces of any ARCHETYPE_CONSTRAINT node in a specialised archetype to the corresponding node in a parent archetype, where 'corresponding' means a node found at the same or a congruent path.

c_conforms_to (other: ARCHETYPE_CONSTRAINT; rmcc: FUNCTION<<a_type, other_type: String>, Boolean>): Boolean
        -- True if this node on its own (ignoring any subparts) expresses the same or narrower
        -- constraints as `other`.
        -- Returns False if any of the following is incompatible:
        --	 * cardinality
        --	 * existence
    require
        other /= Void
        rmcc /= Void
    deferred
    end

c_congruent_to (other: ARCHETYPE_CONSTRAINT): Boolean
        -- True if this node on its own (ignoring any subparts) expresses no additional
        -- constraints than `other`.
    require
        other /= Void
    deferred
    end

The following effected functions defined in C_ATTRIBUTE define the conformance of an attribute node in a specialised archetype to the corresponding node in a parent archetype, where 'corresponding' means a node found at the same or a congruent path.

c_conforms_to (other: C_ATTRIBUTE; rmcc: FUNCTION<<a_type, other_type: String>, Boolean>): Boolean
        -- True if this node on its own (ignoring any subparts) expresses the same or narrower
        -- constraints as `other'.
        -- Returns False if any of the following is incompatible:
        --	 * cardinality
        --	 * existence
    do
        Result := existence_conforms_to (other) and
            ((is_single and other.is_single) or else
            (is_multiple and cardinality_conforms_to (other)))
    end

c_congruent_to (other: C_ATTRIBUTE): Boolean
		-- True if this node on its own (ignoring any subparts) expresses no additional
        -- constraints than `other'.
    do
        Result := existence = Void and ((is_single and other.is_single) or
                (is_multiple and other.is_multiple and cardinality = Void))
    end

existence_conforms_to (other: C_ATTRIBUTE): Boolean
		-- True if the existence of this node conforms to other.existence
    require
        other /= Void
    do
        if existence /= Void and other.existence /= Void then
            Result := other.existence.contains (existence)
        else
            Result := True
        end
    end

cardinality_conforms_to (other: C_ATTRIBUTE): Boolean
		-- True if the cardinality of this node conforms to other.cardinality, if it exists
    require
        other /= Void
    do
        if cardinality /= Void and other.cardinality /= Void then
            Result := other.cardinality.contains (cardinality)
        else
            Result := True
        end
    end

collective_occurrences_of (parent_object: C_OBJECT;
            rm_prop_mult: FUNCTION <<rm_type_name, rm_property_path: String>, Multiplicity_interval>): Multiplicity_interval
        -- compute collective occurrences according to VSONCO, of all object nodes under this
        -- attribute node that redefine `parent_object`, which is assumed to be an object node
        -- within `other`, the specialisation parent of this C_ATTRIBUTE
    require
        parent_object /= Void
        other.is_multiple
    do
        -- make a 0..0 interval
        create Result.make_prohibited

        children.do_all (
            agent (child_co, parent_co: C_OBJECT;
                    rm_prop_mult: FUNCTION <<rm_type_name, rm_property_path: String>, Multiplicity_interval>;
                    interval: Multiplicity_interval)
                local
                    child_occ: Multiplicity_interval
                do
                    if child_co.node_id_conforms_to (parent_co) then
                        -- child object node may have no occurrences
                        child_occ := child_obj.effective_occurrences (rm_prop_mult)

                        interval.set_lower (interval.lower + child_occ.lower)
                        if child_occ.upper_unbounded then
                            interval.set_upper_unbounded
                        elseif not interval.upper_unbounded then
                            interval.set_upper (interval.upper + child_occ.upper)
                        end
                    end
                end (?, a_parent_co, rm_prop_mult, Result)
        )

        if cardinality /= Void and then not cardinality.upper_unbounded then
            Result.set_upper (if Result.upper_unbounded then cardinality.upper else Result.upper.min (cardinality.upper) end)
        end
    end

Validity Rules: C_ATTRIBUTE

The validity rules are as follows:

VCARM: attribute name reference model validity: an attribute name introducing an attribute constraint block must be defined in the underlying information model as an attribute (stored or computed) of the type which introduces the enclosing object block.

VCAEX: archetype attribute reference model existence conformance: the existence of an attribute, if set, must conform, i.e. be the same or narrower, to the existence of the corresponding attribute in the underlying information model.

VCAM: archetype attribute reference model multiplicity conformance: the multiplicity, i.e. whether an attribute is multiply- or single-valued, of an attribute must conform to that of the corresponding attribute in the underlying information model.

VDIFV: archetype attribute differential path validity: an archetype may only have a differential path if it is specialised..

The following validity rule applies to redefinition in a specialised archetype:

VDIFP: specialised archetype attribute differential path validity: if an attribute constraint has a differential path, the path must exist in the flat parent, and also be valid with respect to the reference model, i.e. in the sense that it corresponds to a legal potential construction of objects.

VSANCE: specialised archetype attribute node existence conformance: the existence of a redefined attribute node in a specialised archetype, if stated, must conform to the existence of the corresponding node in the flat parent archetype, by having an identical range, or a range wholly contained by the latter.

VSAM: specialised archetype attribute multiplicity conformance: the multiplicity, i.e. whether an attribute is multiply- or single-valued, of a redefined attribute must conform to that of the corresponding attribute in the parent archetype.

The following validity rules apply to single-valued attributes, i.e when C_ATTRIBUTE.is_multiple is False:

VACSO: single-valued attribute child object occurrences validity: the occurrences of a child object of a single-valued attribute cannot have an upper limit greater than 1.

The following validity rules apply to container attributes, i.e when C_ATTRIBUTE.is_multiple is True:

VACMCU: cardinality/occurrences upper bound validity: where a cardinality with a finite upper bound is stated on an attribute, for all immediate child objects for which an occurrences constraint is stated, the occurrences must either have an open upper bound (i.e. n..*) which is interpreted as the maximum value allowed within the cardinality, or else a finite upper bound which is <= the cardinality upper bound.

VACMCO: cardinality/occurrences orphans: it must be possible for at least one instance of one optional child object (i.e. an object for which the occurrences lower bound is 0) and one instance of every mandatory child object (i.e. object constraints for which the occurrences lower bound is >= 1) to be included within the cardinality range.

VCACA: archetype attribute reference model cardinality conformance: the cardinality of an attribute must conform, i.e. be the same or narrower, to the cardinality of the corresponding attribute in the underlying information model.

The following validity warnings apply to container attributes, i.e when C_ATTRIBUTE.is_multiple is True:

WACMCL: cardinality/occurrences lower bound validity: where a cardinality with a finite upper bound is stated on an attribute, for all immediate child objects for which an occurrences constraint is stated, the sum of occurrences lower bounds should be lower than the cardinality upper limit.

The following validity rule applies to cardinality redefinition in a specialised archetype:

VSANCC: specialised archetype attribute node cardinality conformance: the cardinality of a redefined (multiply-valued) attribute node in a specialised archetype, if stated, must conform to the cardinality of the corresponding node in the flat parent archetype by either being identical, or being wholly contained by the latter.

C_OBJECT Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_OBJECT (abstract)

Description

Abstract model of constraint on any kind of object node.

Inherit

ARCHETYPE_CONSTRAINT

Attributes

Signature

Meaning

1..1

rm_type_name: String

Reference model type that this node corresponds to.

0..1

occurrences: Multiplicity_interval

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

1..1

node_id: String

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

0..1

is_deprecated: Boolean

True if this node and by implication all sub-nodes are deprecated for use.

0..1

sibling_order: SIBLING_ORDER

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

Functions

Signature

Meaning

1..1

specialisation_depth (): Integer

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

1..1

effective_occurrences (): Multiplicity_interval

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

1..1
(redefined)

c_conforms_to (
other: C_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker agent (lambda).

1..1
(redefined)

c_congruent_to (
other: ARCHETYPE_CONSTRAINT[1]
): Boolean

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

1..1

occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

1..1

node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id)

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

1..1
(redefined)

is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

C_OBJECT (abstract)

Abstract model of constraint on any kind of object node.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

rm_type_name: String [1..1]

Reference model type that this node corresponds to.

occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

c_conforms_to (
other: C_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker agent (lambda).

c_congruent_to (
other: ARCHETYPE_CONSTRAINT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

{
    "name": "C_OBJECT",
    "documentation": "Abstract model of constraint on any kind of object node. ",
    "is_abstract": true,
    "ancestors": [
        "ARCHETYPE_CONSTRAINT"
    ],
    "properties": {
        "rm_type_name": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "rm_type_name",
            "documentation": "Reference model type that this node corresponds to. ",
            "is_mandatory": true,
            "type": "String"
        },
        "occurrences": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "occurrences",
            "documentation": "Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1.\nOnly set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.",
            "type": "Multiplicity_interval"
        },
        "node_id": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "node_id",
            "documentation": "Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a `_node_id_`; for nodes under a container `C_ATTRIBUTE`, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.\n\nFor `C_PRIMITIVE_OBJECTs` represented in ADL inline form, this attribute will have the special value `Primitive_node_id`; otherwise it will have the node id read during parsing.",
            "is_mandatory": true,
            "type": "String"
        },
        "is_deprecated": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "is_deprecated",
            "documentation": "True if this node and by implication all sub-nodes are deprecated for use.",
            "type": "Boolean"
        },
        "sibling_order": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "sibling_order",
            "documentation": "Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a `C_OBJECT` within a `C_ATTRIBUTE` with `_is_multiple_ = True`.",
            "type": "SIBLING_ORDER"
        }
    },
    "functions": {
        "specialisation_depth": {
            "name": "specialisation_depth",
            "documentation": "Level of specialisation of this archetype node, based on its `_node_id_`. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If `_node_id_` is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent `C_OBJECT` node having a node_id.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Integer"
            }
        },
        "effective_occurrences": {
            "name": "effective_occurrences",
            "documentation": "Compute effective occurrences, where no local occurrences constraint set. If the owning `C_ATTRIBUTE._cardinality_` is set, use its upper value, else use RM multiplicity of the owning attribute.\n\nIf local `occurrences` not set, always assume 0 as the lower bound.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Multiplicity_interval"
            }
        },
        "c_conforms_to": {
            "name": "c_conforms_to",
            "documentation": "True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. \nTypically used during validation of specialised archetype nodes.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_OBJECT"
                },
                "rmcc": {
                    "_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
                    "name": "rmcc",
                    "documentation": "Reference Model conformance checker agent (lambda).",
                    "type_def": {
                        "root_type": "FUNCTION"
                    }
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_congruent_to": {
            "name": "c_congruent_to",
            "documentation": "True if constraints represented by this node contain no further redefinitions with respect to the node `_other_`, with the exception of `_node_id_` redefinition in `C_OBJECT` nodes. \n\nTypically used to test if an inherited node locally contains any constraints.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "ARCHETYPE_CONSTRAINT"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "occurrences_conforms_to": {
            "name": "occurrences_conforms_to",
            "documentation": "True if this node `_occurrences_` conforms to `_other.occurrences_`; `other` is assumed to be in a flat archetype.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "documentation": "`C_OBJECT` from a flat parent archetype.",
                    "type": "C_OBJECT"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "node_id_conforms_to": {
            "name": "node_id_conforms_to",
            "documentation": "True if this node id conforms to `_other.node_id_`, which includes the ids being identical; `_other_` is assumed to be in a flat archetype.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_OBJECT"
                }
            },
            "post_conditions": {
                "Post": "Result = codes_conformant (node_id, other.node_id)"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "is_prohibited": {
            "name": "is_prohibited",
            "documentation": "True if this `C_OBJECT` node is prohibited, i.e. if its `_occurrences_` is `0..0`.",
            "post_conditions": {
                "Post": "Result = occurrences /= Void and then occurrences.is_prohibited"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_OBJECT

SIBLING_ORDER Class

  • Definition

  • Effective

  • BMM

  • UML

Class

SIBLING_ORDER

Description

Defines the order indicator that can be used on a C_OBJECT within a container attribute in a specialised archetype to indicate its order with respect to a sibling defined in a higher specialisation level.

Misuse: This type cannot be used on a C_OBJECT other than one within a container attribute in a specialised archetype.

Attributes

Signature

Meaning

1..1

is_before: Boolean

True if the order relationship is ‘before’, if False, it is ‘after’.

1..1

sibling_node_id: String

Node identifier of sibling before or after which this node should come.

Functions

Signature

Meaning

1..1

is_after (): Boolean

True if the order relationship is after, computed as the negation of is_before.

SIBLING_ORDER

Defines the order indicator that can be used on a C_OBJECT within a container attribute in a specialised archetype to indicate its order with respect to a sibling defined in a higher specialisation level.

Misuse: This type cannot be used on a C_OBJECT other than one within a container attribute in a specialised archetype.

Attributes

is_before: Boolean [1..1]

True if the order relationship is ‘before’, if False, it is ‘after’.

sibling_node_id: String [1..1]

Node identifier of sibling before or after which this node should come.

Functions

is_after (): Boolean [1..1]

True if the order relationship is after, computed as the negation of is_before.

{
    "name": "SIBLING_ORDER",
    "documentation": "Defines the order indicator that can be used on a `C_OBJECT` within a container attribute in a specialised archetype to indicate its order with respect to a sibling defined in a higher specialisation level.\n\nMisuse: This type cannot be used on a `C_OBJECT` other than one within a container attribute in a specialised archetype.",
    "properties": {
        "is_before": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "is_before",
            "documentation": "True if the order relationship is ‘before’, if False, it is ‘after’.",
            "is_mandatory": true,
            "type": "Boolean"
        },
        "sibling_node_id": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "sibling_node_id",
            "documentation": "Node identifier of sibling before or after which this node should come.",
            "is_mandatory": true,
            "type": "String"
        }
    },
    "functions": {
        "is_after": {
            "name": "is_after",
            "documentation": "True if the order relationship is `_after_`, computed as the negation of `_is_before_`.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
SIBLING_ORDER

Occurrences inferencing rules

The notion of 'occurrences' does not exist in an object model that might be used as the reference model on which archetypes are based, because it is a class model. However, archetypes commonly constrain the occurrences of object nodes under a container attribute, indicating how many objects conforming to a specific object constraint node might exist.

There are various circumstances where it is useful to know the effective occurrences of an archetype object node. One is in validation, in order to determine validity of occurrences constraints; another is in archetype editor tools. Similarly, in an Operational Template, an occurrences constraint is required on all child object nodes of container attributes. Most such constraints come from the source template(s) and archetypes, but often there will be nodes with no occurrences set. In these cases, the occurrences constraint is inferred from the archetype and the reference model according to the following algorithm, where c_object represents any object node in an archetype.

effective_occurrences (rm_prop_mult: FUNCTION <<rm_type_name, rm_property_path: String>, Multiplicity_interval>): Multiplicity_interval
        -- Compute effective occurrences, where no local occurrences constraint set. If the owning
        -- `C_ATTRIBUTE._cardinality_` is set, use its upper value, else use RM multiplicity of the
        -- owning attribute.
        -- `rm_attr_prop_mult` is a function that knows how to compute effective object multiplicity
        -- by looking at the owning RM property.
        -- If local `occurrences` not set, always assume 0 as the lower bound.
    do
        if occurrences /= Void then
            Result := occurrences

        elseif parent /= Void then
            if parent.cardinality /= Void then
                if parent.cardinality.interval.upper_unbounded then
                    create Result.make_open
                else
                    create Result.make_bounded (0, parent.cardinality.interval.upper)
                end
            elseif parent.parent /= Void then
                Result := rm_prop_mult (parent.parent.rm_type_name, parent.parent.rm_attribute_path)
                Result.set_lower (0)
            else
                create Result.make_open
            end
        else
            create Result.make_open
        end
    end

In the above, rm_prop_mult is a reference to a function within an RM schema representation, which has the following logic:

object_multiplicity (rm_type_name, rm_property_path: String): Multiplicity_interval
        -- compute the effective object multiplicity of objects at rm_property_path within type rm_type_name
        -- from the Reference Model
    require
        rm_type_name /= Void
        rm_property_path /= Void
    do
        rm_property_def := get_rm_property_def (rm_type_name, rm_property_path)
        if rm_property_def.is_container then
            if rm_property_def.cardinality.upper_unbounded then
                create Result.make_upper_unbounded (0)
            else
                create Result.make_bounded (0, rm_property_def.cardinality.upper)
            end
        else
            Result := rm_property_def.existence
        end
    end

How this is concretely implemented depends on the modelling environment. One possible RM model implementation is described in the openEHR Basic meta-model (BMM) specification.

Conformance Semantics: C_OBJECT

The following functions, which implement the precursors from ARCHETYPE_CONSTRAINT formally define the conformance of a C_OBJECT node in a specialised archetype to the corresponding node in a parent archetype, where 'corresponding' means a node found at the same or a congruent path. Note that the pre-conditions from the precursors are understood as inherited.

c_conforms_to (other: C_OBJECT; rmcc: FUNCTION<<a_type, other_type: String>, Boolean>): Boolean
        -- True if this node on its own (ignoring any subparts) expresses strictly narrower constraints
        -- as `other'.
        -- `other' is typically from the flat parent archetype.
        -- `rmcc' is an agent (lambda) that can test an RM type's conformance to another RM type
        -- Returns True when the following is True:
        --  * rm_type_name is the same or a subtype of rm_type_name of other;
        --  * node_id is the same, or redefined to a legal code at the level of the owning archetype
        --  * is_root or else
        --    parent.is_multiple or else -- we do the real check from the parent C_ATTRIBUTE
        --    parent.is_single and
        --    occurrences is same (= Void) or a sub-interval
        --
    do
        Result := node_id_conforms_to (other) and
            (rm_type_name.is_case_insensitive_equal (other.rm_type_name) or else
            rmcc (rm_type_name, other.rm_type_name)) and
            (is_root or else parent.is_multiple or else parent.is_single and occurrences_conforms_to (other))
    end

c_congruent_to (other: C_OBJECT): Boolean
        -- True if this node on its own (ignoring any subparts) expresses no constraints in addition
        -- to `other', other than possible redefinition of the node id, which doesn't matter, since
        -- this won't get lost in a compressed path.
        -- Current and `other' are typically from flat archetypes being compared to generate a diff.
        -- Used to determine if path segments can be compressed.
        -- Returns True if:
        --	 * rm_type_name is identical
        --	 * occurrences is Void or else identical to other.occurrences
        -- 	 * sibling_order is Void or else identical to other.sibling_order
        --	 * node_id is identical or else is the only child that overlays the parent node
    do
        Result := rm_type_name.is_case_insensitive_equal (other.rm_type_name) and
            (occurrences = Void or else (other.occurrences /= Void and then
                occurrences.is_equal (other.occurrences))) and
            (sibling_order = Void or else (other.sibling_order /= Void and then
                sibling_order.is_equal (other.sibling_order))) and
            node_reuse_congruent (other)
    end

occurrences_conforms_to (other: C_OBJECT): Boolean
        -- True if this node's occurrences conforms to other.occurrences;
        -- `other' is assumed to be in a flat archetype.
        -- only redefinitions of single-occurrence nodes can be dealt with here;
        -- redefinitions of multiply-occurrences nodes
        -- must be evaluated at the owning attribute, according to VSONCO.
    do
        if occurrences /= Void and other.occurrences.upper = 1 then
            Result := other.occurrences.contains (occurrences)
        else
            Result := True
        end
    end

node_id_conforms_to (other: C_OBJECT): Boolean
    require
        other /= Void
    do
        Result := codes_conformant (node_id, other.node_id)
    end

node_reuse_congruent (other: C_OBJECT): Boolean
        -- True if this node is the sole re-using node of the corresponding node in the flat
    require
        other /= Void
    do
        Result := node_id_conforms_to (other) and
            (is_root or else
            attached parent and then parent.child_reuse_count (other.node_id) = 1)
    end

Validity Rules: C_OBJECT

The validity rules for all C_OBJECTs are as follows:

VCORM object constraint type name existence: a type name introducing an object constraint block must be defined in the underlying information model.

VCORMT object constraint type validity: a type name introducing an object constraint block must be the same as or conform to the type stated in the underlying information model of its owning attribute.

VCOCD object constraint definition validity: an object constraint block consists of one of the following (depending on subtype): an 'any' constraint; a reference; an inline definition of sub-constraints, or nothing, in the case where occurrences is set to {0}.

VCOID object node identifier validity: every object node must have a node identifier.

VCOSU object node identifier validity: every object node must be unique within the archetype.

The following validity rules govern C_OBJECTs in specialised archetypes.

VSONT specialised archetype object node meta-type conformance: the meta-type of a redefined object node (i.e. the AOM node type such as C_COMPLEX_OBJECT etc) in a specialised archetype must be the same as that of the corresponding node in the flat parent, with the following exceptions: a C_COMPLEX_OBJECT with no child attributes may be redefined by a node of any AOM type except C_PRIMITIVE_OBJECT; a C_COMPLEX_OBJECT_PROXY, may be redefined by a C_COMPLEX_OBJECT; an ARCHETYPE_SLOT may be redefined by C_ARCHETYPE_ROOT (i.e. 'slot-filling'). See also validity rules VDSSID and VARXID.

VSONCT specialised archetype object node reference type conformance: the reference model type of a redefined object node in a specialised archetype must conform to the reference model type in the corresponding node in the flat parent archetype by either being identical, or conforming via an inheritance relationship in the relevant reference model.

Deprecated: VSONIR specialised archetype redefined object node identifier condition: the node identifier of an object node in a specialised archetype that is a redefinition of a node in the flat parent must be redefined if any of reference model type, node identifier definition in the terminology, or occurrences of the immediate object constraint is redefined, with the exception of occurrences being redefined to {0}, i.e. exclusion.

Deprecated: VSONI specialised archetype redefined object node identifier validity: if an object node in a specialised archetype is a redefinition of a node in the flat parent according to VSONIR, and the parent node carries a node identifier, it must carry a node identifier specialised at the level of the child archetype. Otherwise it must carry the same node identifier (or none) as the corresponding parent node.

VSONIN specialised archetype new object node identifier validity: if an object node in a specialised archetype is a new node with respect to the flat parent, and it carries a node identifier, the identifier must be a 'new' node identifier, specialised at the level of the child archetype.

VSONIF specialised archetype object node identifier validity in flat siblings: the identification (or not) of an object node in a specialised archetype must be valid with respect to any sibling object nodes in the flattened parent (see VACMI).

VSONCO specialised archetype object node occurrences redefinition validity:

For object node(s) redefining a single-occurrences node in the specialisation flat parent (i.e. a node having occurrences upper bound = 1), the child node(s) occurrences interval(s) must be wholly contained within that of the parent, i.e. narrower. If there are multiple such nodes, each is an alternative, and only one can be applied at runtime.

For nodes specialising a multiple-occurrences parent node (which will always be within a container attribute), any or all such nodes might apply to data at runtime. Consequently, it is the collective occurrences of all such nodes, that must be compared to the occurrences of the parent - no assumption is made that the occurrences of any specific redefining node on its own need conform to that of the redefined node.

Formally, the collective occurrences interval of all nodes in a specialised node set must intersect with the flattened occurrences interval of the corresponding parent node, for each object in the set to be valid. If there is no intersection, the occurrences of all members of the set is considered invalid.

A specialised node set is the set of nodes in a flat child archetype that specializes a multiple-occurrences parent node, which may include the parent node itself if it appears in the flattened archetype.

The collective occurrences of a specialised node set is computed as the interval consisting of:

  • lower bound = the sum of the lower bounds of the occurrences of the members of the specialised node set;

  • upper bound = minimum of:

    • sum of upper bounds of the occurrences of the members of the specialised node set; where any of the upper bounds is unbounded, the sum is unbounded;

    • upper bound of the flattened cardinality of the containing attribute.

For any member of the specialised node set that does not have a local occurrences override, the occurrences is that of the redefined parent node.

A consequence of the intersection rule and the priority of the cardinality of the owning attribute is that the occurrences of any node in a specialisation set may have an unbounded upper limit (i.e. *) even if the upper bound of the cardinality of the owning attribute is finite.

VSONPT specialised archetype prohibited object node AOM type validity: the occurrences of a redefined object node in a specialised archetype, may only be prohibited (i.e. {0}) if the matching node in the parent is of the same AOM type.

VSONPI specialised archetype prohibited object node AOM node id validity: a redefined object node in a specialised archetype with occurrences matching {0} must have exactly the same node_id as the node in the flat parent being redefined.

VSONPO specialised archetype object node prohibited occurrences validity: the occurrences of a new (i.e. having no corresponding node in the parent flat) object node in a specialised archetype, if stated, may not be 'prohibited', i.e. {0}, since prohibition only makes sense for an existing node.

VSSM specialised archetype sibling order validity: the sibling order node at-code (id-code) used in a sibling marker in a specialised archetype must refer to a node found within the same container in the flat parent archetype, or a specialised version of any such node, redefined in the current archetype.

C_DEFINED_OBJECT Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_DEFINED_OBJECT (abstract)

Description

Abstract parent type of C_OBJECT subtypes that are defined by value, i.e. whose definitions are actually in the archetype rather than being by reference.

Inherit

C_OBJECT

Attributes

Signature

Meaning

0..1

default_value: Any

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

Functions

Signature

Meaning

1..1
(abstract)

any_allowed (): Boolean

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

1..1
(abstract)

valid_value (
a_value: Any[1]
): Boolean

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

1..1
(abstract)

prototype_value (): Any

Generate a prototype value from this constraint object.

1..1

has_default_value (): Boolean

True if there is an assumed value.

Invariants

Inv_valid_default_value: valid_value (default_value)

C_DEFINED_OBJECT (abstract)

Abstract parent type of C_OBJECT subtypes that are defined by value, i.e. whose definitions are actually in the archetype rather than being by reference.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

default_value: Any [0..1]

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_OBJECT.c_conforms_to (
other: C_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker agent (lambda).

C_OBJECT.c_congruent_to (
other: ARCHETYPE_CONSTRAINT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

(abstract) any_allowed (): Boolean [1..1]

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

(abstract) valid_value (
a_value: Any[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

(abstract) prototype_value (): Any [1..1]

Generate a prototype value from this constraint object.

has_default_value (): Boolean [1..1]

True if there is an assumed value.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

Inv_valid_default_value: valid_value (default_value)

{
    "name": "C_DEFINED_OBJECT",
    "documentation": "Abstract parent type of `C_OBJECT` subtypes that are defined by value, i.e. whose definitions are actually in the archetype rather than being by reference. ",
    "is_abstract": true,
    "ancestors": [
        "C_OBJECT"
    ],
    "properties": {
        "default_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "default_value",
            "documentation": "Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.",
            "type": "Any"
        }
    },
    "functions": {
        "any_allowed": {
            "name": "any_allowed",
            "documentation": "True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.",
            "is_abstract": true,
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "valid_value": {
            "name": "valid_value",
            "documentation": "True if `_a_value_` is valid with respect to constraint expressed in concrete instance of this type.",
            "is_abstract": true,
            "parameters": {
                "a_value": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_value",
                    "type": "Any"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "prototype_value": {
            "name": "prototype_value",
            "documentation": "Generate a prototype value from this constraint object.",
            "is_abstract": true,
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Any"
            }
        },
        "has_default_value": {
            "name": "has_default_value",
            "documentation": "True if there is an assumed value.\n",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    },
    "invariants": {
        "Inv_valid_default_value": "valid_value (default_value)"
    }
}
C_DEFINED_OBJECT

C_COMPLEX_OBJECT Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_COMPLEX_OBJECT

Description

Constraint on complex objects, i.e. any object that consists of other object constraints.

Inherit

C_DEFINED_OBJECT

Attributes

Signature

Meaning

0..1

attributes: List<C_ATTRIBUTE>

List of constraints on attributes of the reference model type represented by this object.

0..1

attribute_tuples: List<C_ATTRIBUTE_TUPLE>

List of attribute tuple constraints under this object constraint, if any.

Functions

Signature

Meaning

1..1
(effected)

any_allowed (): Boolean

Post: Result = attributes.is_empty and not is_prohibited

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

1..1
(redefined)

c_conforms_to (
other: C_COMPLEX_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker agent (lambda).

1..1
(redefined)

c_congruent_to (
other: C_COMPLEX_OBJECT[1]
): Boolean

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

C_COMPLEX_OBJECT

Constraint on complex objects, i.e. any object that consists of other object constraints.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

C_DEFINED_OBJECT.default_value: Any [0..1]

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

attributes: List<C_ATTRIBUTE> [0..1]

List of constraints on attributes of the reference model type represented by this object.

attribute_tuples: List<C_ATTRIBUTE_TUPLE> [0..1]

List of attribute tuple constraints under this object constraint, if any.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

c_conforms_to (
other: C_COMPLEX_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker agent (lambda).

c_congruent_to (
other: C_COMPLEX_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

any_allowed (): Boolean

Post: Result = attributes.is_empty and not is_prohibited [1..1]

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

(abstract) C_DEFINED_OBJECT.valid_value (
a_value: Any[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

(abstract) C_DEFINED_OBJECT.prototype_value (): Any [1..1]

Generate a prototype value from this constraint object.

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

{
    "name": "C_COMPLEX_OBJECT",
    "documentation": "Constraint on complex objects, i.e. any object that consists of other object constraints.",
    "ancestors": [
        "C_DEFINED_OBJECT"
    ],
    "properties": {
        "attributes": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "attributes",
            "documentation": "List of constraints on attributes of the reference model type represented by this object.",
            "type_def": {
                "container_type": "List",
                "type": "C_ATTRIBUTE"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "attribute_tuples": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "attribute_tuples",
            "documentation": "List of attribute tuple constraints under this object constraint, if any.",
            "type_def": {
                "container_type": "List",
                "type": "C_ATTRIBUTE_TUPLE"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        }
    },
    "functions": {
        "any_allowed": {
            "name": "any_allowed",
            "documentation": "True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.",
            "post_conditions": {
                "Post": "Result = attributes.is_empty and not is_prohibited"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_conforms_to": {
            "name": "c_conforms_to",
            "documentation": "True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. \nTypically used during validation of specialised archetype nodes.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_COMPLEX_OBJECT"
                },
                "rmcc": {
                    "_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
                    "name": "rmcc",
                    "documentation": "Reference Model conformance checker agent (lambda).",
                    "type_def": {
                        "root_type": "FUNCTION"
                    }
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_congruent_to": {
            "name": "c_congruent_to",
            "documentation": "True if constraints represented by this node contain no further redefinitions with respect to the node `_other_`, with the exception of `_node_id_` redefinition in `C_OBJECT` nodes. \n\nTypically used to test if an inherited node locally contains any constraints.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_COMPLEX_OBJECT"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_COMPLEX_OBJECT

Validity Rules: C_COMPLEX_OBJECT

The validity rules for C_COMPLEX_OBJECTs are as follows:

VCATU attribute uniqueness: sibling attributes occurring within an object node must be uniquely named with respect to each other, in the same way as for class definitions in an object reference model.

C_ARCHETYPE_ROOT Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_ARCHETYPE_ROOT

Description

A specialisation of C_COMPLEX_OBJECT whose node_id attribute is an archetype identifier rather than the normal internal node code (i.e. id-code).

Used in two situations. The first is to represent an 'external reference' to an archetype from within another archetype or template. This supports re-use. The second use is within a template, where it is used as a slot-filler.

For a new external reference, the node_id is set in the normal way, i.e. with a new code at the specialisation level of the archetype.

For a slot-filler or a redefined external reference, the node_id is set to a specialised version of the node_id of the node being specialised, allowing matching to occur during flattening.

In all uses within source archetypes and templates, the children attribute is Void.

In an operational template, the node_id is converted to the archetype_ref, and the structure contains the result of flattening any template overlay structure and the underlying flat archetype.

Inherit

C_COMPLEX_OBJECT

Attributes

Signature

Meaning

1..1

archetype_ref: String

Reference to archetype is being used to fill a slot or redefine an external reference. Typically an 'interface' archetype id, i.e. identifier with partial version information.

C_ARCHETYPE_ROOT

A specialisation of C_COMPLEX_OBJECT whose node_id attribute is an archetype identifier rather than the normal internal node code (i.e. id-code).

Used in two situations. The first is to represent an 'external reference' to an archetype from within another archetype or template. This supports re-use. The second use is within a template, where it is used as a slot-filler.

For a new external reference, the node_id is set in the normal way, i.e. with a new code at the specialisation level of the archetype.

For a slot-filler or a redefined external reference, the node_id is set to a specialised version of the node_id of the node being specialised, allowing matching to occur during flattening.

In all uses within source archetypes and templates, the children attribute is Void.

In an operational template, the node_id is converted to the archetype_ref, and the structure contains the result of flattening any template overlay structure and the underlying flat archetype.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT, C_COMPLEX_OBJECT

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

C_DEFINED_OBJECT.default_value: Any [0..1]

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

C_COMPLEX_OBJECT.attributes: List<C_ATTRIBUTE> [0..1]

List of constraints on attributes of the reference model type represented by this object.

C_COMPLEX_OBJECT.attribute_tuples: List<C_ATTRIBUTE_TUPLE> [0..1]

List of attribute tuple constraints under this object constraint, if any.

archetype_ref: String [1..1]

Reference to archetype is being used to fill a slot or redefine an external reference. Typically an 'interface' archetype id, i.e. identifier with partial version information.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_COMPLEX_OBJECT.c_conforms_to (
other: C_COMPLEX_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker agent (lambda).

C_COMPLEX_OBJECT.c_congruent_to (
other: C_COMPLEX_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

C_COMPLEX_OBJECT.any_allowed (): Boolean

Post: Result = attributes.is_empty and not is_prohibited [1..1]

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

(abstract) C_DEFINED_OBJECT.valid_value (
a_value: Any[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

(abstract) C_DEFINED_OBJECT.prototype_value (): Any [1..1]

Generate a prototype value from this constraint object.

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

{
    "name": "C_ARCHETYPE_ROOT",
    "documentation": "A specialisation of `C_COMPLEX_OBJECT` whose node_id attribute is an archetype identifier rather than the normal internal node code (i.e. id-code).\n\nUsed in two situations. The first is to represent an 'external reference' to an archetype from within another archetype or template. This supports re-use. The second use is within a template, where it is used as a slot-filler. \n\nFor a new external reference, the `_node_id_` is set in the normal way, i.e. with a new code at the specialisation level of the archetype.\n\nFor a slot-filler or a redefined external reference, the `_node_id_` is set to a specialised version of the `_node_id_` of the node being specialised, allowing matching to occur during flattening.\n\nIn all uses within source archetypes and templates, the `_children_` attribute is `Void`.\n\nIn an operational template, the `_node_id_` is converted to the `_archetype_ref_`, and the structure contains the result of flattening any template overlay structure and the underlying flat archetype.\n",
    "ancestors": [
        "C_COMPLEX_OBJECT"
    ],
    "properties": {
        "archetype_ref": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "archetype_ref",
            "documentation": "Reference to archetype is being used to fill a slot or redefine an external reference. Typically an 'interface' archetype id, i.e. identifier with partial version information.",
            "is_mandatory": true,
            "type": "String"
        }
    }
}
C_ARCHETYPE_ROOT

Validity Rules: C_ARCHETYPE_ROOT

The following validity rules apply to C_ARCHETYPE_ROOT objects:

VARXNC external reference node identifier validity: if the external reference object is a redefinition of either a slot node, or another external reference node, the node_id of the object must conform to (i.e. be the same or a child of) the node_id of the corresponding parent node.

VARXAV external reference node archetype reference validity: if the reference object is a redefinition of another external reference node, the archetype_ref of the object must match a real archetype that has as an ancestor the archetype matched by the archetype reference mentioned in the corresponding parent node.

VARXTV external reference type validity: the reference model type of the reference object archetype identifier must be identical, or conform to the type of the slot, if there is one, in the parent archetype, or else to the reference model type of the attribute in the flat parent under which the reference object appears in the child archetype.

VARXR external reference refers to resolvable artefact: the archetype reference must refer to an artefact that can be found in the current repository.

The following validity rules apply to a C_ARCHETYPE_ROOT that specialises a ARCHETYPE_SLOT in the flat parent archetype:

VARXS external reference slot conformance: where an archetype reference redefines an archetype slot in the flat parent, it must conform to the archetype slot node by being of a reference model type from the same reference model as the current archetype.

VARXID external reference slot filling id validity: an external reference node defined as a filler for a slot in the parent archetype must have a node id that is a specialisation of that of the slot.

ARCHETYPE_SLOT Class

  • Definition

  • Effective

  • BMM

  • UML

Class

ARCHETYPE_SLOT

Description

Constraint describing a 'slot' where another archetype can occur.

Inherit

C_OBJECT

Attributes

Signature

Meaning

0..1

includes: List<ASSERTION>

List of constraints defining other archetypes that could be included at this point. Represented as an ASSERTION containing an expression of the form EXPR_ARCHETYPE_REF matches EXPR_ARCHETYPE_ID_CONSTRAINT.

0..1

excludes: List<ASSERTION>

List of constraints defining other archetypes that cannot be included at this point. Represented as an ASSERTION containing an expression of the form EXPR_ARCHETYPE_REF matches EXPR_ARCHETYPE_ID_CONSTRAINT.

1..1

is_closed: Boolean

True if this slot specification in this artefact is closed to further filling either in further specialisations or at runtime. Default value False, i.e. unless explicitly set, a slot remains open.

Functions

Signature

Meaning

1..1

any_allowed (): Boolean

True if no constraints stated, and slot is not closed.

ARCHETYPE_SLOT

Constraint describing a 'slot' where another archetype can occur.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

includes: List<ASSERTION> [0..1]

List of constraints defining other archetypes that could be included at this point. Represented as an ASSERTION containing an expression of the form EXPR_ARCHETYPE_REF matches EXPR_ARCHETYPE_ID_CONSTRAINT.

excludes: List<ASSERTION> [0..1]

List of constraints defining other archetypes that cannot be included at this point. Represented as an ASSERTION containing an expression of the form EXPR_ARCHETYPE_REF matches EXPR_ARCHETYPE_ID_CONSTRAINT.

is_closed: Boolean [1..1]

True if this slot specification in this artefact is closed to further filling either in further specialisations or at runtime. Default value False, i.e. unless explicitly set, a slot remains open.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_OBJECT.c_conforms_to (
other: C_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker agent (lambda).

C_OBJECT.c_congruent_to (
other: ARCHETYPE_CONSTRAINT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

any_allowed (): Boolean [1..1]

True if no constraints stated, and slot is not closed.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

{
    "name": "ARCHETYPE_SLOT",
    "documentation": "Constraint describing a 'slot' where another archetype can occur. ",
    "ancestors": [
        "C_OBJECT"
    ],
    "properties": {
        "includes": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "includes",
            "documentation": "List of constraints defining other archetypes that could be included at this point. Represented as an `ASSERTION` containing an expression of the form  `EXPR_ARCHETYPE_REF matches EXPR_ARCHETYPE_ID_CONSTRAINT`.",
            "type_def": {
                "container_type": "List",
                "type": "ASSERTION"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "excludes": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "excludes",
            "documentation": "List of constraints defining other archetypes that cannot be included at this point. Represented as an `ASSERTION` containing an expression of the form  `EXPR_ARCHETYPE_REF matches EXPR_ARCHETYPE_ID_CONSTRAINT`.",
            "type_def": {
                "container_type": "List",
                "type": "ASSERTION"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "is_closed": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "is_closed",
            "documentation": "True if this slot specification in this artefact is closed to further filling either in further specialisations or at runtime. Default value False, i.e. unless explicitly set, a slot remains open.",
            "is_mandatory": true,
            "type": "Boolean"
        }
    },
    "functions": {
        "any_allowed": {
            "name": "any_allowed",
            "documentation": "True if no constraints stated, and slot is not closed.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
ARCHETYPE_SLOT

Validity Rules: ARCHETYPE_SLOT

The validity rules for ARCHETYPE_SLOTs are as follows:

VDFAI archetype identifier validity in definition. Any archetype identifier mentioned in an archetype slot in the definition section must conform to the published openEHR specification for archetype identifiers.

VDSIV archetype slot 'include' constraint validity. The 'include' constraint in an archetype slot must conform to the slot constraint validity rules.

VDSEV archetype slot 'exclude' constraint validity. The 'exclude' constraint in an archetype slot must conform to the slot constraint validity rules.

The slot constraint validity rules are as follows:

if includes not empty and = any then
    not (excludes empty or /= any) ==> VDSEV Error
elseif includes not empty and /= any then
    not (excludes empty or = any) ==> VDSEV Error
elseif excludes not empty and = any then
    not (includes empty or /= any) ==> VDSIV Error
elseif excludes not empty and /= any then
    not (includes empty or = any) ==> VDSIV Error
end

The following validity rules apply to ARCHETYPE_SLOTs defined as the specialisation of a slot in the parent archetype:

VDSSID slot redefinition child node id: a slot node in a specialised archetype that redefines a slot node in the flat parent must have an identical node id.

VDSSM specialised archetype slot definition match validity. The set of archetypes matched from a library of archetypes by a specialised archetype slot definition must be a proper subset of the set matched from the same library by the parent slot definition.

VDSSP specialised archetype slot definition parent validity. The flat parent of the specialisation of an archetype slot must be not be closed (is_closed = False).

VDSSC specialised archetype slot definition closed validity. In the specialisation of an archetype slot, either the slot can be specified to be closed (is_closed = True) or the slot can be narrowed, but not both.

C_COMPLEX_OBJECT_PROXY Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_COMPLEX_OBJECT_PROXY

Description

A constraint defined by proxy, using a reference to an object constraint defined elsewhere in the same archetype. Note that since this object refers to another node, there are two objects with available occurrences values. The local occurrences value on a COMPLEX_OBJECT_PROXY should always be used; when setting this from a serialised form, if no occurrences is mentioned, the target occurrences should be used (not the standard default of \{1..1}); otherwise the locally specified occurrences should be used as normal. When serialising out, if the occurrences is the same as that of the target, it can be left out.

Inherit

C_OBJECT

Attributes

Signature

Meaning

1..1

target_path: String

Reference to an object node using archetype path notation.

Functions

Signature

Meaning

1..1

use_target_occurrences (): Boolean

Post: Result = (occurrences = Void)

True if target occurrences are to be used as the value of occurrences in this object; by the time of runtime use, the target occurrences value has to be set into this object.

1..1
(redefined)

occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

If other is a C_COMPLEX_OBJECT, then always True, since if occurrences defined on proxy node, it is an override of the occurrences on the target, and it doesn’t have to conform to anything except the containing attribute’s cardinality. However, if other is also a C_COMPLEX_OBJECT then the override is of another use_node, and normal occurrences apply

Parameters
other

C_OBJECT from a flat parent archetype.

C_COMPLEX_OBJECT_PROXY

A constraint defined by proxy, using a reference to an object constraint defined elsewhere in the same archetype. Note that since this object refers to another node, there are two objects with available occurrences values. The local occurrences value on a COMPLEX_OBJECT_PROXY should always be used; when setting this from a serialised form, if no occurrences is mentioned, the target occurrences should be used (not the standard default of \{1..1}); otherwise the locally specified occurrences should be used as normal. When serialising out, if the occurrences is the same as that of the target, it can be left out.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

target_path: String [1..1]

Reference to an object node using archetype path notation.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_OBJECT.c_conforms_to (
other: C_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker agent (lambda).

C_OBJECT.c_congruent_to (
other: ARCHETYPE_CONSTRAINT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

If other is a C_COMPLEX_OBJECT, then always True, since if occurrences defined on proxy node, it is an override of the occurrences on the target, and it doesn’t have to conform to anything except the containing attribute’s cardinality. However, if other is also a C_COMPLEX_OBJECT then the override is of another use_node, and normal occurrences apply

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

use_target_occurrences (): Boolean

Post: Result = (occurrences = Void) [1..1]

True if target occurrences are to be used as the value of occurrences in this object; by the time of runtime use, the target occurrences value has to be set into this object.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

{
    "name": "C_COMPLEX_OBJECT_PROXY",
    "documentation": "A constraint defined by proxy, using a reference to an object constraint defined elsewhere in the same archetype. Note that since this object refers to another node, there are two objects with available occurrences values. The local occurrences value on a `COMPLEX_OBJECT_PROXY` should always be used; when setting this from a serialised form, if no occurrences is mentioned, the target occurrences should be used (not the standard default of `{1..1}`); otherwise the locally specified occurrences should be used as normal. When serialising out, if the occurrences is the same as that of the target, it can be left out. ",
    "ancestors": [
        "C_OBJECT"
    ],
    "properties": {
        "target_path": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "target_path",
            "documentation": "Reference to an object node using archetype path notation.",
            "is_mandatory": true,
            "type": "String"
        }
    },
    "functions": {
        "use_target_occurrences": {
            "name": "use_target_occurrences",
            "documentation": "True if target occurrences are to be used as the value of occurrences in this object; by the time of runtime use, the target occurrences value has to be set into this object.",
            "post_conditions": {
                "Post": "Result = (occurrences = Void)"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "occurrences_conforms_to": {
            "name": "occurrences_conforms_to",
            "documentation": "True if this node occurrences conforms to `_other.occurrences_`; `_other_` is assumed to be in a flat archetype.\n\nIf `_other_` is a `C_COMPLEX_OBJECT`, then always `True`, since if occurrences defined on proxy node, it is an override of  the occurrences on the target, and it doesn't have to conform to anything except the containing attribute's cardinality. However, if `_other_` is also a `C_COMPLEX_OBJECT` then the override is of another use_node, and normal occurrences apply\n",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "documentation": "`C_OBJECT` from a flat parent archetype.",
                    "type": "C_OBJECT"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_COMPLEX_OBJECT_PROXY

Validity Rules: C_COMPLEX_OBJECT_PROXY

The following validity rules applies to internal references:

VUNT use_node reference model type validity: the reference model type mentioned in an C_COMPLEX_OBJECT_PROXY node must be the same as or a super-type (according to the reference model) of the reference model type of the node referred to.

VUNP use_node path validity: the path mentioned in a use_node statement must refer to an object node defined elsewhere in the same archetype or any of its specialisation parent archetypes, that is not itself an internal reference node, and which carries a node identifier if one is needed at the reference point.

The following validity rule applies to the redefinition of an internal reference in a specialised archetype:

VSUNT use_node specialisation parent validity: a C_COMPLEX_OBJECT_PROXY node may be redefined in a specialised archetype by another C_COMPLEX_OBJECT_PROXY (e.g. in order to redefine occurrences), or by a C_COMPLEX_OBJECT structure that legally redefines the target C_COMPLEX_OBJECT node referred to by the reference.

C_PRIMITIVE_OBJECT Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_PRIMITIVE_OBJECT (abstract)

Description

Parent of types representing constraints on primitive types.

Instances of this type represented in ADL inline form, the node_id attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

Inherit

C_DEFINED_OBJECT

Attributes

Signature

Meaning

0..1

assumed_value: Any

Value to be assumed if none sent in data.

0..1

is_enumerated_type_constraint: Boolean

True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.

1..1

constraint: Any

Constraint represented by this object; redefine in descendants.

Functions

Signature

Meaning

1..1

has_assumed_value (): Boolean

True if there is an assumed value.

1..1

constrained_typename (): String

Generate name of native type that is constrained by this C_XXX type. For most types, it is the C_XXX typename without the C_, i.e. XXX. E.g. C_INTEGERInteger. For the date/time types the mapping is different.

1..1
(redefined)

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker lambda.

1..1
(abstract)

c_value_conforms_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean

True if this node expresses a value constraint that conforms to that of other. Effected in descendants.

1..1
(redefined)

c_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

1..1
(abstract)

c_value_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean

True if this node expresses the same value constraint as other. Effected in descendants.

Invariants

Inv_valid_assumed_value: valid_value (assumed_value)

C_PRIMITIVE_OBJECT (abstract)

Parent of types representing constraints on primitive types.

Instances of this type represented in ADL inline form, the node_id attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

C_DEFINED_OBJECT.default_value: Any [0..1]

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

assumed_value: Any [0..1]

Value to be assumed if none sent in data.

is_enumerated_type_constraint: Boolean [0..1]

True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.

constraint: Any [1..1]

Constraint represented by this object; redefine in descendants.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker lambda.

c_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

(abstract) C_DEFINED_OBJECT.any_allowed (): Boolean [1..1]

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

(abstract) C_DEFINED_OBJECT.valid_value (
a_value: Any[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

(abstract) C_DEFINED_OBJECT.prototype_value (): Any [1..1]

Generate a prototype value from this constraint object.

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

has_assumed_value (): Boolean [1..1]

True if there is an assumed value.

constrained_typename (): String [1..1]

Generate name of native type that is constrained by this C_XXX type. For most types, it is the C_XXX typename without the C_, i.e. XXX. E.g. C_INTEGERInteger. For the date/time types the mapping is different.

(abstract) c_value_conforms_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if this node expresses a value constraint that conforms to that of other. Effected in descendants.

(abstract) c_value_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if this node expresses the same value constraint as other. Effected in descendants.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

Inv_valid_assumed_value: valid_value (assumed_value)

{
    "name": "C_PRIMITIVE_OBJECT",
    "documentation": "Parent of types representing constraints on primitive types.\n\nInstances of this type represented in ADL inline form, the `_node_id_` attribute will have the special value `Primitive_node_id`; otherwise it will have the node id read during parsing.",
    "is_abstract": true,
    "ancestors": [
        "C_DEFINED_OBJECT"
    ],
    "properties": {
        "assumed_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "assumed_value",
            "documentation": "Value to be assumed if none sent in data.",
            "type": "Any"
        },
        "is_enumerated_type_constraint": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "is_enumerated_type_constraint",
            "documentation": "True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.",
            "type": "Boolean"
        },
        "constraint": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "constraint",
            "documentation": "Constraint represented by this object; redefine in descendants.",
            "is_mandatory": true,
            "type": "Any"
        }
    },
    "functions": {
        "has_assumed_value": {
            "name": "has_assumed_value",
            "documentation": "True if there is an assumed value.\n",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "constrained_typename": {
            "name": "constrained_typename",
            "documentation": "Generate name of native type that is constrained by this `C_XXX` type. For most types, it is the `C_XXX` typename without the `C_`, i.e. `XXX`. E.g. `C_INTEGER` -> `Integer`. For the date/time types the mapping is different.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "String"
            }
        },
        "c_conforms_to": {
            "name": "c_conforms_to",
            "documentation": "True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. \nTypically used during validation of specialised archetype nodes.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_PRIMITIVE_OBJECT"
                },
                "rmcc": {
                    "_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
                    "name": "rmcc",
                    "documentation": "Reference Model conformance checker lambda.",
                    "type_def": {
                        "root_type": "FUNCTION"
                    }
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_value_conforms_to": {
            "name": "c_value_conforms_to",
            "documentation": "True if this node expresses a value constraint that conforms to that of `other`. Effected in descendants.",
            "is_abstract": true,
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_PRIMITIVE_OBJECT"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_congruent_to": {
            "name": "c_congruent_to",
            "documentation": "True if constraints represented by this node contain no further redefinitions with respect to the node `_other_`, with the exception of `_node_id_` redefinition in `C_OBJECT` nodes. \n\nTypically used to test if an inherited node locally contains any constraints.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_PRIMITIVE_OBJECT"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_value_congruent_to": {
            "name": "c_value_congruent_to",
            "documentation": "True if this node expresses the same value constraint as `other`. Effected in descendants.",
            "is_abstract": true,
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_PRIMITIVE_OBJECT"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    },
    "invariants": {
        "Inv_valid_assumed_value": "valid_value (assumed_value)"
    }
}
C_PRIMITIVE_OBJECT

Validity Rules: C_PRIMITIVE_OBJECT

Validity rules applying to all C_PRIMITIVE_OBJECT types are as follows:

VOBAV object node assumed value validity: the value of an assumed value must fall within the value space defined by the constraint to which it is attached.

Conformance Semantics: C_PRIMITIVE_OBJECT

The following functions redefine those of the same names from C_OBJECT, and formally define the conformance of a node of a C_PRIMITIVE_OBJECT descendant type in a specialised archetype to a corresponding node in a parent archetype, where 'corresponding' means a node found at the same or a congruent path and of the same AOM type.

c_conforms_to (other: C_PRIMITIVE_OBJECT; rmcc: FUNCTION<<a_type, other_type: String>, Boolean>): Boolean
        -- True if this node on its own (ignoring any subparts) expresses the same or narrower
        -- constraints
        -- as `other'. Returns True only when the following is True:
        --   * occurrences conforms
        --   * `rm_type_name' is identical to that in `other'
        -- `rmcc' is an agent (lambda) that can test an RM type's conformance to another RM type
    do
        Result := precursor (other, rmcc) and c_value_conforms_to (other)
    end

c_value_conforms_to (other: like Current): Boolean
        -- True if this node expresses a value constraint that conforms to that of `other'
    deferred
    end

c_congruent_to (other: C_PRIMITIVE_OBJECT): Boolean
        -- True if this node on its own (ignoring any subparts) expresses no constraints in
        -- addition to `other'
    do
		Result := constrained_typename.is_case_insensitive_equal (other.constrained_typename) and
            c_value_congruent_to (other)
    end

c_value_congruent_to (other: C_PRIMITIVE_OBJECT): Boolean
        -- True if this node's value constraint is the same as that of `other'
    deferred
    end

constrained_typename: String
        -- the same as the C_XX clas name with the "C_" removed, but for some types e.g. Date/time types
        -- it is not true.
    do
        Result := generating_type.name
        Result.remove_head (2)
    end

C_BOOLEAN Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_BOOLEAN

Description

Constraint on instances of Boolean. Both attributes cannot be set to False, since this would mean that the Boolean value being constrained cannot be True or False.

Inherit

C_PRIMITIVE_OBJECT

Attributes

Signature

Meaning

0..1
(effected)

constraint: List<Boolean>

Boolean constraint - a list of Boolean values.

0..1
(effected)

assumed_value: Boolean

Assumed Boolean value.

0..1
(redefined)

default_value: Boolean

Default Boolean value.

Functions

Signature

Meaning

1..1
(redefined)

prototype_value (): Boolean

Prototype Boolean value.

1..1
(redefined)

any_allowed (): Boolean

Post: Result = constraint.is_empty

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

1..1
(effected)

c_value_conforms_to (
other: C_BOOLEAN[1]
): Boolean

True if other.any_allowed or else every constraint in the constraint list exists in the other.constraint.

1..1
(effected)

c_value_congruent_to (
other: C_BOOLEAN[1]
): Boolean

True if the items in constraint are equal in number and identical pair-wise with those in other.constraint.

C_BOOLEAN

Constraint on instances of Boolean. Both attributes cannot be set to False, since this would mean that the Boolean value being constrained cannot be True or False.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT, C_PRIMITIVE_OBJECT

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

default_value: Boolean [0..1]

Default Boolean value.

assumed_value: Boolean [0..1]

Assumed Boolean value.

C_PRIMITIVE_OBJECT.is_enumerated_type_constraint: Boolean [0..1]

True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.

constraint: List<Boolean> [0..1]

Boolean constraint - a list of Boolean values.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_PRIMITIVE_OBJECT.c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker lambda.

C_PRIMITIVE_OBJECT.c_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

any_allowed (): Boolean

Post: Result = constraint.is_empty [1..1]

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

(abstract) C_DEFINED_OBJECT.valid_value (
a_value: Any[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

prototype_value (): Boolean [1..1]

Prototype Boolean value.

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.has_assumed_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.constrained_typename (): String [1..1]

Generate name of native type that is constrained by this C_XXX type. For most types, it is the C_XXX typename without the C_, i.e. XXX. E.g. C_INTEGERInteger. For the date/time types the mapping is different.

c_value_conforms_to (
other: C_BOOLEAN[1]
): Boolean [1..1]

True if other.any_allowed or else every constraint in the constraint list exists in the other.constraint.

c_value_congruent_to (
other: C_BOOLEAN[1]
): Boolean [1..1]

True if the items in constraint are equal in number and identical pair-wise with those in other.constraint.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

C_PRIMITIVE_OBJECT.Inv_valid_assumed_value: valid_value (assumed_value)

{
    "name": "C_BOOLEAN",
    "documentation": "Constraint on instances of `Boolean`. Both attributes cannot be set to False, since this would mean that the Boolean value being constrained cannot be `True` or `False`.",
    "ancestors": [
        "C_PRIMITIVE_OBJECT"
    ],
    "properties": {
        "constraint": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "constraint",
            "documentation": "Boolean constraint - a list of Boolean values.",
            "type_def": {
                "container_type": "List",
                "type": "Boolean"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "assumed_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "assumed_value",
            "documentation": "Assumed Boolean value.",
            "type": "Boolean"
        },
        "default_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "default_value",
            "documentation": "Default Boolean value.",
            "type": "Boolean"
        }
    },
    "functions": {
        "prototype_value": {
            "name": "prototype_value",
            "documentation": "Prototype Boolean value.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "any_allowed": {
            "name": "any_allowed",
            "documentation": "True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.",
            "post_conditions": {
                "Post": "Result = constraint.is_empty"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_value_conforms_to": {
            "name": "c_value_conforms_to",
            "documentation": "True if `_other.any_allowed_` or else every constraint in the `_constraint_` list exists in the `_other.constraint_`.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_BOOLEAN"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_value_congruent_to": {
            "name": "c_value_congruent_to",
            "documentation": "True if the items in `_constraint_` are equal in number and identical pair-wise with those in `_other.constraint_`.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_BOOLEAN"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_BOOLEAN

Conformance semantics: C_BOOLEAN

The following functions formally define the conformance of a C_BOOLEAN node in a specialised archetype to a corresponding node in a parent archetype, where 'corresponding' means a node found at the same or a congruent path and of the same AOM type.

c_value_conforms_to (other: C_BOOLEAN): Boolean
        -- True if this node is a strict subset of `other'
    do
        Result := other.any_allowed or
            constraint.count < other.constraint.count and
            for all c in constraint | other.constraint.has (c)
    end

c_value_congruent_to (other: C_BOOLEAN): Boolean
        -- True if this node's value constraint is the same as that of `other'
    do
        Result := constraint.count = other.constraint.count and
            for all c in constraint | other.constraint.has (c)
    end

C_STRING Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_STRING

Description

Constraint on instances of String.

Inherit

C_PRIMITIVE_OBJECT

Attributes

Signature

Meaning

0..1
(effected)

constraint: List<String>

String constraint - a list of literal strings and / or regular expression strings delimited by the ‘/’ character.

To represent no constraint, use an empty list, or alternatively, a regex 'any' pattern, i.e. /.*/.

0..1
(redefined)

default_value: String

Default String value.

0..1
(effected)

assumed_value: String

Assumed String value.

Functions

Signature

Meaning

1..1
(redefined)

prototype_value (): String

1..1
(redefined)

valid_value (
a_value: String[1]
): Boolean

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

1..1
(redefined)

any_allowed (): Boolean

Post: Result = constraint.is_empty or else constraint.count = 1 and constraint.first.is_equal (Regex_any_string)

True if constraint is empty or else contains one String for the regex 'any' pattern.

1..1
(effected)

c_value_conforms_to (
other: C_STRING[1]
): Boolean

True if other.any_allowed or else every constraint in the constraint list exists in the other.constraint.

1..1
(effected)

c_value_congruent_to (
other: C_STRING[1]
): Boolean

True if the items in constraint are equal in number and identical pair-wise with those in other.constraint.

C_STRING

Constraint on instances of String.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT, C_PRIMITIVE_OBJECT

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

default_value: String [0..1]

Default String value.

assumed_value: String [0..1]

Assumed String value.

C_PRIMITIVE_OBJECT.is_enumerated_type_constraint: Boolean [0..1]

True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.

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

String constraint - a list of literal strings and / or regular expression strings delimited by the ‘/’ character.

To represent no constraint, use an empty list, or alternatively, a regex 'any' pattern, i.e. /.*/.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_PRIMITIVE_OBJECT.c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker lambda.

C_PRIMITIVE_OBJECT.c_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

any_allowed (): Boolean

Post: Result = constraint.is_empty or else constraint.count = 1 and constraint.first.is_equal (Regex_any_string) [1..1]

True if constraint is empty or else contains one String for the regex 'any' pattern.

valid_value (
a_value: String[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

prototype_value (): String [1..1]

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.has_assumed_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.constrained_typename (): String [1..1]

Generate name of native type that is constrained by this C_XXX type. For most types, it is the C_XXX typename without the C_, i.e. XXX. E.g. C_INTEGERInteger. For the date/time types the mapping is different.

c_value_conforms_to (
other: C_STRING[1]
): Boolean [1..1]

True if other.any_allowed or else every constraint in the constraint list exists in the other.constraint.

c_value_congruent_to (
other: C_STRING[1]
): Boolean [1..1]

True if the items in constraint are equal in number and identical pair-wise with those in other.constraint.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

C_PRIMITIVE_OBJECT.Inv_valid_assumed_value: valid_value (assumed_value)

{
    "name": "C_STRING",
    "documentation": "Constraint on instances of `String`. ",
    "ancestors": [
        "C_PRIMITIVE_OBJECT"
    ],
    "properties": {
        "constraint": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "constraint",
            "documentation": "String constraint - a list of literal strings and / or regular expression strings delimited by the ‘/’ character.\n\nTo represent no constraint, use an empty list, or alternatively, a regex 'any' pattern, i.e. `/.*/`.",
            "type_def": {
                "container_type": "List",
                "type": "String"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "default_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "default_value",
            "documentation": "Default String value.",
            "type": "String"
        },
        "assumed_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "assumed_value",
            "documentation": "Assumed String value.",
            "type": "String"
        }
    },
    "functions": {
        "prototype_value": {
            "name": "prototype_value",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "String"
            }
        },
        "valid_value": {
            "name": "valid_value",
            "documentation": "True if a_value is valid with respect to constraint expressed in concrete instance of this type. ",
            "parameters": {
                "a_value": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_value",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "any_allowed": {
            "name": "any_allowed",
            "documentation": "True if `_constraint_` is empty or else contains one String for the regex 'any' pattern.",
            "post_conditions": {
                "Post": "Result = constraint.is_empty or else constraint.count = 1 and constraint.first.is_equal (Regex_any_string)"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_value_conforms_to": {
            "name": "c_value_conforms_to",
            "documentation": "True if `_other.any_allowed_` or else every constraint in the `_constraint_` list exists in the `_other.constraint_`.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_STRING"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_value_congruent_to": {
            "name": "c_value_congruent_to",
            "documentation": "True if the items in `_constraint_` are equal in number and identical pair-wise with those in `_other.constraint_`.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_STRING"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_STRING

Conformance semantics: C_STRING

The following functions formally define the conformance of a C_STRING node in a specialised archetype to a corresponding node in a parent archetype, where 'corresponding' means a node found at the same or a congruent path and of the same AOM type.

c_value_conforms_to (other: C_STRING): Boolean
        -- True if `constraint' is a strict subset of other.constraint
    do
        Result := other.any_allowed or
            constraint.count < other.constraint.count and
            for all c in constraint | other.constraint.has (c)
    end

c_value_congruent_to (other: C_STRING): Boolean
        -- True if this node's value constraint is the same as that of `other'
    do
        Result := constraint.count = other.constraint.count and then
            across constraint as str_csr all
                other.constraint.i_th (str_csr.cursor_index).is_equal (str_csr.item)
            end
    end

C_ORDERED Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_ORDERED<T> (abstract)

Description

Abstract parent of primitive constrainer classes based on Ordered base types, i.e. types like Integer, Real, and the Date/Time types. The model constraint is a List of Intervals, which may include point Intervals, and acts as a efficient and formally tractable representation of any number of point values and/or contiguous intervals of an ordered value domain.

In its simplest form, the constraint accessor returns just a single point Interval<T> object, representing a single value.

The next simplest form is a single proper Interval <T> (i.e. normal two-sided or half-open interval). The most complex form is a list of any combination of point and proper intervals.

Inherit

C_PRIMITIVE_OBJECT

Attributes

Signature

Meaning

0..1
(redefined)

constraint: List<Interval<T>>

Constraint in the form of a List of Intervals of the parameter type T. Concrete types generated in descendants via template binding.

0..1
(redefined)

default_value: T

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

0..1
(redefined)

assumed_value: T

Value to be assumed if none sent in data.

Functions

Signature

Meaning

1..1
(redefined)

any_allowed (): Boolean

Post: Result = constraint.is_empty

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

1..1
(redefined)

c_value_conforms_to (
other: C_ORDERED[1]
): Boolean

True if other.any_allowed or else for every constraint in the constraint list there is a constraint in other.constraint that contains it.

1..1
(redefined)

c_value_congruent_to (
other: C_ORDERED[1]
): Boolean

True if the items in constraint are equal in number and identical pair-wise with those in other.constraint.

C_ORDERED<T> (abstract)

Abstract parent of primitive constrainer classes based on Ordered base types, i.e. types like Integer, Real, and the Date/Time types. The model constraint is a List of Intervals, which may include point Intervals, and acts as a efficient and formally tractable representation of any number of point values and/or contiguous intervals of an ordered value domain.

In its simplest form, the constraint accessor returns just a single point Interval<T> object, representing a single value.

The next simplest form is a single proper Interval <T> (i.e. normal two-sided or half-open interval). The most complex form is a list of any combination of point and proper intervals.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT, C_PRIMITIVE_OBJECT

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

default_value: T [0..1]

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

assumed_value: T [0..1]

Value to be assumed if none sent in data.

C_PRIMITIVE_OBJECT.is_enumerated_type_constraint: Boolean [0..1]

True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.

constraint: List<Interval<T>> [0..1]

Constraint in the form of a List of Intervals of the parameter type T. Concrete types generated in descendants via template binding.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_PRIMITIVE_OBJECT.c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker lambda.

C_PRIMITIVE_OBJECT.c_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

any_allowed (): Boolean

Post: Result = constraint.is_empty [1..1]

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

(abstract) C_DEFINED_OBJECT.valid_value (
a_value: Any[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

(abstract) C_DEFINED_OBJECT.prototype_value (): Any [1..1]

Generate a prototype value from this constraint object.

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.has_assumed_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.constrained_typename (): String [1..1]

Generate name of native type that is constrained by this C_XXX type. For most types, it is the C_XXX typename without the C_, i.e. XXX. E.g. C_INTEGERInteger. For the date/time types the mapping is different.

c_value_conforms_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if other.any_allowed or else for every constraint in the constraint list there is a constraint in other.constraint that contains it.

c_value_congruent_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if the items in constraint are equal in number and identical pair-wise with those in other.constraint.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

C_PRIMITIVE_OBJECT.Inv_valid_assumed_value: valid_value (assumed_value)

{
    "name": "C_ORDERED",
    "documentation": "Abstract parent of primitive constrainer classes based on `Ordered` base types, i.e. types like `Integer`, `Real`, and the Date/Time types. The model constraint is a List of Intervals, which may include point Intervals, and acts as a efficient and formally tractable representation of any number of point values and/or contiguous intervals of an ordered value domain.\n\nIn its simplest form, the constraint accessor returns just a single point `Interval<T>` object, representing a single value.\n\nThe next simplest form is a single proper `Interval <T>` (i.e. normal two-sided or half-open interval). The most complex form is a list of any combination of point and proper intervals.",
    "is_abstract": true,
    "ancestors": [
        "C_PRIMITIVE_OBJECT"
    ],
    "generic_parameter_defs": {
        "T": {
            "name": "T",
            "conforms_to_type": "Ordered"
        }
    },
    "properties": {
        "constraint": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "constraint",
            "documentation": "Constraint in the form of a List of Intervals of the parameter type T. Concrete types generated in descendants via template binding.",
            "type_def": {
                "container_type": "List",
                "type_def": {
                    "_type": "P_BMM_GENERIC_TYPE",
                    "root_type": "Interval",
                    "generic_parameters": [
                        "T"
                    ]
                }
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "default_value": {
            "_type": "P_BMM_SINGLE_PROPERTY_OPEN",
            "name": "default_value",
            "documentation": "Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.",
            "type": "T"
        },
        "assumed_value": {
            "_type": "P_BMM_SINGLE_PROPERTY_OPEN",
            "name": "assumed_value",
            "documentation": "Value to be assumed if none sent in data.",
            "type": "T"
        }
    },
    "functions": {
        "any_allowed": {
            "name": "any_allowed",
            "documentation": "True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.",
            "post_conditions": {
                "Post": "Result = constraint.is_empty"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_value_conforms_to": {
            "name": "c_value_conforms_to",
            "documentation": "True if `_other.any_allowed_` or else for every constraint in the `_constraint_` list there is a constraint in `_other.constraint_` that contains it.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_ORDERED"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_value_congruent_to": {
            "name": "c_value_congruent_to",
            "documentation": "True if the items in `_constraint_` are equal in number and identical pair-wise with those in `_other.constraint_`.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_ORDERED"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_ORDERED

Conformance semantics: C_ORDERED

The following functions implement those of the same names in C_PRIMITIVE_OBJECT and formally define the conformance of a node of a C_ORDERED descendant type in a specialised archetype to a corresponding node in a parent archetype, where 'corresponding' means a node found at the same or a congruent path and of the same AOM type.

c_value_conforms_to (other: C_ORDERED): Boolean
        -- True if this node is a strict subset of `other`
    do
        Result := other.any_allowed or
            for_all c:constraint |
                there_exists oc:other.constraint | oc.contains (c)
            end
    end

c_value_congruent_to (C_ORDERED): Boolean
        -- True if this node is the same as `other`
    do
        Result := constraint.count = other.constraint.count and
            for_all c:constraint |
                c.is_equal (other.constraint.i_th (constraint.index_of(c)))
            end
    end

C_INTEGER Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_INTEGER

Description

Constraint on instances of Integer.

Inherit

C_ORDERED

Attributes

Signature

Meaning

0..1
(effected)

constraint: List<Interval<Integer>>

Formal constraint on Integer, in the form of one or more Interval<Integer>.

To represent no constraint, use an empty list.

0..1
(effected)

default_value: Integer

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

0..1
(effected)

assumed_value: Real

Value to be assumed if none sent in data.

C_INTEGER

Constraint on instances of Integer.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT, C_PRIMITIVE_OBJECT, C_ORDERED

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

default_value: Integer [0..1]

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

assumed_value: Real [0..1]

Value to be assumed if none sent in data.

C_PRIMITIVE_OBJECT.is_enumerated_type_constraint: Boolean [0..1]

True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.

constraint: List<Interval<Integer>> [0..1]

Formal constraint on Integer, in the form of one or more Interval<Integer>.

To represent no constraint, use an empty list.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_PRIMITIVE_OBJECT.c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker lambda.

C_PRIMITIVE_OBJECT.c_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

C_ORDERED.any_allowed (): Boolean

Post: Result = constraint.is_empty [1..1]

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

(abstract) C_DEFINED_OBJECT.valid_value (
a_value: Any[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

(abstract) C_DEFINED_OBJECT.prototype_value (): Any [1..1]

Generate a prototype value from this constraint object.

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.has_assumed_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.constrained_typename (): String [1..1]

Generate name of native type that is constrained by this C_XXX type. For most types, it is the C_XXX typename without the C_, i.e. XXX. E.g. C_INTEGERInteger. For the date/time types the mapping is different.

C_ORDERED.c_value_conforms_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if other.any_allowed or else for every constraint in the constraint list there is a constraint in other.constraint that contains it.

C_ORDERED.c_value_congruent_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if the items in constraint are equal in number and identical pair-wise with those in other.constraint.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

C_PRIMITIVE_OBJECT.Inv_valid_assumed_value: valid_value (assumed_value)

{
    "name": "C_INTEGER",
    "documentation": "Constraint on instances of Integer.",
    "ancestors": [
        "C_ORDERED"
    ],
    "properties": {
        "constraint": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "constraint",
            "documentation": "Formal constraint on `Integer`, in the form of one or more `Interval<Integer>`.\n\nTo represent no constraint, use an empty list.",
            "type_def": {
                "container_type": "List",
                "type_def": {
                    "_type": "P_BMM_GENERIC_TYPE",
                    "root_type": "Interval",
                    "generic_parameters": [
                        "Integer"
                    ]
                }
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "default_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "default_value",
            "documentation": "Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.",
            "type": "Integer"
        },
        "assumed_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "assumed_value",
            "documentation": "Value to be assumed if none sent in data.",
            "type": "Real"
        }
    }
}
C_INTEGER

C_REAL Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_REAL

Description

Constraint on instances of Real.

Inherit

C_ORDERED

Attributes

Signature

Meaning

0..1
(effected)

constraint: List<Interval<Real>>

Formal constraint on Real, in the form of one or more Interval<Real>.

To represent no constraint, use an empty list.

0..1
(effected)

default_value: Real

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

0..1
(effected)

assumed_value: Real

Value to be assumed if none sent in data.

C_REAL

Constraint on instances of Real.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT, C_PRIMITIVE_OBJECT, C_ORDERED

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

default_value: Real [0..1]

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

assumed_value: Real [0..1]

Value to be assumed if none sent in data.

C_PRIMITIVE_OBJECT.is_enumerated_type_constraint: Boolean [0..1]

True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.

constraint: List<Interval<Real>> [0..1]

Formal constraint on Real, in the form of one or more Interval<Real>.

To represent no constraint, use an empty list.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_PRIMITIVE_OBJECT.c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker lambda.

C_PRIMITIVE_OBJECT.c_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

C_ORDERED.any_allowed (): Boolean

Post: Result = constraint.is_empty [1..1]

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

(abstract) C_DEFINED_OBJECT.valid_value (
a_value: Any[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

(abstract) C_DEFINED_OBJECT.prototype_value (): Any [1..1]

Generate a prototype value from this constraint object.

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.has_assumed_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.constrained_typename (): String [1..1]

Generate name of native type that is constrained by this C_XXX type. For most types, it is the C_XXX typename without the C_, i.e. XXX. E.g. C_INTEGERInteger. For the date/time types the mapping is different.

C_ORDERED.c_value_conforms_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if other.any_allowed or else for every constraint in the constraint list there is a constraint in other.constraint that contains it.

C_ORDERED.c_value_congruent_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if the items in constraint are equal in number and identical pair-wise with those in other.constraint.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

C_PRIMITIVE_OBJECT.Inv_valid_assumed_value: valid_value (assumed_value)

{
    "name": "C_REAL",
    "documentation": "Constraint on instances of Real.",
    "ancestors": [
        "C_ORDERED"
    ],
    "properties": {
        "constraint": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "constraint",
            "documentation": "Formal constraint on `Real`, in the form of one or more `Interval<Real>`.\n\nTo represent no constraint, use an empty list.",
            "type_def": {
                "container_type": "List",
                "type_def": {
                    "_type": "P_BMM_GENERIC_TYPE",
                    "root_type": "Interval",
                    "generic_parameters": [
                        "Real"
                    ]
                }
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "default_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "default_value",
            "documentation": "Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.",
            "type": "Real"
        },
        "assumed_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "assumed_value",
            "documentation": "Value to be assumed if none sent in data.",
            "type": "Real"
        }
    }
}
C_REAL

C_TEMPORAL Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_TEMPORAL<T> (abstract)

Description

Purpose Abstract parent of C_ORDERED types whose base type is an ISO date/time type.

Inherit

C_ORDERED

Attributes

Signature

Meaning

0..1

pattern_constraint: String

Optional alternative constraint in the form of a pattern based on ISO8601. See descendants for details.

Functions

Signature

Meaning

1..1
(abstract)

valid_pattern_constraint (
a_pattern: String[1]
): Boolean

True if a_pattern is a valid constraint. Define in concrete descendants.

1..1
(abstract)

valid_pattern_constraint_replacement (
a_pattern: String[1],
an_other_pattern: String[1]
): Boolean

Return True if a_pattern can be replaced by an_other_pattern in a specialised constraint. Define in concrete subtypes.

1..1
(redefined)

any_allowed (): Boolean

Post: Result = precursor and pattern_constraint.is_empty

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

1..1
(redefined)

c_value_conforms_to (
other: C_ORDERED[1]
): Boolean

True if precursor() or else other.pattern_constraint is empty, or else pattern_constraint is a valid (narrower) replacement for other.pattern_constraint.

1..1
(redefined)

c_value_congruent_to (
other: C_ORDERED[1]
): Boolean

True if precursor (other) and pattern_constraint ~ other.pattern_constraint, i.e. either both Void or else both non-Void and identical.

C_TEMPORAL<T> (abstract)

Purpose Abstract parent of C_ORDERED types whose base type is an ISO date/time type.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT, C_PRIMITIVE_OBJECT, C_ORDERED

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

C_ORDERED.default_value: T [0..1]

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

C_ORDERED.assumed_value: T [0..1]

Value to be assumed if none sent in data.

C_PRIMITIVE_OBJECT.is_enumerated_type_constraint: Boolean [0..1]

True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.

C_ORDERED.constraint: List<Interval<T>> [0..1]

Constraint in the form of a List of Intervals of the parameter type T. Concrete types generated in descendants via template binding.

pattern_constraint: String [0..1]

Optional alternative constraint in the form of a pattern based on ISO8601. See descendants for details.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_PRIMITIVE_OBJECT.c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker lambda.

C_PRIMITIVE_OBJECT.c_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

any_allowed (): Boolean

Post: Result = precursor and pattern_constraint.is_empty [1..1]

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

(abstract) C_DEFINED_OBJECT.valid_value (
a_value: Any[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

(abstract) C_DEFINED_OBJECT.prototype_value (): Any [1..1]

Generate a prototype value from this constraint object.

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.has_assumed_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.constrained_typename (): String [1..1]

Generate name of native type that is constrained by this C_XXX type. For most types, it is the C_XXX typename without the C_, i.e. XXX. E.g. C_INTEGERInteger. For the date/time types the mapping is different.

c_value_conforms_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if precursor() or else other.pattern_constraint is empty, or else pattern_constraint is a valid (narrower) replacement for other.pattern_constraint.

c_value_congruent_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if precursor (other) and pattern_constraint ~ other.pattern_constraint, i.e. either both Void or else both non-Void and identical.

(abstract) valid_pattern_constraint (
a_pattern: String[1]
): Boolean [1..1]

True if a_pattern is a valid constraint. Define in concrete descendants.

(abstract) valid_pattern_constraint_replacement (
a_pattern: String[1],
an_other_pattern: String[1]
): Boolean [1..1]

Return True if a_pattern can be replaced by an_other_pattern in a specialised constraint. Define in concrete subtypes.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

C_PRIMITIVE_OBJECT.Inv_valid_assumed_value: valid_value (assumed_value)

{
    "name": "C_TEMPORAL",
    "documentation": "Purpose Abstract parent of `C_ORDERED` types whose base type is an ISO date/time type.",
    "is_abstract": true,
    "ancestors": [
        "C_ORDERED"
    ],
    "generic_parameter_defs": {
        "T": {
            "name": "T",
            "conforms_to_type": "Temporal"
        }
    },
    "properties": {
        "pattern_constraint": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "pattern_constraint",
            "documentation": "Optional alternative constraint in the form of a pattern based on ISO8601. See descendants for details.",
            "type": "String"
        }
    },
    "functions": {
        "valid_pattern_constraint": {
            "name": "valid_pattern_constraint",
            "documentation": "True if `_a_pattern_` is a valid constraint. Define in concrete descendants.",
            "is_abstract": true,
            "parameters": {
                "a_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_pattern",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "valid_pattern_constraint_replacement": {
            "name": "valid_pattern_constraint_replacement",
            "documentation": "Return True if `_a_pattern_` can be replaced by `_an_other_pattern_` in a specialised constraint. Define in concrete subtypes.",
            "is_abstract": true,
            "parameters": {
                "a_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_pattern",
                    "type": "String"
                },
                "an_other_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "an_other_pattern",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "any_allowed": {
            "name": "any_allowed",
            "documentation": "True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.",
            "post_conditions": {
                "Post": "Result = precursor and pattern_constraint.is_empty"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_value_conforms_to": {
            "name": "c_value_conforms_to",
            "documentation": "True if `precursor()` or else `_other.pattern_constraint_` is empty, or else `_pattern_constraint_` is a valid (narrower) replacement for `_other.pattern_constraint_`.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_ORDERED"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_value_congruent_to": {
            "name": "c_value_congruent_to",
            "documentation": "True if `precursor (other)` and `_pattern_constraint_ ~ _other.pattern_constraint_`, i.e. either both `Void` or else both non-`Void` and identical.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_ORDERED"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_TEMPORAL

C_TEMPORAL_DEFINITIONS Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_TEMPORAL_DEFINITIONS

Description

Definitions related to C_TEMPORAL constraints.

Attributes

Signature

Meaning

1..1

valid_date_constraint_patterns: List<String>

List of allowed date constraints. Contains the values:

"YYYY-MM-DD"    -- full date required
"YYYY-MM-??"    -- day optional
"YYYY-MM-XX"    -- day prohibited
"YYYY-??-??"    -- any partial or full date
"YYYY-??-XX"    -- day prohibited
"YYYY-XX-XX"    -- only prohibited

1..1

valid_date_constraint_replacements: Hash<String,List<String>>

List of allowed date constraint replacements e.g. in specialised archetype. Contains the values:

"YYYY-MM-DD": [],

"YYYY-MM-??": ["YYYY-MM-DD",
               "YYYY-MM-XX"],

"YYYY-MM-XX": [],

"YYYY-??-??": ["YYYY-MM-??",
               "YYYY-MM-DD",
               "YYYY-MM-XX",
               "YYYY-??-XX",
               "YYYY-XX-XX"],

"YYYY-??-XX": ["YYYY-MM-XX",
              "YYYY-XX-XX"],

"YYYY-XX-XX": []

In the above, an empty list value indicates no replacements possible.

1..1

valid_time_constraint_patterns: List<String>

List of allowed time constraints. Contains the values:

"HH:MM:SS"    -- full time required
"HH:MM:??"    -- seconds optional
"HH:MM:XX"    -- minutes required, seconds prohibited
"HH:??:??"    -- minutes and seconds optional
"HH:??:XX"    -- minutes optional, seconds prohibited

1..1

valid_time_constraint_replacements: Hash<String,List<String>>

List of allowed time constraint replacements e.g. in specialised archetype. Contains the values:

"HH:MM:SS": [],

"HH:MM:??": ["HH:MM:SS",
             "HH:MM:XX"],

"HH:MM:XX": [],

"HH-??-??": ["HH:MM:??",
             "HH:MM:SS",
             "HH:MM:XX",
             "HH:??:XX"],

"HH-??-XX": ["HH:MM:XX"]

In the above, an empty list value indicates no replacements possible.

1..1

valid_date_time_constraint_patterns: List<String>

List of allowed date/time constraints. Contains the values:

"YYYY-MM-DDTHH:MM:SS"    -- full date/time required
"YYYY-MM-DDTHH:MM:??"    -- seconds optional
"YYYY-MM-DDTHH:MM:XX"    -- seconds prohibited
"YYYY-MM-DDTHH:??:??"    -- minutes and seconds optional
"YYYY-MM-DDTHH:??:XX"    -- minutes optional, seconds prohibited
"YYYY-??-??T??:??:??"    -- any date/time ok

1..1

valid_date_time_constraint_replacements: Hash<String,List<String>>

List of allowed date/time constraint replacements e.g. in specialised archetype. Contains the values:

"YYYY-MM-DDTHH:MM:SS": [],

"YYYY-MM-DDTHH:MM:??": ["YYYY-MM-DDTHH:MM:SS",
                        "YYYY-MM-DDTHH:MM:XX"],

"YYYY-MM-DDTHH:MM:XX": [],

"YYYY-MM-DDTHH:??:??": ["YYYY-MM-DDTHH:??:XX",
                        "YYYY-MM-DDTHH:MM:SS",
                        "YYYY-MM-DDTHH:MM:??",
                        "YYYY-MM-DDTHH:MM:XX"],

"YYYY-MM-DDTHH:??:XX": ["YYYY-MM-DDTHH:MM:XX"],

"YYYY-??-??T??:??:??": ["YYYY-MM-DDTHH:MM:SS",
                        "YYYY-MM-DDTHH:MM:??",
                        "YYYY-MM-DDTHH:MM:XX",
                        "YYYY-MM-DDTHH:??:??",
                        "YYYY-MM-DDTHH:??:XX"]

Functions

Signature

Meaning

1..1

valid_duration_constraint_replacement (
a_dur: String[1],
other_dur: String[1]
): Boolean

True if ISO8601 duration string other_dur contains every character element in a_dur. For example: 'PYD' (period with year and days only) conforms to 'PYMD', but doesn’t conform to 'PY'.

1..1

valid_iso8601_date_constraint_pattern (
s: String[1]
): Boolean

True if string literal like "yyyy-MM-dd" containing "XX" or "??" in MM or dd slots in pattern constraint is in valid_date_constraint_patterns.

1..1

valid_iso8601_time_constraint_pattern (
s: String[1]
): Boolean

True if string literal like "hh:mm:ss[.ssss]" containing "XX" or "??" in mm or ss slots in pattern constraint is in valid_time_constraint_patterns.

1..1

valid_iso8601_date_time_constraint_pattern (
s: String[1]
): Boolean

True if string literal in form "yyyy-MM-dd hh:mm:ss[.ssss]" containing "XX" or "??" in variable slots in pattern constraint is in valid_date_time_constraint_patterns.

1..1

valid_iso8601_duration_constraint_pattern (
s: String[1]
): Boolean

True if string in form P[Y|y][M|m][W|w][D|d][T[H|h][M|m][S|s]] (note: allowing 'W' to be mixed in is an openEHR deviation of ISO 8601).

C_TEMPORAL_DEFINITIONS

Definitions related to C_TEMPORAL constraints.

Attributes

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

List of allowed date constraints. Contains the values:

"YYYY-MM-DD"    -- full date required
"YYYY-MM-??"    -- day optional
"YYYY-MM-XX"    -- day prohibited
"YYYY-??-??"    -- any partial or full date
"YYYY-??-XX"    -- day prohibited
"YYYY-XX-XX"    -- only prohibited

valid_date_constraint_replacements: Hash<String,List<String>> [1..1]

List of allowed date constraint replacements e.g. in specialised archetype. Contains the values:

"YYYY-MM-DD": [],

"YYYY-MM-??": ["YYYY-MM-DD",
               "YYYY-MM-XX"],

"YYYY-MM-XX": [],

"YYYY-??-??": ["YYYY-MM-??",
               "YYYY-MM-DD",
               "YYYY-MM-XX",
               "YYYY-??-XX",
               "YYYY-XX-XX"],

"YYYY-??-XX": ["YYYY-MM-XX",
              "YYYY-XX-XX"],

"YYYY-XX-XX": []

In the above, an empty list value indicates no replacements possible.

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

List of allowed time constraints. Contains the values:

"HH:MM:SS"    -- full time required
"HH:MM:??"    -- seconds optional
"HH:MM:XX"    -- minutes required, seconds prohibited
"HH:??:??"    -- minutes and seconds optional
"HH:??:XX"    -- minutes optional, seconds prohibited

valid_time_constraint_replacements: Hash<String,List<String>> [1..1]

List of allowed time constraint replacements e.g. in specialised archetype. Contains the values:

"HH:MM:SS": [],

"HH:MM:??": ["HH:MM:SS",
             "HH:MM:XX"],

"HH:MM:XX": [],

"HH-??-??": ["HH:MM:??",
             "HH:MM:SS",
             "HH:MM:XX",
             "HH:??:XX"],

"HH-??-XX": ["HH:MM:XX"]

In the above, an empty list value indicates no replacements possible.

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

List of allowed date/time constraints. Contains the values:

"YYYY-MM-DDTHH:MM:SS"    -- full date/time required
"YYYY-MM-DDTHH:MM:??"    -- seconds optional
"YYYY-MM-DDTHH:MM:XX"    -- seconds prohibited
"YYYY-MM-DDTHH:??:??"    -- minutes and seconds optional
"YYYY-MM-DDTHH:??:XX"    -- minutes optional, seconds prohibited
"YYYY-??-??T??:??:??"    -- any date/time ok

valid_date_time_constraint_replacements: Hash<String,List<String>> [1..1]

List of allowed date/time constraint replacements e.g. in specialised archetype. Contains the values:

"YYYY-MM-DDTHH:MM:SS": [],

"YYYY-MM-DDTHH:MM:??": ["YYYY-MM-DDTHH:MM:SS",
                        "YYYY-MM-DDTHH:MM:XX"],

"YYYY-MM-DDTHH:MM:XX": [],

"YYYY-MM-DDTHH:??:??": ["YYYY-MM-DDTHH:??:XX",
                        "YYYY-MM-DDTHH:MM:SS",
                        "YYYY-MM-DDTHH:MM:??",
                        "YYYY-MM-DDTHH:MM:XX"],

"YYYY-MM-DDTHH:??:XX": ["YYYY-MM-DDTHH:MM:XX"],

"YYYY-??-??T??:??:??": ["YYYY-MM-DDTHH:MM:SS",
                        "YYYY-MM-DDTHH:MM:??",
                        "YYYY-MM-DDTHH:MM:XX",
                        "YYYY-MM-DDTHH:??:??",
                        "YYYY-MM-DDTHH:??:XX"]

Functions

valid_duration_constraint_replacement (
a_dur: String[1],
other_dur: String[1]
): Boolean [1..1]

True if ISO8601 duration string other_dur contains every character element in a_dur. For example: 'PYD' (period with year and days only) conforms to 'PYMD', but doesn’t conform to 'PY'.

valid_iso8601_date_constraint_pattern (
s: String[1]
): Boolean [1..1]

True if string literal like "yyyy-MM-dd" containing "XX" or "??" in MM or dd slots in pattern constraint is in valid_date_constraint_patterns.

valid_iso8601_time_constraint_pattern (
s: String[1]
): Boolean [1..1]

True if string literal like "hh:mm:ss[.ssss]" containing "XX" or "??" in mm or ss slots in pattern constraint is in valid_time_constraint_patterns.

valid_iso8601_date_time_constraint_pattern (
s: String[1]
): Boolean [1..1]

True if string literal in form "yyyy-MM-dd hh:mm:ss[.ssss]" containing "XX" or "??" in variable slots in pattern constraint is in valid_date_time_constraint_patterns.

valid_iso8601_duration_constraint_pattern (
s: String[1]
): Boolean [1..1]

True if string in form P[Y|y][M|m][W|w][D|d][T[H|h][M|m][S|s]] (note: allowing 'W' to be mixed in is an openEHR deviation of ISO 8601).

{
    "name": "C_TEMPORAL_DEFINITIONS",
    "documentation": "Definitions related to `C_TEMPORAL` constraints.",
    "properties": {
        "valid_date_constraint_patterns": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "valid_date_constraint_patterns",
            "documentation": "List of allowed date constraints. Contains the values:\n\n```\n\"YYYY-MM-DD\"    -- full date required\n\"YYYY-MM-??\"    -- day optional\n\"YYYY-MM-XX\"    -- day prohibited\n\"YYYY-??-??\"    -- any partial or full date\n\"YYYY-??-XX\"    -- day prohibited\n\"YYYY-XX-XX\"    -- only prohibited\n```",
            "is_mandatory": true,
            "type_def": {
                "container_type": "List",
                "type": "String"
            },
            "cardinality": {
                "lower": 1,
                "upper_unbounded": true
            }
        },
        "valid_date_constraint_replacements": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "valid_date_constraint_replacements",
            "documentation": "List of allowed date constraint replacements e.g. in specialised archetype. Contains the values:\n\n----\n\"YYYY-MM-DD\": [],\n\n\"YYYY-MM-??\": [\"YYYY-MM-DD\", \n               \"YYYY-MM-XX\"],\n\n\"YYYY-MM-XX\": [],\n\n\"YYYY-??-??\": [\"YYYY-MM-??\",\n               \"YYYY-MM-DD\",\n               \"YYYY-MM-XX\",\n               \"YYYY-??-XX\",\n               \"YYYY-XX-XX\"],\n\n\"YYYY-??-XX\": [\"YYYY-MM-XX\", \n              \"YYYY-XX-XX\"],\n\n\"YYYY-XX-XX\": []\n----\n\nIn the above, an empty list value indicates no replacements possible.",
            "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": "List",
                        "generic_parameters": [
                            "String"
                        ]
                    }
                }
            }
        },
        "valid_time_constraint_patterns": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "valid_time_constraint_patterns",
            "documentation": "List of allowed time constraints. Contains the values:\n\n```\n\"HH:MM:SS\"    -- full time required\n\"HH:MM:??\"    -- seconds optional\n\"HH:MM:XX\"    -- minutes required, seconds prohibited\n\"HH:??:??\"    -- minutes and seconds optional\n\"HH:??:XX\"    -- minutes optional, seconds prohibited\n```",
            "is_mandatory": true,
            "type_def": {
                "container_type": "List",
                "type": "String"
            },
            "cardinality": {
                "lower": 1,
                "upper_unbounded": true
            }
        },
        "valid_time_constraint_replacements": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "valid_time_constraint_replacements",
            "documentation": "List of allowed time constraint replacements e.g. in specialised archetype. Contains the values:\n\n----\n\"HH:MM:SS\": [],\n\n\"HH:MM:??\": [\"HH:MM:SS\",\n             \"HH:MM:XX\"],\n\n\"HH:MM:XX\": [],\n\n\"HH-??-??\": [\"HH:MM:??\",\n             \"HH:MM:SS\",\n             \"HH:MM:XX\",\n             \"HH:??:XX\"],\n\n\"HH-??-XX\": [\"HH:MM:XX\"]\n----\n\nIn the above, an empty list value indicates no replacements possible.",
            "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": "List",
                        "generic_parameters": [
                            "String"
                        ]
                    }
                }
            }
        },
        "valid_date_time_constraint_patterns": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "valid_date_time_constraint_patterns",
            "documentation": "List of allowed date/time constraints. Contains the values:\n\n```\n\"YYYY-MM-DDTHH:MM:SS\"    -- full date/time required\n\"YYYY-MM-DDTHH:MM:??\"    -- seconds optional\n\"YYYY-MM-DDTHH:MM:XX\"    -- seconds prohibited\n\"YYYY-MM-DDTHH:??:??\"    -- minutes and seconds optional\n\"YYYY-MM-DDTHH:??:XX\"    -- minutes optional, seconds prohibited\n\"YYYY-??-??T??:??:??\"    -- any date/time ok\n```",
            "is_mandatory": true,
            "type_def": {
                "container_type": "List",
                "type": "String"
            },
            "cardinality": {
                "lower": 1,
                "upper_unbounded": true
            }
        },
        "valid_date_time_constraint_replacements": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "valid_date_time_constraint_replacements",
            "documentation": "List of allowed date/time constraint replacements e.g. in specialised archetype. Contains the values:\n\n----\n\"YYYY-MM-DDTHH:MM:SS\": [],\n\n\"YYYY-MM-DDTHH:MM:??\": [\"YYYY-MM-DDTHH:MM:SS\",\n                        \"YYYY-MM-DDTHH:MM:XX\"],\n\n\"YYYY-MM-DDTHH:MM:XX\": [],\n\n\"YYYY-MM-DDTHH:??:??\": [\"YYYY-MM-DDTHH:??:XX\",\n                        \"YYYY-MM-DDTHH:MM:SS\",\n                        \"YYYY-MM-DDTHH:MM:??\",\n                        \"YYYY-MM-DDTHH:MM:XX\"],\n\n\"YYYY-MM-DDTHH:??:XX\": [\"YYYY-MM-DDTHH:MM:XX\"],\n\n\"YYYY-??-??T??:??:??\": [\"YYYY-MM-DDTHH:MM:SS\",\n                        \"YYYY-MM-DDTHH:MM:??\",\n                        \"YYYY-MM-DDTHH:MM:XX\",\n                        \"YYYY-MM-DDTHH:??:??\",\n                        \"YYYY-MM-DDTHH:??:XX\"]\n----",
            "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": "List",
                        "generic_parameters": [
                            "String"
                        ]
                    }
                }
            }
        }
    },
    "functions": {
        "valid_duration_constraint_replacement": {
            "name": "valid_duration_constraint_replacement",
            "documentation": "True if ISO8601 duration string `_other_dur_` contains every character element in `_a_dur_`. For example: 'PYD' (period with year and days only) conforms to 'PYMD', but doesn't conform to 'PY'.",
            "parameters": {
                "a_dur": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_dur",
                    "type": "String"
                },
                "other_dur": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other_dur",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "valid_iso8601_date_constraint_pattern": {
            "name": "valid_iso8601_date_constraint_pattern",
            "documentation": "True if string literal like `\"yyyy-MM-dd\"` containing `\"XX\"` or `\"??\"` in `MM` or `dd` slots in pattern constraint is in `_valid_date_constraint_patterns_`.",
            "parameters": {
                "s": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "s",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "valid_iso8601_time_constraint_pattern": {
            "name": "valid_iso8601_time_constraint_pattern",
            "documentation": "True if string literal like `\"hh:mm:ss[.ssss]\"` containing `\"XX\"` or `\"??\"` in `mm` or `ss` slots in pattern constraint is in `_valid_time_constraint_patterns_`.",
            "parameters": {
                "s": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "s",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "valid_iso8601_date_time_constraint_pattern": {
            "name": "valid_iso8601_date_time_constraint_pattern",
            "documentation": "True if string literal in form `\"yyyy-MM-dd hh:mm:ss[.ssss]\"` containing `\"XX\"` or `\"??\"` in variable slots in pattern constraint is in `_valid_date_time_constraint_patterns_`.",
            "parameters": {
                "s": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "s",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "valid_iso8601_duration_constraint_pattern": {
            "name": "valid_iso8601_duration_constraint_pattern",
            "documentation": "True if string in form `P[Y|y][M|m][W|w][D|d][T[H|h][M|m][S|s]]` (note: allowing 'W' to be mixed in is an openEHR deviation of ISO 8601).",
            "parameters": {
                "s": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "s",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_TEMPORAL_DEFINITIONS

Conformance semantics: C_TEMPORAL

The following functions redefine those of the same names in C_ORDERED and formally define the conformance of a node of a C_TEMPORAL descendant type in a specialised archetype to a corresponding node in a parent archetype, where 'corresponding' means a node found at the same or a congruent path and of the same AOM type.

c_value_conforms_to (other: C_TEMPORAL): Boolean
        -- True if this node is a strict subset of `other`
    do
        Result := precursor (other) and
            other.pattern_constraint.is_empty or
                not pattern_constraint.is_empty and then
                valid_pattern_constraint_replacement (pattern_constraint, other.pattern_constraint)
    end

c_value_congruent_to (other: C_TEMPORAL): Boolean
        -- True if this node's value constraint is the same as that of `other`
    do
        Result := precursor (other) and
            pattern_constraint ~ other.pattern_constraint
    end

C_DATE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_DATE

Description

Constraint on instances representing dates in the form either of a set of validity values, or else date ranges based on the C_ORDERED list constraint.

There is no validity flag for year, since it must always be by definition mandatory in order to have a sensible date at all. Syntax expressions of instances of this class include "YYYY-??-??" (date with optional month and day).

Inherit

C_TEMPORAL

Attributes

Signature

Meaning

0..1
(redefined)

constraint: List<Interval<Iso8601_date>>

Formal constraint on the assumed primitive Iso8601_date type, in the form of one or more Interval<Iso8601_date>.

For a pattern constraint or no constraint, use an empty list.

0..1
(redefined)

default_value: Iso8601_date

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

0..1
(redefined)

assumed_value: Iso8601_date

Value to be assumed if none sent in data.

Functions

Signature

Meaning

1..1

month_validity (): VALIDITY_KIND

Validity of month in constrained date.

1..1

day_validity (): VALIDITY_KIND

Validity of day in constrained date.

1..1
(effected)

valid_pattern_constraint (
a_pattern: String[1]
): Boolean

Return valid_iso8601_date_constraint_pattern (a_pattern)

1..1
(effected)

valid_pattern_constraint_replacement (
a_pattern: String[1],
an_other_pattern: String[1]
): Boolean

Return valid_date_constraint_replacements.has(an_other_pattern.as_upper) and then valid_date_constraint_replacements.item (an_other_pattern.as_upper).has (a_pattern.as_upper).

Invariants

Pattern_validity: pattern /= Void implies valid_iso8601_date_constraint_pattern(pattern)

C_DATE

Constraint on instances representing dates in the form either of a set of validity values, or else date ranges based on the C_ORDERED list constraint.

There is no validity flag for year, since it must always be by definition mandatory in order to have a sensible date at all. Syntax expressions of instances of this class include "YYYY-??-??" (date with optional month and day).

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT, C_PRIMITIVE_OBJECT, C_ORDERED, C_TEMPORAL

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

default_value: Iso8601_date [0..1]

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

assumed_value: Iso8601_date [0..1]

Value to be assumed if none sent in data.

C_PRIMITIVE_OBJECT.is_enumerated_type_constraint: Boolean [0..1]

True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.

constraint: List<Interval<Iso8601_date>> [0..1]

Formal constraint on the assumed primitive Iso8601_date type, in the form of one or more Interval<Iso8601_date>.

For a pattern constraint or no constraint, use an empty list.

C_TEMPORAL.pattern_constraint: String [0..1]

Optional alternative constraint in the form of a pattern based on ISO8601. See descendants for details.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_PRIMITIVE_OBJECT.c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker lambda.

C_PRIMITIVE_OBJECT.c_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

C_TEMPORAL.any_allowed (): Boolean

Post: Result = precursor and pattern_constraint.is_empty [1..1]

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

(abstract) C_DEFINED_OBJECT.valid_value (
a_value: Any[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

(abstract) C_DEFINED_OBJECT.prototype_value (): Any [1..1]

Generate a prototype value from this constraint object.

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.has_assumed_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.constrained_typename (): String [1..1]

Generate name of native type that is constrained by this C_XXX type. For most types, it is the C_XXX typename without the C_, i.e. XXX. E.g. C_INTEGERInteger. For the date/time types the mapping is different.

C_TEMPORAL.c_value_conforms_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if precursor() or else other.pattern_constraint is empty, or else pattern_constraint is a valid (narrower) replacement for other.pattern_constraint.

C_TEMPORAL.c_value_congruent_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if precursor (other) and pattern_constraint ~ other.pattern_constraint, i.e. either both Void or else both non-Void and identical.

valid_pattern_constraint (
a_pattern: String[1]
): Boolean [1..1]

Return valid_iso8601_date_constraint_pattern (a_pattern)

valid_pattern_constraint_replacement (
a_pattern: String[1],
an_other_pattern: String[1]
): Boolean [1..1]

Return valid_date_constraint_replacements.has(an_other_pattern.as_upper) and then valid_date_constraint_replacements.item (an_other_pattern.as_upper).has (a_pattern.as_upper).

month_validity (): VALIDITY_KIND [1..1]

Validity of month in constrained date.

day_validity (): VALIDITY_KIND [1..1]

Validity of day in constrained date.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

C_PRIMITIVE_OBJECT.Inv_valid_assumed_value: valid_value (assumed_value)

Pattern_validity: pattern /= Void implies valid_iso8601_date_constraint_pattern(pattern)

{
    "name": "C_DATE",
    "documentation": "Constraint on instances representing dates in the form either of a set of validity values, or else date ranges based on the `C_ORDERED` list constraint. \n\nThere is no validity flag for `_year_`, since it must always be by definition mandatory in order to have a sensible date at all. Syntax expressions of instances of this class include `\"YYYY-??-??\"` (date with optional month and day).",
    "ancestors": [
        "C_TEMPORAL"
    ],
    "properties": {
        "constraint": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "constraint",
            "documentation": "Formal constraint on the assumed primitive `Iso8601_date` type, in the form of one or more `Interval<Iso8601_date>`.\n\nFor a pattern constraint or no constraint, use an empty list.",
            "type_def": {
                "container_type": "List",
                "type_def": {
                    "_type": "P_BMM_GENERIC_TYPE",
                    "root_type": "Interval",
                    "generic_parameters": [
                        "Iso8601_date"
                    ]
                }
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "default_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "default_value",
            "documentation": "Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.",
            "type": "Iso8601_date"
        },
        "assumed_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "assumed_value",
            "documentation": "Value to be assumed if none sent in data.",
            "type": "Iso8601_date"
        }
    },
    "functions": {
        "month_validity": {
            "name": "month_validity",
            "documentation": "Validity of month in constrained date.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "VALIDITY_KIND"
            }
        },
        "day_validity": {
            "name": "day_validity",
            "documentation": "Validity of day in constrained date.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "VALIDITY_KIND"
            }
        },
        "valid_pattern_constraint": {
            "name": "valid_pattern_constraint",
            "documentation": "Return `valid_iso8601_date_constraint_pattern (a_pattern)` ",
            "parameters": {
                "a_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_pattern",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "valid_pattern_constraint_replacement": {
            "name": "valid_pattern_constraint_replacement",
            "documentation": "Return `valid_date_constraint_replacements.has(an_other_pattern.as_upper) and then \nvalid_date_constraint_replacements.item (an_other_pattern.as_upper).has (a_pattern.as_upper)`.",
            "parameters": {
                "a_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_pattern",
                    "type": "String"
                },
                "an_other_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "an_other_pattern",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    },
    "invariants": {
        "Pattern_validity": "pattern /= Void implies valid_iso8601_date_constraint_pattern(pattern)"
    }
}
C_DATE

C_TIME Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_TIME

Description

Constraint on instances representing times in the form either of a set of validity values, or else time ranges based on the C_ORDERED list constraint.

There is no validity flag for hour, since it must always be by definition mandatory in order to have a sensible time at all. Syntax expressions of instances of this class include "HH:??:xx" (time with optional minutes and seconds not allowed).

Inherit

C_TEMPORAL

Attributes

Signature

Meaning

0..1
(redefined)

constraint: List<Interval<Iso8601_time>>

Formal constraint on the assumed primitive Iso8601_time type, in the form of one or more Interval<Iso8601_time>.

For a pattern constraint or no constraint, use an empty list.

0..1
(redefined)

default_value: Iso8601_time

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

0..1
(redefined)

assumed_value: Iso8601_time

Value to be assumed if none sent in data.

Functions

Signature

Meaning

1..1

minute_validity (): VALIDITY_KIND

Validity of minute in constrained time.

1..1

second_validity (): VALIDITY_KIND

Validity of second in constrained time.

1..1

millisecond_validity (): VALIDITY_KIND

Validity of millisecond in constrained time.

1..1

timezone_validity (): VALIDITY_KIND

Validity of timezone in constrained time.

1..1
(effected)

valid_pattern_constraint (
a_pattern: String[1]
): Boolean

Return valid_iso8601_time_constraint_pattern (a_pattern)

1..1
(effected)

valid_pattern_constraint_replacement (
a_pattern: String[1],
an_other_pattern: String[1]
): Boolean

Return valid_time_constraint_replacements.has(an_other_pattern.as_upper) and then valid_time_constraint_replacements.item (an_other_pattern.as_upper).has (a_pattern.as_upper).

Invariants

Pattern_validity: pattern /= Void implies valid_iso8601_time_constraint_pattern (pattern)

C_TIME

Constraint on instances representing times in the form either of a set of validity values, or else time ranges based on the C_ORDERED list constraint.

There is no validity flag for hour, since it must always be by definition mandatory in order to have a sensible time at all. Syntax expressions of instances of this class include "HH:??:xx" (time with optional minutes and seconds not allowed).

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT, C_PRIMITIVE_OBJECT, C_ORDERED, C_TEMPORAL

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

default_value: Iso8601_time [0..1]

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

assumed_value: Iso8601_time [0..1]

Value to be assumed if none sent in data.

C_PRIMITIVE_OBJECT.is_enumerated_type_constraint: Boolean [0..1]

True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.

constraint: List<Interval<Iso8601_time>> [0..1]

Formal constraint on the assumed primitive Iso8601_time type, in the form of one or more Interval<Iso8601_time>.

For a pattern constraint or no constraint, use an empty list.

C_TEMPORAL.pattern_constraint: String [0..1]

Optional alternative constraint in the form of a pattern based on ISO8601. See descendants for details.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_PRIMITIVE_OBJECT.c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker lambda.

C_PRIMITIVE_OBJECT.c_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

C_TEMPORAL.any_allowed (): Boolean

Post: Result = precursor and pattern_constraint.is_empty [1..1]

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

(abstract) C_DEFINED_OBJECT.valid_value (
a_value: Any[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

(abstract) C_DEFINED_OBJECT.prototype_value (): Any [1..1]

Generate a prototype value from this constraint object.

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.has_assumed_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.constrained_typename (): String [1..1]

Generate name of native type that is constrained by this C_XXX type. For most types, it is the C_XXX typename without the C_, i.e. XXX. E.g. C_INTEGERInteger. For the date/time types the mapping is different.

C_TEMPORAL.c_value_conforms_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if precursor() or else other.pattern_constraint is empty, or else pattern_constraint is a valid (narrower) replacement for other.pattern_constraint.

C_TEMPORAL.c_value_congruent_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if precursor (other) and pattern_constraint ~ other.pattern_constraint, i.e. either both Void or else both non-Void and identical.

valid_pattern_constraint (
a_pattern: String[1]
): Boolean [1..1]

Return valid_iso8601_time_constraint_pattern (a_pattern)

valid_pattern_constraint_replacement (
a_pattern: String[1],
an_other_pattern: String[1]
): Boolean [1..1]

Return valid_time_constraint_replacements.has(an_other_pattern.as_upper) and then valid_time_constraint_replacements.item (an_other_pattern.as_upper).has (a_pattern.as_upper).

minute_validity (): VALIDITY_KIND [1..1]

Validity of minute in constrained time.

second_validity (): VALIDITY_KIND [1..1]

Validity of second in constrained time.

millisecond_validity (): VALIDITY_KIND [1..1]

Validity of millisecond in constrained time.

timezone_validity (): VALIDITY_KIND [1..1]

Validity of timezone in constrained time.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

C_PRIMITIVE_OBJECT.Inv_valid_assumed_value: valid_value (assumed_value)

Pattern_validity: pattern /= Void implies valid_iso8601_time_constraint_pattern (pattern)

{
    "name": "C_TIME",
    "documentation": "Constraint on instances representing times in the form either of a set of validity values, or else time ranges based on the `C_ORDERED` list constraint. \n\nThere is no validity flag for `_hour_`, since it must always be by definition mandatory in order to have a sensible time at all. Syntax expressions of instances of this class include `\"HH:??:xx\"` (time with optional minutes and seconds not allowed).",
    "ancestors": [
        "C_TEMPORAL"
    ],
    "properties": {
        "constraint": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "constraint",
            "documentation": "Formal constraint on the assumed primitive `Iso8601_time` type, in the form of one or more `Interval<Iso8601_time>`.\n\nFor a pattern constraint or no constraint, use an empty list.",
            "type_def": {
                "container_type": "List",
                "type_def": {
                    "_type": "P_BMM_GENERIC_TYPE",
                    "root_type": "Interval",
                    "generic_parameters": [
                        "Iso8601_time"
                    ]
                }
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "default_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "default_value",
            "documentation": "Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.",
            "type": "Iso8601_time"
        },
        "assumed_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "assumed_value",
            "documentation": "Value to be assumed if none sent in data.",
            "type": "Iso8601_time"
        }
    },
    "functions": {
        "minute_validity": {
            "name": "minute_validity",
            "documentation": "Validity of minute in constrained time.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "VALIDITY_KIND"
            }
        },
        "second_validity": {
            "name": "second_validity",
            "documentation": "Validity of second in constrained time.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "VALIDITY_KIND"
            }
        },
        "millisecond_validity": {
            "name": "millisecond_validity",
            "documentation": "Validity of millisecond in constrained time.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "VALIDITY_KIND"
            }
        },
        "timezone_validity": {
            "name": "timezone_validity",
            "documentation": "Validity of timezone in constrained time.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "VALIDITY_KIND"
            }
        },
        "valid_pattern_constraint": {
            "name": "valid_pattern_constraint",
            "documentation": "Return `valid_iso8601_time_constraint_pattern (a_pattern)` ",
            "parameters": {
                "a_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_pattern",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "valid_pattern_constraint_replacement": {
            "name": "valid_pattern_constraint_replacement",
            "documentation": "Return `valid_time_constraint_replacements.has(an_other_pattern.as_upper) and then \nvalid_time_constraint_replacements.item (an_other_pattern.as_upper).has (a_pattern.as_upper)`.",
            "parameters": {
                "a_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_pattern",
                    "type": "String"
                },
                "an_other_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "an_other_pattern",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    },
    "invariants": {
        "Pattern_validity": "pattern /= Void implies valid_iso8601_time_constraint_pattern (pattern)"
    }
}
C_TIME

C_DATE_TIME Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_DATE_TIME

Description

Constraint on instances representing date/times, i.e. instants in time.

There is no validity flag for year, since it must always be by definition mandatory in order to have a sensible date/time at all. Syntax expressions of instances of this class include "YYYY-MM-DDT??:??:??" (date/time with optional time) and "YYYY-MMDDTHH:MM:xx" (date/time, seconds not allowed).

Inherit

C_TEMPORAL

Attributes

Signature

Meaning

0..1
(redefined)

constraint: List<Interval<Iso8601_date_time>>

Formal constraint on the assumed primitive Iso8601_date_time type, in the form of one or more Interval<Iso8601_date_time>.

For a pattern constraint or no constraint, use an empty list.

0..1
(redefined)

default_value: Iso8601_date_time

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

0..1
(redefined)

assumed_value: Iso8601_date_time

Value to be assumed if none sent in data.

Functions

Signature

Meaning

1..1
(effected)

valid_pattern_constraint (
a_pattern: String[1]
): Boolean

Return valid_iso8601_date_time_constraint_pattern (a_pattern)

1..1
(effected)

valid_pattern_constraint_replacement (
a_pattern: String[1],
an_other_pattern: String[1]
): Boolean

Return valid_date_time_constraint_replacements.has(an_other_pattern.as_upper) and then valid_date_time_constraint_replacements.item (an_other_pattern.as_upper).has (a_pattern.as_upper).

1..1

month_validity (): VALIDITY_KIND

Validity of month in constrained date.

1..1

day_validity (): VALIDITY_KIND

Validity of day in constrained date.

1..1

minute_validity (): VALIDITY_KIND

Validity of minute in constrained time.

1..1

second_validity (): VALIDITY_KIND

Validity of second in constrained time.

1..1

millisecond_validity (): VALIDITY_KIND

Validity of millisecond in constrained time.

1..1

timezone_validity (): VALIDITY_KIND

___: ``

Validity of timezone in constrained date/time.

Invariants

Pattern_validity: pattern /= Void implies valid_iso8601_date_time_constraint_pattern(pattern)

C_DATE_TIME

Constraint on instances representing date/times, i.e. instants in time.

There is no validity flag for year, since it must always be by definition mandatory in order to have a sensible date/time at all. Syntax expressions of instances of this class include "YYYY-MM-DDT??:??:??" (date/time with optional time) and "YYYY-MMDDTHH:MM:xx" (date/time, seconds not allowed).

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT, C_PRIMITIVE_OBJECT, C_ORDERED, C_TEMPORAL

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

default_value: Iso8601_date_time [0..1]

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

assumed_value: Iso8601_date_time [0..1]

Value to be assumed if none sent in data.

C_PRIMITIVE_OBJECT.is_enumerated_type_constraint: Boolean [0..1]

True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.

constraint: List<Interval<Iso8601_date_time>> [0..1]

Formal constraint on the assumed primitive Iso8601_date_time type, in the form of one or more Interval<Iso8601_date_time>.

For a pattern constraint or no constraint, use an empty list.

C_TEMPORAL.pattern_constraint: String [0..1]

Optional alternative constraint in the form of a pattern based on ISO8601. See descendants for details.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_PRIMITIVE_OBJECT.c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker lambda.

C_PRIMITIVE_OBJECT.c_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

C_TEMPORAL.any_allowed (): Boolean

Post: Result = precursor and pattern_constraint.is_empty [1..1]

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

(abstract) C_DEFINED_OBJECT.valid_value (
a_value: Any[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

(abstract) C_DEFINED_OBJECT.prototype_value (): Any [1..1]

Generate a prototype value from this constraint object.

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.has_assumed_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.constrained_typename (): String [1..1]

Generate name of native type that is constrained by this C_XXX type. For most types, it is the C_XXX typename without the C_, i.e. XXX. E.g. C_INTEGERInteger. For the date/time types the mapping is different.

C_TEMPORAL.c_value_conforms_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if precursor() or else other.pattern_constraint is empty, or else pattern_constraint is a valid (narrower) replacement for other.pattern_constraint.

C_TEMPORAL.c_value_congruent_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if precursor (other) and pattern_constraint ~ other.pattern_constraint, i.e. either both Void or else both non-Void and identical.

valid_pattern_constraint (
a_pattern: String[1]
): Boolean [1..1]

Return valid_iso8601_date_time_constraint_pattern (a_pattern)

valid_pattern_constraint_replacement (
a_pattern: String[1],
an_other_pattern: String[1]
): Boolean [1..1]

Return valid_date_time_constraint_replacements.has(an_other_pattern.as_upper) and then valid_date_time_constraint_replacements.item (an_other_pattern.as_upper).has (a_pattern.as_upper).

month_validity (): VALIDITY_KIND [1..1]

Validity of month in constrained date.

day_validity (): VALIDITY_KIND [1..1]

Validity of day in constrained date.

minute_validity (): VALIDITY_KIND [1..1]

Validity of minute in constrained time.

second_validity (): VALIDITY_KIND [1..1]

Validity of second in constrained time.

millisecond_validity (): VALIDITY_KIND [1..1]

Validity of millisecond in constrained time.

timezone_validity (): VALIDITY_KIND

___: `` [1..1]

Validity of timezone in constrained date/time.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

C_PRIMITIVE_OBJECT.Inv_valid_assumed_value: valid_value (assumed_value)

Pattern_validity: pattern /= Void implies valid_iso8601_date_time_constraint_pattern(pattern)

{
    "name": "C_DATE_TIME",
    "documentation": "Constraint on instances representing date/times, i.e. instants in time.\n\nThere is no validity flag for `_year_`, since it must always be by definition mandatory in order to have a sensible date/time at all. Syntax expressions of instances of this class include `\"YYYY-MM-DDT??:??:??\"` (date/time with optional time) and `\"YYYY-MMDDTHH:MM:xx\"` (date/time, seconds not allowed).",
    "ancestors": [
        "C_TEMPORAL"
    ],
    "properties": {
        "constraint": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "constraint",
            "documentation": "Formal constraint on the assumed primitive `Iso8601_date_time` type, in the form of one or more `Interval<Iso8601_date_time>`.\n\nFor a pattern constraint or no constraint, use an empty list.",
            "type_def": {
                "container_type": "List",
                "type_def": {
                    "_type": "P_BMM_GENERIC_TYPE",
                    "root_type": "Interval",
                    "generic_parameters": [
                        "Iso8601_date_time"
                    ]
                }
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "default_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "default_value",
            "documentation": "Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.",
            "type": "Iso8601_date_time"
        },
        "assumed_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "assumed_value",
            "documentation": "Value to be assumed if none sent in data.",
            "type": "Iso8601_date_time"
        }
    },
    "functions": {
        "valid_pattern_constraint": {
            "name": "valid_pattern_constraint",
            "documentation": "Return `valid_iso8601_date_time_constraint_pattern (a_pattern)` ",
            "parameters": {
                "a_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_pattern",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "valid_pattern_constraint_replacement": {
            "name": "valid_pattern_constraint_replacement",
            "documentation": "Return `valid_date_time_constraint_replacements.has(an_other_pattern.as_upper) and then \nvalid_date_time_constraint_replacements.item (an_other_pattern.as_upper).has (a_pattern.as_upper)`.",
            "parameters": {
                "a_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_pattern",
                    "type": "String"
                },
                "an_other_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "an_other_pattern",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "month_validity": {
            "name": "month_validity",
            "documentation": "Validity of month in constrained date.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "VALIDITY_KIND"
            }
        },
        "day_validity": {
            "name": "day_validity",
            "documentation": "Validity of day in constrained date.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "VALIDITY_KIND"
            }
        },
        "minute_validity": {
            "name": "minute_validity",
            "documentation": "Validity of minute in constrained time.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "VALIDITY_KIND"
            }
        },
        "second_validity": {
            "name": "second_validity",
            "documentation": "Validity of second in constrained time.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "VALIDITY_KIND"
            }
        },
        "millisecond_validity": {
            "name": "millisecond_validity",
            "documentation": "Validity of millisecond in constrained time.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "VALIDITY_KIND"
            }
        },
        "timezone_validity": {
            "name": "timezone_validity",
            "documentation": "Validity of timezone in constrained date/time.",
            "post_conditions": {
                "": ""
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "VALIDITY_KIND"
            }
        }
    },
    "invariants": {
        "Pattern_validity": "pattern /= Void implies valid_iso8601_date_time_constraint_pattern(pattern)"
    }
}
C_DATE_TIME

C_DURATION Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_DURATION

Description

Constraint on instances representing duration, which is assumed to have the same parts as the ISO 8601 duration string. Thus, constraints are of the form "PWD" (weeks and/or days), "PDTHMS" (days, hours, minutes, seconds) and so on.

Both range and the constraint pattern can be set at the same time, corresponding to the ADL constraint "PWD/|P0W..P50W|".

As for all of openEHR, two ISO 8601 exceptions are allowed:

  • the ‘W’ (week) designator can be mixed in - the allowed patterns are: P[Y|y][M|m][D|d][T[H|h][M|m][S|s]] and P[W|w];

  • the values used in an interval constraint may be negated, i.e. a leading minus ('-') sign may be used.

Inherit

C_TEMPORAL

Attributes

Signature

Meaning

0..1
(redefined)

constraint: List<Interval<Iso8601_duration>>

Formal constraint on the assumed primitive Iso8601_duration type, in the form of one or more Interval<Iso8601_duration>.

For a pattern constraint or no constraint, use an empty list.

0..1
(redefined)

default_value: Iso8601_duration

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

0..1
(redefined)

assumed_value: Iso8601_duration

Value to be assumed if none sent in data.

Functions

Signature

Meaning

1..1

years_allowed: (): Boolean

True if years are allowed in the constrained Duration.

1..1

months_allowed: (): Boolean

True if months are allowed in the constrained Duration.

1..1

weeks_allowed: (): Boolean

True if weeks are allowed in the constrained Duration.

1..1

days_allowed (): Boolean

True if days are allowed in the constrained Duration.

1..1

hours_allowed (): Boolean

True if hours are allowed in the constrained Duration.

1..1

minutes_allowed (): Boolean

True if minutes are allowed in the constrained Duration.

1..1

seconds_allowed (): Boolean

True if seconds are allowed in the constrained Duration.

1..1
(effected)

valid_pattern_constraint (
a_pattern: String[1]
): Boolean

Return valid_iso8601_duration_constraint_pattern (a_pattern)

1..1
(effected)

valid_pattern_constraint_replacement (
a_pattern: String[1],
an_other_pattern: String[1]
): Boolean

Return valid_duration_constraint_replacement (a_pattern, an_other_pattern).

C_DURATION

Constraint on instances representing duration, which is assumed to have the same parts as the ISO 8601 duration string. Thus, constraints are of the form "PWD" (weeks and/or days), "PDTHMS" (days, hours, minutes, seconds) and so on.

Both range and the constraint pattern can be set at the same time, corresponding to the ADL constraint "PWD/|P0W..P50W|".

As for all of openEHR, two ISO 8601 exceptions are allowed:

  • the ‘W’ (week) designator can be mixed in - the allowed patterns are: P[Y|y][M|m][D|d][T[H|h][M|m][S|s]] and P[W|w];

  • the values used in an interval constraint may be negated, i.e. a leading minus ('-') sign may be used.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT, C_PRIMITIVE_OBJECT, C_ORDERED, C_TEMPORAL

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

default_value: Iso8601_duration [0..1]

Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.

assumed_value: Iso8601_duration [0..1]

Value to be assumed if none sent in data.

C_PRIMITIVE_OBJECT.is_enumerated_type_constraint: Boolean [0..1]

True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.

constraint: List<Interval<Iso8601_duration>> [0..1]

Formal constraint on the assumed primitive Iso8601_duration type, in the form of one or more Interval<Iso8601_duration>.

For a pattern constraint or no constraint, use an empty list.

C_TEMPORAL.pattern_constraint: String [0..1]

Optional alternative constraint in the form of a pattern based on ISO8601. See descendants for details.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_PRIMITIVE_OBJECT.c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker lambda.

C_PRIMITIVE_OBJECT.c_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

C_TEMPORAL.any_allowed (): Boolean

Post: Result = precursor and pattern_constraint.is_empty [1..1]

True if any value (i.e. instance) of the reference model type would be allowed. Redefined in descendants.

(abstract) C_DEFINED_OBJECT.valid_value (
a_value: Any[1]
): Boolean [1..1]

True if a_value is valid with respect to constraint expressed in concrete instance of this type.

(abstract) C_DEFINED_OBJECT.prototype_value (): Any [1..1]

Generate a prototype value from this constraint object.

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.has_assumed_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.constrained_typename (): String [1..1]

Generate name of native type that is constrained by this C_XXX type. For most types, it is the C_XXX typename without the C_, i.e. XXX. E.g. C_INTEGERInteger. For the date/time types the mapping is different.

C_TEMPORAL.c_value_conforms_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if precursor() or else other.pattern_constraint is empty, or else pattern_constraint is a valid (narrower) replacement for other.pattern_constraint.

C_TEMPORAL.c_value_congruent_to (
other: C_ORDERED[1]
): Boolean [1..1]

True if precursor (other) and pattern_constraint ~ other.pattern_constraint, i.e. either both Void or else both non-Void and identical.

valid_pattern_constraint (
a_pattern: String[1]
): Boolean [1..1]

Return valid_iso8601_duration_constraint_pattern (a_pattern)

valid_pattern_constraint_replacement (
a_pattern: String[1],
an_other_pattern: String[1]
): Boolean [1..1]

Return valid_duration_constraint_replacement (a_pattern, an_other_pattern).

years_allowed: (): Boolean [1..1]

True if years are allowed in the constrained Duration.

months_allowed: (): Boolean [1..1]

True if months are allowed in the constrained Duration.

weeks_allowed: (): Boolean [1..1]

True if weeks are allowed in the constrained Duration.

days_allowed (): Boolean [1..1]

True if days are allowed in the constrained Duration.

hours_allowed (): Boolean [1..1]

True if hours are allowed in the constrained Duration.

minutes_allowed (): Boolean [1..1]

True if minutes are allowed in the constrained Duration.

seconds_allowed (): Boolean [1..1]

True if seconds are allowed in the constrained Duration.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

C_PRIMITIVE_OBJECT.Inv_valid_assumed_value: valid_value (assumed_value)

{
    "name": "C_DURATION",
    "documentation": "Constraint on instances representing duration, which is assumed to have the same parts as the ISO 8601 duration string. Thus, constraints are of the form `\"PWD\"` (weeks and/or days), `\"PDTHMS\"` (days, hours, minutes, seconds) and so on.\n\nBoth range and the constraint pattern can be set at the same time, corresponding to the ADL constraint `\"PWD/|P0W..P50W|\"`.\n\nAs for all of openEHR, two ISO 8601 exceptions are allowed: \n\n* the ‘W’ (week) designator can be mixed in - the allowed patterns are: `P[Y|y][M|m][D|d][T[H|h][M|m][S|s]]` and `P[W|w]`;\n* the values used in an interval constraint may be negated, i.e. a leading minus (`'-'`) sign may be used.\n\n",
    "ancestors": [
        "C_TEMPORAL"
    ],
    "properties": {
        "constraint": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "constraint",
            "documentation": "Formal constraint on the assumed primitive `Iso8601_duration` type, in the form of one or more `Interval<Iso8601_duration>`.\n\nFor a pattern constraint or no constraint, use an empty list.",
            "type_def": {
                "container_type": "List",
                "type_def": {
                    "_type": "P_BMM_GENERIC_TYPE",
                    "root_type": "Interval",
                    "generic_parameters": [
                        "Iso8601_duration"
                    ]
                }
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "default_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "default_value",
            "documentation": "Default value set in a template, and present in an operational template. Generally limited to leaf and near-leaf nodes.",
            "type": "Iso8601_duration"
        },
        "assumed_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "assumed_value",
            "documentation": "Value to be assumed if none sent in data.",
            "type": "Iso8601_duration"
        }
    },
    "functions": {
        "years_allowed:": {
            "name": "years_allowed:",
            "documentation": "True if years are allowed in the constrained Duration.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "months_allowed:": {
            "name": "months_allowed:",
            "documentation": "True if months are allowed in the constrained Duration.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "weeks_allowed:": {
            "name": "weeks_allowed:",
            "documentation": "True if weeks are allowed in the constrained Duration.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "days_allowed": {
            "name": "days_allowed",
            "documentation": "True if days are allowed in the constrained Duration.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "hours_allowed": {
            "name": "hours_allowed",
            "documentation": "True if hours are allowed in the constrained Duration.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "minutes_allowed": {
            "name": "minutes_allowed",
            "documentation": "True if minutes are allowed in the constrained Duration.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "seconds_allowed": {
            "name": "seconds_allowed",
            "documentation": "True if seconds are allowed in the constrained Duration.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "valid_pattern_constraint": {
            "name": "valid_pattern_constraint",
            "documentation": "Return `valid_iso8601_duration_constraint_pattern (a_pattern)` ",
            "parameters": {
                "a_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_pattern",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "valid_pattern_constraint_replacement": {
            "name": "valid_pattern_constraint_replacement",
            "documentation": "Return `valid_duration_constraint_replacement (a_pattern, an_other_pattern)`.",
            "parameters": {
                "a_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_pattern",
                    "type": "String"
                },
                "an_other_pattern": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "an_other_pattern",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_DURATION

C_TERMINOLOGY_CODE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_TERMINOLOGY_CODE

Description

Constrainer type for instances of Terminology_code. The constraint attribute can contain:

  • a single at-code

  • a single ac-code, representing a value-set that is defined in the archetype terminology

If there is an assumed value for the ac-code case above, the assumed_value attribute contains a single at-code, which must come from the list of at-codes defined as the internal value set for the ac-code.

The constraint_status attribute and constraint_required() function together define whether the constraint is considered formal ('required') or not. In the non-required cases, a data-item matched to this constraint may be any coded term.

Inherit

C_PRIMITIVE_OBJECT

Attributes

Signature

Meaning

1..1
(effected)

constraint: String

Type of individual constraint - a single string that can either be a local at-code, or a local ac-code signifying a locally defined value set. If an ac-code, assumed_value may contain an at-code from the value set of the ac-code.

Use an empty string for no constraint.

0..1
(effected)

assumed_value: Terminology_code

Assumed Terminology code value.

0..1
(redefined)

default_value: Terminology_code

0..1

constraint_status: CONSTRAINT_STATUS

Constraint status of this terminology constraint. If Void, the meaning is as follows:

  • in a top-level archetype, equivalent to required;

  • in a specialised (source) archetype, the meaning is to inherit the value from the corresponding node in the parent.

In the case of a specialised archetype generated by flattening, the value of this field will be:

  • Void if it was Void in the parent;

  • otherwise, it will carry the same value as in the parent.

Functions

Signature

Meaning

1..1

constraint_required (): Boolean

True if constraint_status is defined and equals required OR if Void. I.e. in archetypes where C_TERMINOLOGY_CODE instances have no constraint_status, the required status is assumed, which applies to all legacy archetypes.

1..1

effective_constraint_status (): Integer

Return the effective integer value of the constraint_status field if it exists. If it is null, return 0, i.e. required.

the above logic applies to any C_TERMINOLOGY_NODE instance in a specialised archetype that redefines another such instance in the flat parent. I.e. no stated constraint_status means required.

0..1

value_set_expanded (): List<String>

Effective set of at-code values corresponding to an ac-code for a locally defined value set. Not defined for ac-codes that have no local value set.

0..1

value_set_substituted (): List<Uri>

For locally defined value sets within individual code bindings: return the term URI(s) substituted from bindings for local at-codes in value_set_expanded.

0..1

value_set_resolved (): List<Terminology_code>

For locally defined value sets within individual code bindings: final set of external codes to which value set is resolved.

1..1
(redefined)

valid_value (
a_value: Terminology_code[1]
): Boolean

True if a value is valid with respect to constraint expressed in concrete instance of this type.

1..1
(redefined)

prototype_value (): Terminology_code

A generated prototype value from this constraint object.

1..1
(redefined)

any_allowed (): Boolean

Post: Result := constraint.is_empty

True if constraint is empty.

1..1
(effected)

c_value_conforms_to (
other: C_TERMINOLOGY_CODE[1]
): Boolean

True if other.any_allowed or else every constraint in the constraint list exists in the other.constraint, and effective_constraint_status() is <= other.effective_constraint_status().

1..1
(effected)

c_value_congruent_to (
other: C_TERMINOLOGY_CODE[1]
): Boolean

True if constraint and other.constraint are both value-set ids, and expand to identical value sets, or else are identical value codes; and effective_constraint_status() = other.effective_constraint_status().

C_TERMINOLOGY_CODE

Constrainer type for instances of Terminology_code. The constraint attribute can contain:

  • a single at-code

  • a single ac-code, representing a value-set that is defined in the archetype terminology

If there is an assumed value for the ac-code case above, the assumed_value attribute contains a single at-code, which must come from the list of at-codes defined as the internal value set for the ac-code.

The constraint_status attribute and constraint_required() function together define whether the constraint is considered formal ('required') or not. In the non-required cases, a data-item matched to this constraint may be any coded term.

Inherits: ADL_CODE_DEFINITIONS, ARCHETYPE_CONSTRAINT, C_OBJECT, C_DEFINED_OBJECT, C_PRIMITIVE_OBJECT

Constants

ADL_CODE_DEFINITIONS.Id_code_leader: String = "id" [1..1]

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.

ADL_CODE_DEFINITIONS.Value_code_leader: String = "at" [1..1]

String leader of ‘value’ codes, i.e. codes used to identify codes values, including value set members.

ADL_CODE_DEFINITIONS.Value_set_code_leader: String = "ac" [1..1]

String leader of ‘value set’ codes, i.e. codes used to identify value sets.

ADL_CODE_DEFINITIONS.Specialisation_separator: Character = '.' [1..1]

Character used to separate numeric parts of codes belonging to different specialisation levels.

ADL_CODE_DEFINITIONS.Code_regex_pattern: `String = "(0

[1-9][0-9]*)(\.(0

[1-9]))"` [1..1]

Regex used to define the legal numeric part of any archetype code. Corresponds to the simple pattern of dotted numbers, as used in typical multi-level numbering schemes.

ADL_CODE_DEFINITIONS.Root_code_regex_pattern: String = "^id1(\.1)*$" [1..1]

Regex pattern of the root id code of any archetype. Corresponds to codes of the form id1, id1.1, id1.1.1 etc..

ADL_CODE_DEFINITIONS.Primitive_node_id: String = "id9999" [1..1]

Code id used for C_PRIMITIVE_OBJECT nodes on creation.

Attributes

ARCHETYPE_CONSTRAINT.parent: ARCHETYPE_CONSTRAINT [0..1]

Parent node, except in the case of the top of a tree, i.e. root C_COMPLEX_OBJECT of an archetype definition.

ARCHETYPE_CONSTRAINT.soc_parent: C_SECOND_ORDER [0..1]

C_OBJECT.rm_type_name: String [1..1]

Reference model type that this node corresponds to.

C_OBJECT.occurrences: Multiplicity_interval [0..1]

Occurrences of this object node in the data, under the owning attribute. Upper limit can only be greater than 1 if owning attribute has a cardinality of more than 1. Only set if it overrides the parent archetype in the case of specialised archetypes, or else the occurrences inferred from the underlying reference model existence and/or cardinality of the containing attribute.

C_OBJECT.node_id: String [1..1]

Semantic identifier of this node, used to dis-tinguish sibling nodes. All nodes must have a node_id; for nodes under a container C_ATTRIBUTE, the id must be an id-code must be defined in the archetype terminology. For valid structures, all node ids are id-codes.

For C_PRIMITIVE_OBJECTs represented in ADL inline form, this attribute will have the special value Primitive_node_id; otherwise it will have the node id read during parsing.

C_OBJECT.is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.

C_OBJECT.sibling_order: SIBLING_ORDER [0..1]

Optional indicator of order of this node with respect to another sibling. Only meaningful in a specialised archetype for a C_OBJECT within a C_ATTRIBUTE with is_multiple = True.

default_value: Terminology_code [0..1]

assumed_value: Terminology_code [0..1]

Assumed Terminology code value.

C_PRIMITIVE_OBJECT.is_enumerated_type_constraint: Boolean [0..1]

True if this object represents a constraint on an enumerated type from the reference model, where the latter is assumed to be based on a primitive type, generally Integer or String.

constraint: String [1..1]

Type of individual constraint - a single string that can either be a local at-code, or a local ac-code signifying a locally defined value set. If an ac-code, assumed_value may contain an at-code from the value set of the ac-code.

Use an empty string for no constraint.

constraint_status: CONSTRAINT_STATUS [0..1]

Constraint status of this terminology constraint. If Void, the meaning is as follows:

  • in a top-level archetype, equivalent to required;

  • in a specialised (source) archetype, the meaning is to inherit the value from the corresponding node in the parent.

In the case of a specialised archetype generated by flattening, the value of this field will be:

  • Void if it was Void in the parent;

  • otherwise, it will carry the same value as in the parent.

Functions

ADL_CODE_DEFINITIONS.codes_conformant (
a_child_code: String[1],
a_parent_code: String[1]
): Boolean [1..1]

True if a_child_code conforms to a_parent_code in the sense of specialisation, i.e. is a_child_code the same as or more specialised than a_parent_code?

ADL_CODE_DEFINITIONS.is_adl_code (
a_code: String[1]
): Boolean

Post: Result = is_id_code (a_code) or else is_value_code (a_code) or else is_value_set_code (a_code) [1..1]

True if a_code is any kind of ADL archetype local code.

ADL_CODE_DEFINITIONS.is_id_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Id_code_leader) [1..1]

True if a_code is an 'id' code.

ADL_CODE_DEFINITIONS.is_value_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_code_leader) [1..1]

True if a_code is an 'at' code, i.e. a code representing a single terminology item.

ADL_CODE_DEFINITIONS.is_value_set_code (
a_code: String[1]
): Boolean

Post: Result = a_code.starts_with (Value_set_code_leader) [1..1]

True if a_code is an 'ac' code, i.e. a code referring to a terminology value set.

ADL_CODE_DEFINITIONS.is_redefined_code (
a_code: String[1]
): Boolean [1..1]

A code has been specialised if there is a non-zero code index anywhere above the last index e.g.

  • at0.0.1 → False

  • at1.0.1 → True

ADL_CODE_DEFINITIONS.code_exists_at_level (
a-code: String[1],
a_level: Integer[1]
): Boolean [1..1]

Is a_code valid at level a_level or less, i.e. if we remove its trailing specialised part corresponding to specialisation below a_level, and then any trailing '.0' pieces, do we end up with a valid code? If so it means that the code corresponds to a real node from a_level or higher.

C_OBJECT.is_prohibited (): Boolean

Post: Result = occurrences /= Void and then occurrences.is_prohibited [1..1]

True if this C_OBJECT node is prohibited, i.e. if its occurrences is 0..0.

ARCHETYPE_CONSTRAINT.has_path (
a_path: String[1]
): Boolean [1..1]

True if the relative path a_path exists at this node.

ARCHETYPE_CONSTRAINT.path (): String [1..1]

Path of this node relative to root of archetype.

C_PRIMITIVE_OBJECT.c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

Reference Model conformance checker lambda.

C_PRIMITIVE_OBJECT.c_congruent_to (
other: C_PRIMITIVE_OBJECT[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other, with the exception of node_id redefinition in C_OBJECT nodes.

Typically used to test if an inherited node locally contains any constraints.

ARCHETYPE_CONSTRAINT.is_second_order_constrained (): Boolean

Post: soc_parent /= Void or else (parent /= Void and then parent.is_second_order_constrained) [1..1]

True if there is a second order constraint such as a tuple constraint on this node.

ARCHETYPE_CONSTRAINT.is_root (): Boolean [1..1]

True if this node is the root of the tree.

ARCHETYPE_CONSTRAINT.is_leaf (): Boolean [1..1]

True if this node is a terminal node in the tree structure, i.e. having no child nodes.

C_OBJECT.specialisation_depth (): Integer [1..1]

Level of specialisation of this archetype node, based on its node_id. The value 0 corresponds to non-specialised, 1 to first-level specialisation and so on. The level is the same as the number of ‘.’ characters in the node_id code. If node_id is not set, the return value is -1, signifying that the specialisation level should be determined from the nearest parent C_OBJECT node having a node_id.

C_OBJECT.effective_occurrences (): Multiplicity_interval [1..1]

Compute effective occurrences, where no local occurrences constraint set. If the owning C_ATTRIBUTE.cardinality is set, use its upper value, else use RM multiplicity of the owning attribute.

If local occurrences not set, always assume 0 as the lower bound.

C_OBJECT.occurrences_conforms_to (
other: C_OBJECT[1]
): Boolean [1..1]

True if this node occurrences conforms to other.occurrences; other is assumed to be in a flat archetype.

Parameters
other

C_OBJECT from a flat parent archetype.

C_OBJECT.node_id_conforms_to (
other: C_OBJECT[1]
): Boolean

Post: Result = codes_conformant (node_id, other.node_id) [1..1]

True if this node id conforms to other.node_id, which includes the ids being identical; other is assumed to be in a flat archetype.

any_allowed (): Boolean

Post: Result := constraint.is_empty [1..1]

True if constraint is empty.

valid_value (
a_value: Terminology_code[1]
): Boolean [1..1]

True if a value is valid with respect to constraint expressed in concrete instance of this type.

prototype_value (): Terminology_code [1..1]

A generated prototype value from this constraint object.

C_DEFINED_OBJECT.has_default_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.has_assumed_value (): Boolean [1..1]

True if there is an assumed value.

C_PRIMITIVE_OBJECT.constrained_typename (): String [1..1]

Generate name of native type that is constrained by this C_XXX type. For most types, it is the C_XXX typename without the C_, i.e. XXX. E.g. C_INTEGERInteger. For the date/time types the mapping is different.

c_value_conforms_to (
other: C_TERMINOLOGY_CODE[1]
): Boolean [1..1]

True if other.any_allowed or else every constraint in the constraint list exists in the other.constraint, and effective_constraint_status() is <= other.effective_constraint_status().

c_value_congruent_to (
other: C_TERMINOLOGY_CODE[1]
): Boolean [1..1]

True if constraint and other.constraint are both value-set ids, and expand to identical value sets, or else are identical value codes; and effective_constraint_status() = other.effective_constraint_status().

constraint_required (): Boolean [1..1]

True if constraint_status is defined and equals required OR if Void. I.e. in archetypes where C_TERMINOLOGY_CODE instances have no constraint_status, the required status is assumed, which applies to all legacy archetypes.

effective_constraint_status (): Integer [1..1]

Return the effective integer value of the constraint_status field if it exists. If it is null, return 0, i.e. required.

the above logic applies to any C_TERMINOLOGY_NODE instance in a specialised archetype that redefines another such instance in the flat parent. I.e. no stated constraint_status means required.

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

Effective set of at-code values corresponding to an ac-code for a locally defined value set. Not defined for ac-codes that have no local value set.

value_set_substituted (): List<Uri> [0..1]

For locally defined value sets within individual code bindings: return the term URI(s) substituted from bindings for local at-codes in value_set_expanded.

value_set_resolved (): List<Terminology_code> [0..1]

For locally defined value sets within individual code bindings: final set of external codes to which value set is resolved.

Invariants

ARCHETYPE_CONSTRAINT.Post: Result = soc_parent /= Void or parent.soc_parent /= Void

C_DEFINED_OBJECT.Inv_valid_default_value: valid_value (default_value)

C_PRIMITIVE_OBJECT.Inv_valid_assumed_value: valid_value (assumed_value)

{
    "name": "C_TERMINOLOGY_CODE",
    "documentation": "Constrainer type for instances of `Terminology_code`. The constraint attribute can contain:\n\n* a single at-code\n* a single ac-code, representing a value-set that is defined in the archetype terminology\n\nIf there is an assumed value for the ac-code case above, the `_assumed_value_` attribute contains a single at-code, which must come from the list of at-codes defined as the internal value set for the ac-code.\n\nThe `_constraint_status_` attribute and `_constraint_required_()` function together define whether the `_constraint_` is considered formal ('required') or not. In the non-required cases, a data-item matched to this constraint may be any coded term.",
    "ancestors": [
        "C_PRIMITIVE_OBJECT"
    ],
    "properties": {
        "constraint": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "constraint",
            "documentation": "Type of individual constraint - a single string that can either be a local at-code, or a local ac-code signifying a locally defined value set. If an ac-code, assumed_value may contain an at-code from the value set of the ac-code.\n\nUse an empty string for no constraint.",
            "is_mandatory": true,
            "type": "String"
        },
        "assumed_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "assumed_value",
            "documentation": "Assumed Terminology code value.",
            "type": "Terminology_code"
        },
        "default_value": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "default_value",
            "type": "Terminology_code"
        },
        "constraint_status": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "constraint_status",
            "documentation": "Constraint status of this terminology constraint. If Void, the meaning is as follows:\n\n* in a top-level  archetype, equivalent to `required`;\n* in a specialised (source) archetype, the meaning is to inherit the value from the corresponding node in the parent.\n\nIn the case of a specialised archetype generated by flattening, the value of this field will be:\n\n* Void if it was Void in the parent;\n* otherwise, it will carry the same value as in the parent.",
            "type": "CONSTRAINT_STATUS"
        }
    },
    "functions": {
        "constraint_required": {
            "name": "constraint_required",
            "documentation": "True if `_constraint_status_` is defined and equals `required` OR if Void. I.e. in archetypes where `C_TERMINOLOGY_CODE` instances have no `_constraint_status_`, the `required` status is assumed, which applies to all legacy archetypes.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "effective_constraint_status": {
            "name": "effective_constraint_status",
            "documentation": "Return the effective integer value of the `_constraint_status_` field if it exists. If it is null, return 0, i.e. `required`.\n\nNOTE: the above logic applies to any `C_TERMINOLOGY_NODE` instance in a specialised archetype that redefines another such instance in the flat parent. I.e. no stated `_constraint_status_` means `required`.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Integer"
            }
        },
        "value_set_expanded": {
            "name": "value_set_expanded",
            "documentation": "Effective set of at-code values corresponding to an ac-code for a locally defined value set. Not defined for ac-codes that have no local value set.",
            "result": {
                "_type": "P_BMM_CONTAINER_TYPE",
                "container_type": "List",
                "type": "String"
            },
            "is_nullable": true
        },
        "value_set_substituted": {
            "name": "value_set_substituted",
            "documentation": "For locally defined value sets within individual code bindings: return the term URI(s) substituted from bindings for local at-codes in `_value_set_expanded_`.",
            "result": {
                "_type": "P_BMM_CONTAINER_TYPE",
                "container_type": "List",
                "type": "Uri"
            },
            "is_nullable": true
        },
        "value_set_resolved": {
            "name": "value_set_resolved",
            "documentation": "For locally defined value sets within individual code bindings: final set of external codes to which value set is resolved.",
            "result": {
                "_type": "P_BMM_CONTAINER_TYPE",
                "container_type": "List",
                "type": "Terminology_code"
            },
            "is_nullable": true
        },
        "valid_value": {
            "name": "valid_value",
            "documentation": "True if a `_value_` is valid with respect to constraint expressed in concrete instance of this type. ",
            "parameters": {
                "a_value": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_value",
                    "type": "Terminology_code"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "prototype_value": {
            "name": "prototype_value",
            "documentation": "A generated prototype value from this constraint object.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Terminology_code"
            }
        },
        "any_allowed": {
            "name": "any_allowed",
            "documentation": "True if `_constraint_` is empty.",
            "post_conditions": {
                "Post": "Result := constraint.is_empty"
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_value_conforms_to": {
            "name": "c_value_conforms_to",
            "documentation": "True if `_other.any_allowed_` or else every constraint in the `_constraint_` list exists in the `_other.constraint_`, and `_effective_constraint_status()_` is <= `_other.effective_constraint_status()_`.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_TERMINOLOGY_CODE"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_value_congruent_to": {
            "name": "c_value_congruent_to",
            "documentation": "True if `_constraint_` and `_other.constraint_` are both value-set ids, and expand to identical value sets, or else are identical value codes; and `_effective_constraint_status()_` = `_other.effective_constraint_status()_`.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_TERMINOLOGY_CODE"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_TERMINOLOGY_CODE

CONSTRAINT_STATUS Enumeration

  • Definition

  • Effective

  • BMM

  • UML

Enumeration

CONSTRAINT_STATUS

Description

Status of constraint, with values allowing for 'soft' constraints, which are effectively different kinds of suggestions.

Constants

Signature

Meaning

required: Integer = 0

Data item is required to formally satisfy constraint.

Enumeration value = 0.

extensible: Integer = 1

Data item value should satisfy constraint, i.e. a term in constraint is to be used if it covers the data item meaning (including more generally); if not, another code may be used, including from another terminology.

Enumeration value = 1.

preferred: Integer = 2

Data item value is by preference one of the codes defined by constraint, but for local reasons may be another code, including from another terminology.

Enumeration value = 2.

example: Integer = 3

The constraint code or value-set is considered purely as an example, and the data item may have any value.

CONSTRAINT_STATUS

Status of constraint, with values allowing for 'soft' constraints, which are effectively different kinds of suggestions.

Inherits: Any, Any, Ordered, Numeric, Ordered_Numeric, Integer

Constants

required: Integer = 0

Data item is required to formally satisfy constraint.

Enumeration value = 0.

extensible: Integer = 1

Data item value should satisfy constraint, i.e. a term in constraint is to be used if it covers the data item meaning (including more generally); if not, another code may be used, including from another terminology.

Enumeration value = 1.

preferred: Integer = 2

Data item value is by preference one of the codes defined by constraint, but for local reasons may be another code, including from another terminology.

Enumeration value = 2.

example: Integer = 3

The constraint code or value-set is considered purely as an example, and the data item may have any value.

Functions

Integer.is_equal (
other: Integer[1]
): Boolean [1..1]

Value equality: return True if this and other are attached to objects considered to be equal in value.

Integer.equal alias "=", "==" (
other: Integer[1]
): Boolean [1..1]

Reference equality for reference types, value equality for value types.

Any.instance_of (
a_type: String[1]
): Any [1..1]

Create new instance of a type.

Any.type_of (
an_object: Any[1]
): String [1..1]

Type name of an object as a string. May include generic parameters, as in "Interval<Time>".

Any.not_equal alias "!=", "≠" (
other: Ordered[1]
): Boolean [1..1]

True if current object not equal to other. Returns not equal().

Integer.less_than alias "<" (
other: Integer[1]
): Boolean [1..1]

Returns True if current Integer is less than other.

Ordered.less_than_or_equal alias "⇐", "≤" (
other: Ordered[1]
): Boolean

Post_result: not (other < self) [1..1]

True if current object less than or equal to other.

Ordered.greater_than alias ">" (
other: Ordered[1]
): Boolean

Post_result: Result = (other < self) [1..1]

True if current object greater than other.

Ordered.greater_than_or_equal alias ">=", "≥" (
other: Ordered[1]
): Boolean

Post_result: Result = (other <= self) [1..1]

True if current object greater than or equal to other.

Integer.add alias "+" (
other: Integer[1]
): Integer [1..1]

Integer addition.

Integer.subtract alias "-" (
other: Integer[1]
): Integer [1..1]

Integer subtraction.

Integer.multiply alias "*" (
other: Integer[1]
): Integer [1..1]

Integer multiplication.

Integer.divide alias "/" (
other: Integer[1]
): Double [1..1]

Integer division.

Integer.exponent alias "^" (
other: Double[1]
): Double [1..1]

Integer exponentiation.

Integer.negative alias "-" (): Integer [1..1]

Generate negative of current Integer value.

Integer.modulo alias "mod", "\\" (
mod: Integer[1]
): Integer [1..1]

Return self modulo other.

{
    "_type": "P_BMM_ENUMERATION_INTEGER",
    "name": "CONSTRAINT_STATUS",
    "documentation": "Status of `_constraint_`, with values allowing for 'soft' constraints, which are effectively different kinds of suggestions.",
    "ancestors": [
        "Integer"
    ],
    "item_names": [
        "required",
        "extensible",
        "preferred",
        "example"
    ],
    "item_values": [
        0,
        1,
        2,
        3
    ],
    "item_documentations": [
        "Data item is required to formally satisfy `_constraint_`.\n\nEnumeration value = 0.",
        "Data item value should satisfy `_constraint_`, i.e. a term in `_constraint_` is to be used if it covers the data item meaning (including more generally); if not, another code may be used, including from another terminology.\n\nEnumeration value = 1.",
        "Data item value is by preference one of the codes defined by `_constraint_`, but for local reasons may be another code, including from another terminology.\n\nEnumeration value = 2.",
        "The `_constraint_` code or value-set is considered purely as an example, and the data item may have any value."
    ]
}
CONSTRAINT_STATUS

Conformance semantics: C_TERMINOLOGY_NODE

The following functions implement those of the same names in C_PRIMITIVE_OBJECT and formally define the conformance of a C_TERMINOLOGY_CODE node in a specialised archetype to a corresponding node in a parent archetype, where 'corresponding' means a node found at the same or a congruent path and of the same AOM type.

c_value_conforms_to (other: C_TERMINOLOGY_CODE): Boolean
        -- True if this node expresses a value constraint that conforms to that of `other'
    local
        this_vset, other_vset: List<String>
    do
        if other.any_allowed then
            Result := True

        -- check that constraint_status is valid. The following order hold down the specialisation
        -- lineage, from lowest to highest: example (3) → preferred (2) → exensible (1) → required (0);
        -- numerically, specialisation child must be <= parent
        elseif effective_constraint_status > other.effective_constraint_status then
            Result := False

        -- if parent's constraint status is not 'required', then child automatically conforms
        elseif other.effective_constraint_status > 0 then
            Result := True

        -- if we get here, we know that parent and child terminology constraint strengths are both `required`
        -- so perform the value-set conformance check
        elseif is_valid_value_set_code (constraint) and is_valid_value_set_code (other.constraint) then
            -- firstly, check if the other value-set is empty, which means there is no value-set,
            -- i.e. no constraint, which means that this object's value set automatically conforms.
            other_vset := other.value_set_expanded
            if not other_vset.is_empty then
                this_vset := value_set_expanded
                Result := codes_conformant (constraint, other.constraint) and then
                    for_all v: this_vset | other_vset.has (v)
            else
                Result := True
            end

        -- otherwise it's at-codes, so we just check lexical conformance
        else
            Result := codes_conformant (constraint, other.constraint)
        end
    end

c_value_congruent_to (other: C_TERMINOLOGY_CODE): Boolean
        -- True if this node's value constraint is the same as that of `other'
    local
        this_vset, other_vset: List<String>
    do
        -- if both constraints are ac-codes, compare the value-set expansions
        if is_valid_value_set_code (constraint) and is_valid_value_set_code (other.constraint) then
            this_vset := value_set_expanded
            other_vset := other.value_set_expanded
            Result := constraint.is_equal (other.constraint) and then
                this_vset.count = other_vset.count and then
                    for_all v: this_vset | other_vset.has (v)

        -- otherwise it's at-codes, so we just compare them literally
        else
            Result := constraint.is_equal (other.constraint)
        end

        -- make sure constraint status is identical
        Result := Result and effective_constraint_status = other.effective_constraint_status
    end

C_SECOND_ORDER Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_SECOND_ORDER (abstract)

Description

Abstract parent of classes defining second order constraints.

Attributes

Signature

Meaning

0..1

members: List<ARCHETYPE_CONSTRAINT>

Members of this second order constrainer. Normally redefined in descendants.

Functions

Signature

Meaning

1..1
(abstract)

c_conforms_to (
other: C_SECOND_ORDER[1],
rmcc: FUNCTION<>[1]
): Boolean

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

RM conformance checker agent - a lambda (i.e. function object) that can compute conformance of type-names within the Reference Model on which the current archetype is based. The signature provides two arguments representing respectively, the rm_type_name of the current node and the rm_type_name of the node being redefined in a specialisation parent archetype.

1..1
(abstract)

c_congruent_to (
other: C_SECOND_ORDER[1]
): Boolean

True if constraints represented by this node contain no further redefinitions with respect to the node other. Typically used to test if an inherited node locally contains any constraints.

C_SECOND_ORDER (abstract)

Abstract parent of classes defining second order constraints.

Attributes

members: List<ARCHETYPE_CONSTRAINT> [0..1]

Members of this second order constrainer. Normally redefined in descendants.

Functions

(abstract) c_conforms_to (
other: C_SECOND_ORDER[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

RM conformance checker agent - a lambda (i.e. function object) that can compute conformance of type-names within the Reference Model on which the current archetype is based. The signature provides two arguments representing respectively, the rm_type_name of the current node and the rm_type_name of the node being redefined in a specialisation parent archetype.

(abstract) c_congruent_to (
other: C_SECOND_ORDER[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other. Typically used to test if an inherited node locally contains any constraints.

{
    "name": "C_SECOND_ORDER",
    "documentation": "Abstract parent of classes defining second order constraints.",
    "is_abstract": true,
    "properties": {
        "members": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "members",
            "documentation": "Members of this second order constrainer. Normally redefined in descendants.",
            "type_def": {
                "container_type": "List",
                "type": "ARCHETYPE_CONSTRAINT"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        }
    },
    "functions": {
        "c_conforms_to": {
            "name": "c_conforms_to",
            "documentation": "True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.",
            "is_abstract": true,
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_SECOND_ORDER"
                },
                "rmcc": {
                    "_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
                    "name": "rmcc",
                    "documentation": "RM conformance checker agent - a lambda (i.e. function object) that can compute conformance of type-names within the  Reference Model on which the current archetype is based. The signature provides two arguments representing respectively, the `_rm_type_name_` of the current node and the `_rm_type_name_` of the node being redefined in a specialisation parent archetype.",
                    "type_def": {
                        "root_type": "FUNCTION"
                    }
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_congruent_to": {
            "name": "c_congruent_to",
            "documentation": "True if constraints represented by this node contain no further redefinitions with respect to the node other. Typically used to test if an inherited node locally contains any constraints.",
            "is_abstract": true,
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_SECOND_ORDER"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_SECOND_ORDER

C_PRIMITIVE_TUPLE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_PRIMITIVE_TUPLE

Description

Class representing a single object tuple instance in a tuple constraint. Each such instance is a vector of object constraints, where each member (each C_PRIMITIVE_OBJECT) corresponds to one of the C_ATTRIBUTEs referred to by the owning C_ATTRIBUTE_TUPLE.

Inherit

C_SECOND_ORDER

Attributes

Signature

Meaning

1..1
(effected)

members: List<C_PRIMITIVE_OBJECT>

Object constraint members of this tuple group.

Functions

Signature

Meaning

1..1
(effected)

c_conforms_to (
other: C_PRIMITIVE_TUPLE[1],
rmcc: FUNCTION<>[1]
): Boolean

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

RM conformance checker agent.

1..1
(effected)

c_congruent_to (
other: C_SECOND_ORDER[1]
): Boolean

True if constraints represented by this node contain no further redefinitions with respect to the node other. Typically used to test if an inherited node locally contains any constraints.

C_PRIMITIVE_TUPLE

Class representing a single object tuple instance in a tuple constraint. Each such instance is a vector of object constraints, where each member (each C_PRIMITIVE_OBJECT) corresponds to one of the C_ATTRIBUTEs referred to by the owning C_ATTRIBUTE_TUPLE.

Inherits: C_SECOND_ORDER

Attributes

members: List<C_PRIMITIVE_OBJECT> [1..1]

Object constraint members of this tuple group.

Functions

c_conforms_to (
other: C_PRIMITIVE_TUPLE[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

RM conformance checker agent.

c_congruent_to (
other: C_SECOND_ORDER[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other. Typically used to test if an inherited node locally contains any constraints.

{
    "name": "C_PRIMITIVE_TUPLE",
    "documentation": "Class representing a single object tuple instance in a tuple constraint. Each such instance is a vector of object constraints, where each member (each `C_PRIMITIVE_OBJECT`) corresponds to one of the `C_ATTRIBUTEs` referred to by the owning `C_ATTRIBUTE_TUPLE`.",
    "ancestors": [
        "C_SECOND_ORDER"
    ],
    "properties": {
        "members": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "members",
            "documentation": "Object constraint members of this tuple group.",
            "is_mandatory": true,
            "type_def": {
                "container_type": "List",
                "type": "C_PRIMITIVE_OBJECT"
            },
            "cardinality": {
                "lower": 1,
                "upper_unbounded": true
            }
        }
    },
    "functions": {
        "c_conforms_to": {
            "name": "c_conforms_to",
            "documentation": "True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_PRIMITIVE_TUPLE"
                },
                "rmcc": {
                    "_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
                    "name": "rmcc",
                    "documentation": "RM conformance checker agent.",
                    "type_def": {
                        "root_type": "FUNCTION"
                    }
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_congruent_to": {
            "name": "c_congruent_to",
            "documentation": "True if constraints represented by this node contain no further redefinitions with respect to the node other. Typically used to test if an inherited node locally contains any constraints.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_SECOND_ORDER"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_PRIMITIVE_TUPLE

C_ATTRIBUTE_TUPLE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

C_ATTRIBUTE_TUPLE

Description

Object representing a constraint on an attribute tuple, i.e. a group of attributes that are constrained together. Typically used for representing co-varying constraints like {units, range} constraints.

Inherit

C_SECOND_ORDER

Attributes

Signature

Meaning

0..1

tuples: List<C_PRIMITIVE_TUPLE>

Tuple definitions.

0..1
(effected)

members: List<C_ATTRIBUTE>

List of C_ATTRIBUTEs forming the definition of the tuple.

Functions

Signature

Meaning

1..1
(effected)

c_conforms_to (
other: C_ATTRIBUTE_TUPLE[1],
rmcc: FUNCTION<>[1]
): Boolean

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

RM conformance checker agent.

1..1
(effected)

c_congruent_to (
other: C_SECOND_ORDER[1]
): Boolean

True if constraints represented by this node contain no further redefinitions with respect to the node other. Typically used to test if an inherited node locally contains any constraints.

C_ATTRIBUTE_TUPLE

Object representing a constraint on an attribute tuple, i.e. a group of attributes that are constrained together. Typically used for representing co-varying constraints like {units, range} constraints.

Inherits: C_SECOND_ORDER

Attributes

members: List<C_ATTRIBUTE> [0..1]

List of C_ATTRIBUTEs forming the definition of the tuple.

tuples: List<C_PRIMITIVE_TUPLE> [0..1]

Tuple definitions.

Functions

c_conforms_to (
other: C_ATTRIBUTE_TUPLE[1],
rmcc: FUNCTION<>[1]
): Boolean [1..1]

True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.

Parameters
rmcc

RM conformance checker agent.

c_congruent_to (
other: C_SECOND_ORDER[1]
): Boolean [1..1]

True if constraints represented by this node contain no further redefinitions with respect to the node other. Typically used to test if an inherited node locally contains any constraints.

{
    "name": "C_ATTRIBUTE_TUPLE",
    "documentation": "Object representing a constraint on an attribute tuple, i.e. a group of attributes that are constrained together. Typically used for representing co-varying constraints like `{units, range}` constraints.",
    "ancestors": [
        "C_SECOND_ORDER"
    ],
    "properties": {
        "tuples": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "tuples",
            "documentation": "Tuple definitions.",
            "type_def": {
                "container_type": "List",
                "type": "C_PRIMITIVE_TUPLE"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        },
        "members": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "members",
            "documentation": "List of `C_ATTRIBUTEs` forming the definition of the tuple.",
            "type_def": {
                "container_type": "List",
                "type": "C_ATTRIBUTE"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        }
    },
    "functions": {
        "c_conforms_to": {
            "name": "c_conforms_to",
            "documentation": "True if constraints represented by this node, ignoring any sub-parts, are narrower or the same as other. Typically used during validation of specialised archetype nodes.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_ATTRIBUTE_TUPLE"
                },
                "rmcc": {
                    "_type": "P_BMM_GENERIC_FUNCTION_PARAMETER",
                    "name": "rmcc",
                    "documentation": "RM conformance checker agent.",
                    "type_def": {
                        "root_type": "FUNCTION"
                    }
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "c_congruent_to": {
            "name": "c_congruent_to",
            "documentation": "True if constraints represented by this node contain no further redefinitions with respect to the node other. Typically used to test if an inherited node locally contains any constraints.",
            "parameters": {
                "other": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "other",
                    "type": "C_SECOND_ORDER"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
C_ATTRIBUTE_TUPLE

Conformance semantics: C_SECOND_ORDER

The following functions formally define the conformance interfaces of any C_SECOND_ORDER node in a specialised archetype to the corresponding node in a parent archetype, where 'corresponding' means a node found at the same or a congruent path.

c_conforms_to (other: C_SECOND_ORDER; rmcc: FUNCTION<<a_type, other_type: String>, Boolean>): Boolean
        -- True if this node on its own (ignoring any subparts) expresses the same or narrower
        -- constraints as `other`.
        -- Returns False if any of the following is incompatible:
        --	 * cardinality
        --	 * existence
    require
        other /= Void
        rmcc /= Void
    deferred
    end

c_congruent_to (other: C_SECOND_ORDER): Boolean
        -- True if this node on its own (ignoring any subparts) expresses no additional
        -- constraints than `other`.
    require
        other /= Void
    deferred
    end

The following functions implement those of the same names from C_SECOND_ORDER, and formally define the conformance interfaces of any C_ATTRIBUTE_TUPLE node in a specialised archetype to the corresponding node in a parent archetype, where 'corresponding' means a node found at the same or a congruent path.

c_conforms_to (other: C_ATTRIBUTE_TUPLE; rmcc: FUNCTION<<a_type, other_type: String>, Boolean>): BOOLEAN
        -- True if this node is a subset of, or the same as `other'
    do
        Result :=
            for_all t: tuples |
                there_exists ot: other.tuples | t.c_conforms_to (ot, rmcc)
            or else tuples.count < other.tuples.count and
                for_all t: tuples |
                    there_exists ot: other.tuples | t.c_congruent_to (ot)
    end

c_congruent_to (other: C_ATTRIBUTE_TUPLE): BOOLEAN
        -- True if Current adds no further constraints with respect to `other'
    do
        Result := for_all t: tuples |
            there_exists ot: other.tuples | t.c_congruent_to (ot)
    end

The following functions implement those of the same names from C_SECOND_ORDER, and formally define the conformance interfaces of any C_PRIMITIVE_TUPLE node in a specialised archetype to the corresponding node in a parent archetype, where 'corresponding' means a node found at the same or a congruent path.

c_conforms_to (other: C_PRIMITIVE_TUPLE; rmcc: FUNCTION<<a_type, other_type: String>, Boolean>): BOOLEAN
        -- True if this node is a subset of, or the same as `other'
    do
        if count = other.count then
            Result := across members as cpo_csr all
                cpo_csr.item.same_type (other.members.i_th (cpo_csr.cursor_index)) and then
                    cpo_csr.item.c_conforms_to (other.members.i_th (cpo_csr.cursor_index), rmcc)
            end
        end
    end

c_congruent_to (other: C_PRIMITIVE_TUPLE): BOOLEAN
        -- True if Current and `other' are semantically the same
    do
        if count = other.count then
            Result := across members as cpo_csr all
                cpo_csr.item.same_type (other.members.i_th (cpo_csr.cursor_index)) and then
                    cpo_csr.item.c_congruent_to (other.members.i_th (cpo_csr.cursor_index))
            end
        end
    end