Constraint Model Package

Overview

am.aom2.constraint_model Package and am.aom2.constraint_model.primitive Package illustrate the object model of constraints used in an archetype definition. This model is completely generic, and is designed to express the semantics of constraints on instances of classes which are themselves described in any orthodox object-oriented formalism, such as UML. Accordingly, the major abstractions in this model correspond to major abstractions in object-oriented formalisms, including several variations of the notion of 'object' and the notion of 'attribute'. The notion of 'object' rather than 'class' or 'type' is used because archetypes are about constraints on data (i.e. 'instances', or 'objects') rather than models, which are constructed from 'classes'. In this document, the word 'attribute' refers to any data property of a class, regardless of whether regarded as a 'relationship' (i.e. association, aggregation, or composition) or 'primitive' (i.e. value) attribute in an object model.

AM aom2.constraint model
Figure 1. am.aom2.constraint_model Package

The definition part of an archetype is an instance of a C_COMPLEX_OBJECT and consists of alternate layers of object and attribute constrainer nodes, each containing the next level of nodes. At the leaves are primitive object constrainer nodes constraining primitive types such as String , Integer etc. There are also nodes that represent internal references to other nodes, constraint reference nodes that refer to a text constraint in the constraint binding part of the archetype terminology, and archetype constraint nodes, which represent constraints on other archetypes allowed to appear at a given point. The full list of concrete node types is as follows:

  • C_COMPLEX_OBJECT : any interior node representing a constraint on instances of some non-primitive type, e.g. OBSERVATION, SECTION ;

  • C_ATTRIBUTE : a node representing a constraint on an attribute (i.e. UML 'relationship' or 'primitive attribute') in an object type;

  • C_PRIMITIVE_OBJECT : a node representing a constraint on a primitive (built-in) object type;

  • C_COMPLEX_OBJECT_PROXY : a node that refers to a previously defined C_COMPLEX_OBJECT node in the same archetype. The reference is made using a path;

  • ARCHETYPE_SLOT : a node whose statements define a constraint that determines which other archetypes can appear at that point in the current archetype. It can be thought of as a keyhole, into which few or many keys might fit, depending on how specific its shape is. Logically it has the same semantics as a C_COMPLEX_OBJECT, except that the constraints are expressed in another archetype, not the current one.

  • C_ARCHETYPE_ROOT : stands for the root node of an archetype; enables another archetype to be referenced from the present one. Used in both archetypes and templates.

The constraints define which configurations of reference model class instances are considered to conform to the archetype. For example, certain configurations of the classes PARTY, ADDRESS, CLUSTER and ELEMENT might be defined by a Person archetype as allowable structures for 'people with identity, contacts, and addresses'. Because the constraints allow optionality, cardinality and other choices, a given archetype usually corresponds to a set of similar configurations of objects.

AM aom2.constraint model.primitive
Figure 2. am.aom2.constraint_model.primitive Package

am.aom2.constraint_model.primitive-implem Package below shows the detailed temporal constraint definitions, used by the C_TEMPORAL class and descendants in the primitive package above.

AM aom2.constraint model.primitive implem
Figure 3. am.aom2.constraint_model.primitive-implem Package

The type-name nomenclature C_XXX used here is intended to be read as 'constraint on objects of type XXXX ', i.e. a C_COMPLEX_OBJECT is a 'constraint on a complex object (defined by a complex reference model type)'. These type names are used below in the formal model.

Semantics

The effect of the model is to create archetype definition structures that are a hierarchical alternation of object and attribute constraints. This structure can be seen by inspecting an ADL archetype, or by viewing an archetype in an AOM-based tool such as the openEHR ADL workbench, and is a direct consequence of the object-oriented principle that classes consist of properties, which in turn have types that are classes. (To be completely correct, types do not always correspond to classes in an object model, but it does not make any difference here). The repeated object/attribute hierarchical structure of an archetype provides the basis for using paths to reference any node in an archetype. Archetype paths follow a syntax that is a directly convertible in and out of the W3C Xpath syntax.

All Node Types

Some properties are defined for all node types, described in the following sections.

Path Functions

The path feature computes the path to the current node from the root of the archetype, while the has_path function indicates whether a given path can be found in an archetype.

Conformance Functions

All node types include two functions that formalise the notion of conformance of a specialised archetype to a parent archetype. Both functions take an argument which must be a corresponding node in a parent archetype, not necessarily the immediate parent. A 'corresponding' node is one found at the same or a congruent path. A congruent path is one in which one or more at-codes have been redefined in the specialised archetype.

The c_conforms_to function returns True if the node on which it is called is a valid specialisation of the 'other' node. The c_congruent_to function returns True if the node on which it is called is the same as the other node, with the possible exception of a redefined at-code. The latter may happen due to the need to restrict the domain meaning of node to a meaning narrower than that of the same node in the parent. The formal semantics of both functions are given in the class definitions, [_class_definitions_2].

Any_allowed

The any_allowed function defined on some node types indicates that any value permitted by the reference model for the attribute or type in question is allowed by the archetype; its use permits the logical idea of a completely "open" constraint to be simply expressed, avoiding the need for any further substructure.

Attribute Nodes

Constraints on reference model attributes, including computed attributes (represented by functions with no arguments in most programming languages), are represented by instances of C_ATTRIBUTE. The expressible constraints include:

  • is_multiple: a flag that indicates whether the C_ATTRIBUTE is constraining a multiply-valued (i.e. container) RM attribute or a single-valued one;

  • existence: whether the corresponding instance (defined by the rm_attribute_name attribute) must exist;

  • child objects: representing allowable values of the object value(s) of the attribute.

In the case of single-valued attributes (such as Person.date_of_birth) the children represent one or more alternative object constraints for the attribute value.

For multiply-valued attributes (such as Person.contacts: List<Contact>), a cardinality constraint on the container can be defined. The constraint on child objects is essentially the same except that more than one of the alternatives can co-exist in the data. C_ATTRIBUTE variants illustrates the two possibilities.

The appearance of both existence and cardinality constraints in C_ATTRIBUTE deserves some explanation, especially as the meanings of these notions are often confused in object-oriented literature. An existence constraint indicates whether an object will be found in a given attribute field, while a cardinality constraint indicates what the valid membership of a container object is. Cardinality is only required for container objects such as List<T> , Set<T> and so on, whereas existence is always possible. If both are used, the meaning is as follows: the existence constraint says whether the container object will be there (at all), while the cardinality constraint says how many items must be in the container, and whether it acts logically as a list, set or bag. Both existence and cardinality are optional in the model, since they are only needed to override the settings from the reference model.

c attributes
Figure 4. C_ATTRIBUTE variants

Object Node Types

The following sections apply to all object nodes in an archetype, i.e. instances of any descendant of C_OBJECT.

Rm_type_name and Reference Model Type Matching

Every object node has an rm_type_name attribute that states the RM type to be matched by that node in the archetype. The value of rm_type_name is understood as a constraint on the dynamic type of data instances of the stated Reference Model type. It is either a class name from the RM, or a generic type constructed from RM class names, as described in the Reference model type matching section of the ADL2 specification.

The RM type stated in an archetype object node is understood to be a static type constraint. Accordingly, it will match an instance of any RM subtype of the stated type, as long as the inheritance relationship is stated in the RM definition. This holds both for sub-classes, and subtypes of generic types, in a covariant fashion. The following matching will thus succeed:

  • rm_type_name = "PARTY" matches PERSON, where PERSON inherits from PARTY in the relevant RM;

  • rm_type_name = "Interval<Ordered>" matches a dynamic type of data items of Interval<Quantity>, SimpleInterval<Ordered> and SimpleInterval<Quantity> where Quantity inherits from Ordered and SimpleInterval inherits from Interval in the relevant RM.

There are some special rules that apply to primitive type matching that enable 'logical' primitive type names in archetypes to match multiple 'concrete' variants that occur in some reference models and programming type systems. These are described in detail below.

Node_id and Paths

The node_id attribute in the class C_OBJECT, inherited by all subtypes, is of key importance in the archetype constraint model. It has two functions:

  • it allows archetype object constraint nodes to be individually identified, and in particular, guarantees sibling node unique identification;

  • it provides a code to which a human-understanding terminology definition can be attached, as well as potentially a terminology binding.

The existence of node_ids in an archetype allows archetype paths to be created, which refer to each node. Every node in the archetype needs a node_id , but only node_ids for nodes under container attributes must have a terminology definition. For nodes under single-valued attributes, the terminology definition is optional (and typically not supplied), since the meaning is given by the reference model attribute definition.

Note that instances of C_PRIMITIVE_OBJECT have a constant node_id (see below) and thus do not require node identifiers to be supplied in syntax or serial forms that are converted to AOM structural form.

Sibling Ordering

Within a specialised archetype, redefined or added object nodes may be defined under a container attribute. Since specialised archetypes are in differential form, i.e. only redefined or added nodes are expressed, not nodes inherited unchanged, the relative ordering of siblings can’t be stated simply by the ordering of such items within the relevant list within the differential form of the archetype. An explicit ordering indicator is required if indeed order is specific. The C_OBJECT.sibling_order attribute provides this capability. It can only be set on a C_OBJECT descendant within a multiply-valued attribute, i.e. an instance of C_ATTRIBUTE for which the cardinality is ordered.

Node Deprecation

It is possible to mark an instance of any defined node type as deprecated, meaning that by preference it should not be used, and that there is an alternative solution for recording the same information. Rules or recommendations for how deprecation should be handled are outside the scope of the archetype proper, and should be provided by the governance framework under which the archetype is managed.

Reference Objects

Two subtypes of C_OBJECT, namely ARCHETYPE_SLOT and C_COMPLEX_OBJECT_PROXY are used to express constraints in the form of references to other constraints, rather than directly.

An ARCHETYPE_SLOT defines a 'slot' specifying other archetypes that can be plugged in at that point, in terms of constraints on archetype identifiers. These are expressed as instances of the ARCHETYPE_ID_CONSTRAINT class, a specialised version of the ELOM EL_CONSTRAINT_EXPRESSION class.

The type C_COMPLEX_OBJECT_PROXY represents a reference to another part of the current archetype that expresses exactly the same constraints needed at the point where the proxy appears.

Defined Object Nodes (C_DEFINED_OBJECT)

The C_DEFINED_OBJECT subtype corresponds to the category of C_OBJECTs that are defined in an archetype by value, i.e. by inline definition. Four properties characterise C_DEFINED_OBJECTs as follows.

Valid_value

The valid_value function tests a reference model object for conformance to the archetype. It is designed for recursive implementation in which a call to the function at the top of the archetype definition would cause a cascade of calls down the tree. This function is the key function of an 'archetype-enabled kernel' component that can perform runtime data validation based on an archetype definition.

Prototype_value

This function is used to generate a reasonable default value of the reference object being constrained by a given node. This allows archetype-based software to build a 'prototype' object from an archetype which can serve as the initial version of the object being constrained, assuming it is being created new by user activity (e.g. via a GUI application). Implementation of this function will usually involve use of reflection libraries or similar.

Default_value

This attribute allows a user-specified default value to be defined within an archetype. The default_value object must be of the same type as defined by the prototype_value function, pass the valid_value test. Where defined, the prototype_value function would return this value instead of a synthesised value.

Complex Objects (C_COMPLEX_OBJECT)

Along with C_ATTRIBUTE, C_COMPLEX_OBJECT is the key structuring type of the constraint_model package, and consists of attributes of type C_ATTRIBUTE, which are constraints on the attributes (i.e. any property, including relationships) of the reference model type. Accordingly, each C_ATTRIBUTE records the name of the constrained attribute (in rm_attr_name) , the existence and cardinality expressed by the constraint (depending on whether the attribute it constrains is a multiple or single relationship), and the constraint on the object to which this C_ATTRIBUTE refers via its children attribute (according to its reference model) in the form of further C_OBJECTs.

Primitive Types (C_PRIMITIVE_OBJECT descendants)

Constraints on primitive types are defined by the descendants of C_PRIMITIVE_OBJECT, i.e. C_STRING , C_INTEGER and so on. The primitive constraint types are represented in such a way as to accommodate both 'tuple' constraints and logically unary constraints, using a tuple array (C_PRIMITIVE_TUPLE.members) whose members are each a primitive constraint corresponding to each primitive type in the tuple. Tuple constraints are second order constraints, described below, enabling co-varying constraints to be stated. In the unary case, the constraint is the first member of a tuple array.

C_PRIMITIVE_OBJECT instances represented in ADL 'short' form are created with a fixed id-code ADL_CODE_DEFINITIONS.primitive_node_id as the value of node_id (see [ADL_CODE_DEFINITIONS Class]). For regularly structured C_PRIMITIVE_OBJECT instances, a normal node identifier is required.

The primitive constraint for each primitive type may itself be complex. Its formal type is the type of the constraint accessor in each C_PRIMITIVE_OBJECT descendant. The use of constrainer types for each assumed primitive RM type is summarised in the following table.

RM Primitive type AOM type AOM Primitive constrainer type Constraint description

Boolean

C_BOOLEAN

List <Boolean>

One or two Boolean values, enabling the logical constraints 'true', 'false' and 'true or false' to be expressed.

String

C_STRING

List <String>

A list of possible string values, which may include regular expressions, which are delimited by '/' characters.

Terminology_code

C_TERMINOLOGY_CODE

Terminology constraint -
[acN] or [atN]

A string containing either a single at-code or a single ac-code. In the latter case, the constraint refers to either a locally defined value set or (via a binding) an external value set.

Descendants of
Ordered

C_ORDERED

List <Interval<T:Ordered>>

A single value (which is a point interval), a list of values (list of point intervals), a list of intervals, which may be mixed proper and point intervals.

Integer

C_INTEGER

List <Interval<Integer>>

As for Ordered type, with T = Integer

Real

C_REAL

List <Interval<Real>>

As for Ordered type, with T = Real

Descendants of
Temporal

C_TEMPORAL

List <Interval<T:Temporal>>
OR
String (ADL pattern)

As for ordered types, with T being an sub-type type of Temporal, an ancestor of the assumed Date/time primitive types., with the addition of a second type constraint - a pattern based on ISO 8601 syntax.

Date

C_DATE

List <Interval<Date>>
OR
String (ADL pattern)

As for Temporal types with T = Date

Time

C_TIME

List <Interval<Time>>
OR
String (ADL pattern)

As for Temporal types with T = Time

Date_time

C_DATE_TIME

List <Interval<Date_time>>
OR
String (ADL pattern)

As for Temporal types with T = Date_time

Duration

C_DURATION

List <Interval<Duration>>
OR
String (ADL pattern)

As for Temporal types with T = Duration

List<T>

C_PRIMITIVE_OBJECT
descendant appropriate
to RM type

List<T> or List<Interval<T>>
for Ordered types

Members of List value match any value in constraint list

Interval<T:Ordered>

C_PRIMITIVE_ORDERED
descendant appropriate
to RM type

List<Interval<T>>

Interval value matches any (Interval) value in constraint list

The RM primitive types listed above are assumed to exist (possibly with different names) within any RM used as the basis for creating archetypes. Where any do not exist - e.g. if there are no date/time types in a particular RM - no archetype constraints can be defined for such nodes. Where the types have different names, name mapping can be performed as described in [RM Primitive Type Equivalences] below.

This facility can be used to effect the following mappings from C_PRIMITIVE_OBJECT descendants (C_STRING, C_INTEGER etc) to the types found in any particular RM.

  • String variants: in addition to matching String, C_STRING should match StringN and String_N instances, to accommodate RM types such as String8, String_32 etc;

  • Integer variants: in addition to matching Integer, C_INTEGER should match IntegerN and Integer_N, to accommodate RM types such as Integer_16, Integer64 etc;

  • Real variants: in addition to matching Real, C_REAL should match RealN and Real_N and Double, to accommodate RM types such as Real_32, Real64 and Double;

  • Date_time variants: typical names for Date_time such as DateTime, TimeStamp etc should be mapped to C_DATE.

Assumed_value

The assumed_value attribute is useful for archetypes containing any optional constraint. and provides an ability to define a value that can be assumed for a data item for which no data is found at execution time. If populated, it can contain a single at-code that must be in the local value set referred to by the ac-code in the constraint attribute.

For example, an archetype for the concept 'blood pressure measurement' might contain an optional protocol section containing a data point for patient position, with choices 'lying', 'sitting' and 'standing'. Since the section is optional, data could be created according to the archetype which does not contain the protocol section. However, a blood pressure cannot be taken without the patient in some position, so clearly there is an implied value for patient position. Amongst clinicians, basic assumptions are nearly always made for such things: in general practice, the position could always safely be assumed to be 'sitting' if not otherwise stated; in the hospital setting, 'lying' would be the normal assumption. The assumed_value feature of archetypes allows such assumptions to be explicitly stated so that all users/systems know what value to assume when optional items are not included in the data.

Note that the notion of assumed values is distinct from that of 'default values'. The latter notion is that of a default 'pre-filled' value that is provided (normally in a local context by a template) for a data item that is to be filled in by the user, but which is typically the same in many cases. Default values are thus simply an efficiency mechanism for users. As a result, default values do appear in data, while assumed values don’t.

Terminology Constraints

Formal Definition

The C_TERMINOLOGY_CODE type entails some complexity and merits further explanation. This is the only constrainer type whose constraint semantics are not self-contained, but located in the archetype terminology and/or in external terminologies.

A C_TERMINOLOGY_CODE instance in an archetype is structurally simple: it can only be one of the following constraints:

  • a single ac-code, referring to either a value-set defined in the archetype terminology or bound to an external value set or ref set;

    • in this case, an additional at-code may be included as an assumed value; the at-code must come from the locally defined value set;

  • a single at-code, representing a single possible value.

The second case in theory could be done using an ac-code referring to a value set containing a single value, but there seems little value in this extra verbiage, and little cost in providing the single-member value set short cut.

Constraint Strengths

Uniquely in the AOM, a Terminology code constraint may not be required, and may instead be considered informal. This is achieved via the attribute constraint_status which indicates either that the constraint is required (0) (i.e. the data item must formally conform to the constraint), or three levels of informal constraint, namely extensible (1) | preferred (2) | example (3). This particular model of constraint 'strength' follows the HL7 FHIR 'binding strengths' model. The convenience function constraint_required() can be used to determine if the constraint is formal, i.e. if constraint_status has the value required (0) or else is not set.

The informal constraint feature in C_TERMINOLOGY_CODE is provided to address the common real-world mismatch between local terminology use and more centrally defined archetypes. The enumeration values of 0 - 3 are designed such that the required constraint status (value = 0) is considered the default. Additionally, the constraint_status attribute is optional, and will not be present in archetypes authored with tools not including this feature. Accordingly, the constraint_required() function returns True if constraint_status is Void. This means that in all archetypes containing C_TERMINOLOGY_CODE nodes with no constraint_status, such nodes are considered to express a formally required constraint.

For the non-required settings of constraint_status, a data instance value may be a non-matching terminology code, including from another terminology. It might also be a plain text (i.e. not coded), in which case it will not be matched by a C_TERMINOLOGY_CODE archetype node, but an archetype node corresponding to the relevant RM type. In openEHR, this would usually be DV_TEXT. To allow for coded text or text matching therefore, at least 2 sibling archetype nodes are required, with one containing the appropriately configured C_TERMINOLOGY_CODE, and another representing a text-only constraint.

With respect to redefinition in specialised archetypes, the constraint strength may be redefined to be stronger, i.e. the enumeration value must be lower. Thus, a term constraint with strength of preferred (2) can be redefined to a strength of required (0).

Terminology Code Resolution

When an archetype is deployed in the form of an operational template, the internally defined value sets, and any bindings are processed in stages in order to obtain the final terminology codes from which the user should choose. The C_TERMINOLOGY_CODE class provides a number of functions to formalise this as follows.

  • value_set_expanded: List<String>: this function converts an ac-code to its corresponding set of at-codes, as defined in the value_sets section of the archetype.

  • value_set_substituted: List<URI>: where bindings exist to he value set at-codes, this function converts each code to its corresponding binding target, i.e. a URI.

  • value_set_resolved: List<TERMINOLOGY_CODE>: this function converts the list of URIs to final terms, including with textual rubrics, i.e. a list of TERMINOLOGY_CODEs.

These functions would normally be implemented as 'lambdas' or 'agents', in order to obtain access to the target terminologies.

Since an archetype might not contain external terminology bindings for all (or even any) of its terminological constraints, a 'resolved' archetype will usually contain at-codes in its cADL definition. These at-codes would be treated as real coded terms in any implementation that was creating data, and as a consequence, archetype at-codes could occur in real data, as described in the Terminology Integration section of the ADL specification.

Date/Time Constraints

The openEHR architecture assumes that primitive types representing 'date', 'time' and 'date_time' exist within every development environment, however such types or classes may be named. Within openEHR, these primitive types are named Iso8601_date etc., and are defined in the openEHR Foundation Types Specification.

As described in the openEHR ADL2 specification, these types are constrained using either value intervals or patterns. Both kinds of constraint are formally represented by the classes C_DATE, C_TIME and C_DATE_TIME. (A fourth time-related type, 'Duration' is constrained somewhat differently by the AOM class C_DURATION).

ADL2 value range constraints, such as the date range |2004-05-20..2005-05-19| are represented in the relevant constrainer meta-class (in this case C_DATE) by an attribute of the form constraint: List<Interval<Iso8601_date>>. Similarly, an ADL2 date/time range constraint such as |<2005-05-19T23:59:59| is represented by C_DATE_TIME.constraint of type List<Interval<Iso8601_date_time>>. The List<> structure allows such constraints to include more than one disjoint range.

The other means of expressing constraints in ADL2 is via patterns based on the ISO 8601 extended syntax form (i.e. the form that uses '-' and ':' characters in dates and times, respectively). These allow partial dates and times to be stated. Thus, the time constraint hh:??:XX means: any time consisting of hours, optional minutes, and no seconds. A full table of such constraint patterns is provided in the ADL2 specification.

Pattern constraints are represented within the AOM classes C_DATE etc. via the attribute pattern_constraint: String, inherited from the abstract class C_TEMPORAL. Validity may be checked using features defined on the class C_TEMPORAL_DEFINITIONS, such as valid_date_constraint_patterns, and also valid_date_constraint_replacements, for checking redefinitions within specialised archetypes.

Date/time pattern constraints are computationally represented via functions like month_validity(): VALIDITY_KIND, defined on C_DATE, C_TIME and C_DATE_TIME, where VALIDITY_KIND is an enumeration type defined in the openEHR Base Types. The lexical elements of the patterns are mapped to the values of VALIDITY_KIND as follows:

  • yyyy , mm, ddVALIDITY_KIND.mandatory

  • hh , mm, ssVALIDITY_KIND.mandatory

  • ??VALIDITY_KIND.optional

  • XXVALIDITY_KIND.prohibited

Accordingly, the '??' within the date constrainer pattern yyyy-??-XX maps to the result optional of the function C_DATE.month_validity().

Duration Constraints

Duration constraints follow the same general approach as Date/time constraints, such that the C_DURATION meta-class provides a range constraint attribute constraint: List<Interval<Iso8601_duration>> as well as the inherited attribute pattern_constraint: String to represent pattern constraints. These are described in openEHR ADL2 specification.

However, the pattern constraints are of a simpler form, and do not use the ?? or XX lexical elements. The pattern interpretation functions defined on C_DURATION are therefore of the form years_allowed: (): Boolean, months_allowed: (): Boolean. Validity of duration pattern constraints may be checked using relevant functions defined on C_TEMPORAL_DEFINITIONS.

Constraints on Enumeration Types

Enumeration types in the reference model are assumed to have semantics expected in UML, and mainstream programming languages, i.e. to be a distinct type based on a primitive type, normally Integer or String. Each such type consists of a set of values from the domain of its underlying type, thus, a set of Integer, String or other primitive values. Each of these values is assumed to be named in the manner of a symbolic constant. Although strictly speaking UML doesn’t require an enumerated type to be based on an underlying primitive type, programming languages do, hence the assumption here that values from the domain of such a type are involved.

A constraint on an enumerated type therefore consists of an AOM instance of a C_PRIMITIVE descendant, almost always C_INTEGER or C_STRING . The flag is_enumerated_type_constraint defined on C_PRIMITIVE indicates that a given C_PRIMITIVE is a constrainer for an enumerated type.

Since C_PRIMITIVEs don’t have type names in ADL, the type name is inferred by any parser or compiler tool that deserialises an archetype from ADL, and stored in the rm_type attribute inherited from C_OBJECT . An example is shown below of a type enumeration.

enumerated type constraint
Figure 5. Enumerated Constraint

A parser that deserialises from an object dump format such as ODIN, JSON or XML will not need to do this.

The form of the constraint itself is simply a series of Integer, String or other primitive values, or an equivalent range or ranges. In the above example, the ADL equivalent of the pk_percent, pk_fraction constraint on a field of type PROPORTION_KIND is in fact just \{2, 3}, and it is visualised by lookup to show the relevant symbolic names.

Second Order Constraints

All the constraint semantics described above can be considered 'first order' in the sense that they define how specific object/attribute/object hierarchies are defined in the instance possibility space of some part of a reference model.

Some constraints however do not fit directly within the object/attribute/object hierarchy scheme, and are considered 'second order constraints' in the archetype formalism. The 'rule' constraints ('invariants' in ADL/AOM 1.4) constitute one such group. These constraints are defined in terms of first order predicate logic statements that can refer to any number of constraint nodes within the main hierarchy. These are described in [rules_package].

Another type of second order constraint can be 'attached' to the object/attribute/object hierarchy in order to further limit structural possibilities. Although these constraints could also theoretically be expressed as rules, they are supported by direct additions to the main constraint model since they can be easily and intuitively represented inline in ADL and corresponding AOM structures.

Tuple Constraints

Tuple constraints are designed to account for the very common need to constrain the values of more than one RM class attribute together. This effectively treats the attributes in question as a tuple, and the corresponding object constraints are accordingly modelled as tuples as well. A detailed explanation of tuples can be found in the ADL2 specification’s section on second order constraints. Additions to the main constraint model to support tuples are shown below.

AM aom2.constraint model tuple
Figure 6. Tuple Constraint Model

In this model, the type C_ATTRIBUTE_TUPLE groups the co-constrained C_ATTRIBUTEs under a C_COMPLEX_OBJECT. Currently, the concrete type is limited to being C_PRIMITIVE_OBJECT to reduce complexity, and since it caters for all known examples of tuple constraints. In principle, any C_DEFINED_OBJECT could be allowed, and this may change in the future.

The tuple constraint type replaces all domain-specific constraint types defined in ADL/AOM 1.4, including C_DV_QUANTITY and C_DV_ORDINAL.

These additions allow standard constraint structures (i.e. C_ATTRIBUTE / C_COMPLEX_OBJECT / C_PRIMITIVE_OBJECT hierarchies) to be 'annotated', while leaving the first order structure intact. The following example shows an archetype instance structure in which a notional ORDINAL type is constrained. The logical requirement is to constrain a ORDINAL to one of three instance possibilities, each of which consists of a pair of values for the attributes value and symbol, of type Integer and TERMINOLOGY_CODE respectively. Each of these three instance constraints should be understood as an alternative for the single valued owning attribute, ELEMENT .value. Tuple constraints achieve the requirement to express the constraints as pairs not just as allowable alternatives at the final leaf level, which would incorrectly allowing any mixing of the Integer and code values.

AM ordinal tuple example
Figure 7. Tuple Constraint Example AOM Instances
tuple example data
Figure 8. Tuple Constraint Example Data

Assertions

Assertions are used in ARCHETYPE_SLOTs, in order to express the 'included' and 'excluded' archetypes for the slot. In this case, each assertion is an expression that refers to parts of other archetypes, such as its identifier (e.g. 'include archetypes with short_concept_name matching xxxx '). Assertions are modelled here as a generic expression tree of unary prefix and binary infix operators. Examples of archetype slots in ADL syntax are given in the openEHR ADL2 specification.

AOM Type Substitutions

The C_OBJECT types defined in Object Node Types are reproduced below, with concrete types that may actually occur in archetypes shown in dark yellow / non-italic.

c object substitutions
Figure 9. C_Object Substitutions

Within a specialised archetype, nodes that redefine corresponding nodes in the parent are normally of the same C_OBJECT type (we can think of this as a 'meta-type', since the RM type is the 'type' in the information model sense), but in some cases may also be of different C_OBJECT types.

The rules for meta-type redefinition are as follows:

  • A node of each meta-type can be redefined by a node of the same meta-type, with narrowed / added constraints;

  • ARCHETYPE_SLOT can be redefined by:

    • one or more C_ARCHETYPE_ROOT nodes taken together, considered to define a 'filled' version of the slot;

    • an ARCHETYPE_SLOT , in order to close the slot.

  • A C_ARCHETYPE_ROOT node can be redefined by:

    • A C_ARCHETYPE_ROOT , where the archetype_ref of the redefining node is a specialisation of that mentioned in the parent node.

  • A 'terminal' C_COMPLEX_OBJECT node containing no constraint other than RM type, node_id and possibly occurrences (i.e. having no substructure), can be redefined by a constraint of any other AOM type other than C_PRMITIVE_OBJECT.

The 'terminal' C_COMPLEX_OBJECT can be understood as a placeholder node primarily defined for the purpose of stating RM type and meaning (id-code).

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<Boolean,TUPLE2<String,String>>[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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

(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<Boolean,TUPLE2<String,String>>[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",
                        "generic_parameters": [
                            "Boolean",
                            {
                                "_type": "P_BMM_GENERIC_TYPE",
                                "root_type": "TUPLE2",
                                "generic_parameters": [
                                    "String",
                                    "String"
                                ]
                            }
                        ]
                    }
                }
            },
            "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"
    }
}
aom2.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<Boolean,TUPLE2<String,String>>[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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

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

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: ARCHETYPE_CONSTRAINT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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

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

{
    "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",
                        "generic_parameters": [
                            "Boolean",
                            {
                                "_type": "P_BMM_GENERIC_TYPE",
                                "root_type": "TUPLE2",
                                "generic_parameters": [
                                    "String",
                                    "String"
                                ]
                            }
                        ]
                    }
                }
            },
            "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"
            }
        }
    }
}
aom2.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 distinguish 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
(effected)

c_conforms_to (
other: C_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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
(effected)

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
(effected)

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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

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 distinguish 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

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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

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

{
    "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 distinguish 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",
                        "generic_parameters": [
                            "Boolean",
                            {
                                "_type": "P_BMM_GENERIC_TYPE",
                                "root_type": "TUPLE2",
                                "generic_parameters": [
                                    "String",
                                    "String"
                                ]
                            }
                        ]
                    }
                }
            },
            "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"
            }
        }
    }
}
aom2.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"
            }
        }
    }
}
aom2.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 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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_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.

Functions

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

(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

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

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)"
    }
}
aom2.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<Boolean,TUPLE2<String,String>>[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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_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.
Inherited from C_DEFINED_OBJECT

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

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_COMPLEX_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_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) 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.
Inherited from C_DEFINED_OBJECT

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

Generate a prototype value from this constraint object.
Inherited from C_DEFINED_OBJECT

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

Invariants

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

{
    "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",
                        "generic_parameters": [
                            "Boolean",
                            {
                                "_type": "P_BMM_GENERIC_TYPE",
                                "root_type": "TUPLE2",
                                "generic_parameters": [
                                    "String",
                                    "String"
                                ]
                            }
                        ]
                    }
                }
            },
            "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"
            }
        }
    }
}
aom2.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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_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.
Inherited from C_DEFINED_OBJECT

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

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

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

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

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

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_COMPLEX_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_COMPLEX_OBJECT

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.
Inherited from C_COMPLEX_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_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.
Inherited from C_COMPLEX_OBJECT

(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.
Inherited from C_DEFINED_OBJECT

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

Generate a prototype value from this constraint object.
Inherited from C_DEFINED_OBJECT

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

Invariants

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

{
    "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"
        }
    }
}
aom2.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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_OBJECT

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

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

any_allowed (): Boolean [1..1]

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

Invariants

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

{
    "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"
            }
        }
    }
}
aom2.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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_OBJECT

target_path: String [1..1]

Reference to an object node using archetype path notation.

Functions

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.

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.

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.
Inherited from C_OBJECT

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

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

{
    "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"
            }
        }
    }
}
aom2.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<Boolean,TUPLE2<String,String>>[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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_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.
Inherited from C_DEFINED_OBJECT

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

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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

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

(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.
Inherited from C_DEFINED_OBJECT

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

Generate a prototype value from this constraint object.
Inherited from C_DEFINED_OBJECT

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

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

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

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",
                        "generic_parameters": [
                            "Boolean",
                            {
                                "_type": "P_BMM_GENERIC_TYPE",
                                "root_type": "TUPLE2",
                                "generic_parameters": [
                                    "String",
                                    "String"
                                ]
                            }
                        ]
                    }
                }
            },
            "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)"
    }
}
aom2.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
(redefined)

constraint: List<Boolean>

Boolean constraint - a list of Boolean values.

0..1
(redefined)

assumed_value: Boolean

Assumed Boolean value.

0..1
(redefined)

default_value: Boolean

Default Boolean value.

Functions

Signature

Meaning

1..1
(effected)

prototype_value (): Boolean

Prototype Boolean value.

1..1
(effected)

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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_OBJECT

default_value: Boolean [0..1]

Default Boolean value.

assumed_value: Boolean [0..1]

Assumed Boolean value.

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.
Inherited from C_PRIMITIVE_OBJECT

constraint: List<Boolean> [0..1]

Boolean constraint - a list of Boolean values.

Functions

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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) 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.
Inherited from C_DEFINED_OBJECT

prototype_value (): Boolean [1..1]

Prototype Boolean value.

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

has_assumed_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from 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.
Inherited from C_PRIMITIVE_OBJECT

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

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

Inv_valid_assumed_value: valid_value (assumed_value)
Inherited from C_PRIMITIVE_OBJECT

{
    "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"
            }
        }
    }
}
aom2.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
(redefined)

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
(redefined)

assumed_value: String

Assumed String value.

Functions

Signature

Meaning

1..1
(effected)

prototype_value (): String

1..1
(effected)

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
(effected)

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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_OBJECT

default_value: String [0..1]

Default String value.

assumed_value: String [0..1]

Assumed String value.

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.
Inherited from C_PRIMITIVE_OBJECT

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

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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]

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

has_assumed_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from 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.
Inherited from C_PRIMITIVE_OBJECT

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

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

Inv_valid_assumed_value: valid_value (assumed_value)
Inherited from C_PRIMITIVE_OBJECT

{
    "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"
            }
        }
    }
}
aom2.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
(effected)

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_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
(effected)

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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_OBJECT

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.

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.
Inherited from C_PRIMITIVE_OBJECT

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

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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) 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.
Inherited from C_DEFINED_OBJECT

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

Generate a prototype value from this constraint object.
Inherited from C_DEFINED_OBJECT

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

has_assumed_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from 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.
Inherited from C_PRIMITIVE_OBJECT

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

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

Inv_valid_assumed_value: valid_value (assumed_value)
Inherited from C_PRIMITIVE_OBJECT

{
    "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"
            }
        }
    }
}
aom2.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
(redefined)

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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_OBJECT

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.

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.
Inherited from C_PRIMITIVE_OBJECT

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

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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.
Inherited from C_ORDERED

(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.
Inherited from C_DEFINED_OBJECT

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

Generate a prototype value from this constraint object.
Inherited from C_DEFINED_OBJECT

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

has_assumed_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from 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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from 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.
Inherited from C_ORDERED

Invariants

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

Inv_valid_assumed_value: valid_value (assumed_value)
Inherited from C_PRIMITIVE_OBJECT

{
    "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"
        }
    }
}
aom2.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
(redefined)

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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_OBJECT

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.

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.
Inherited from C_PRIMITIVE_OBJECT

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

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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.
Inherited from C_ORDERED

(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.
Inherited from C_DEFINED_OBJECT

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

Generate a prototype value from this constraint object.
Inherited from C_DEFINED_OBJECT

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

has_assumed_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from 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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from 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.
Inherited from C_ORDERED

Invariants

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

Inv_valid_assumed_value: valid_value (assumed_value)
Inherited from C_PRIMITIVE_OBJECT

{
    "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"
        }
    }
}
aom2.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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_ORDERED

assumed_value: T [0..1]

Value to be assumed if none sent in data.
Inherited from C_ORDERED

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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from C_ORDERED

pattern_constraint: String [0..1]

Optional alternative constraint in the form of a pattern based on ISO8601. See descendants for details.

Functions

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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) 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.
Inherited from C_DEFINED_OBJECT

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

Generate a prototype value from this constraint object.
Inherited from C_DEFINED_OBJECT

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

has_assumed_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from 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.
Inherited from C_PRIMITIVE_OBJECT

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

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

Inv_valid_assumed_value: valid_value (assumed_value)
Inherited from C_PRIMITIVE_OBJECT

{
    "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"
            }
        }
    }
}
aom2.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"
            }
        }
    }
}
aom2.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
(effected)

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
(effected)

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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_OBJECT

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.

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.
Inherited from C_PRIMITIVE_OBJECT

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.

pattern_constraint: String [0..1]

Optional alternative constraint in the form of a pattern based on ISO8601. See descendants for details.
Inherited from C_TEMPORAL

Functions

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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.
Inherited from C_TEMPORAL

(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.
Inherited from C_DEFINED_OBJECT

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

Generate a prototype value from this constraint object.
Inherited from C_DEFINED_OBJECT

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

has_assumed_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from 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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from 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.
Inherited from C_TEMPORAL

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

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

Inv_valid_assumed_value: valid_value (assumed_value)
Inherited from C_PRIMITIVE_OBJECT

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)"
    }
}
aom2.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
(effected)

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
(effected)

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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_OBJECT

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.

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.
Inherited from C_PRIMITIVE_OBJECT

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.

pattern_constraint: String [0..1]

Optional alternative constraint in the form of a pattern based on ISO8601. See descendants for details.
Inherited from C_TEMPORAL

Functions

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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.
Inherited from C_TEMPORAL

(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.
Inherited from C_DEFINED_OBJECT

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

Generate a prototype value from this constraint object.
Inherited from C_DEFINED_OBJECT

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

has_assumed_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from 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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from 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.
Inherited from C_TEMPORAL

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

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

Inv_valid_assumed_value: valid_value (assumed_value)
Inherited from C_PRIMITIVE_OBJECT

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)"
    }
}
aom2.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
(effected)

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
(effected)

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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_OBJECT

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.

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.
Inherited from C_PRIMITIVE_OBJECT

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.

pattern_constraint: String [0..1]

Optional alternative constraint in the form of a pattern based on ISO8601. See descendants for details.
Inherited from C_TEMPORAL

Functions

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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.
Inherited from C_TEMPORAL

(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.
Inherited from C_DEFINED_OBJECT

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

Generate a prototype value from this constraint object.
Inherited from C_DEFINED_OBJECT

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

has_assumed_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from 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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from 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.
Inherited from C_TEMPORAL

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

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

Inv_valid_assumed_value: valid_value (assumed_value)
Inherited from C_PRIMITIVE_OBJECT

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.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "VALIDITY_KIND"
            }
        }
    },
    "invariants": {
        "Pattern_validity": "pattern /= Void implies valid_iso8601_date_time_constraint_pattern(pattern)"
    }
}
aom2.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
(effected)

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
(effected)

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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_OBJECT

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.

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.
Inherited from C_PRIMITIVE_OBJECT

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.

pattern_constraint: String [0..1]

Optional alternative constraint in the form of a pattern based on ISO8601. See descendants for details.
Inherited from C_TEMPORAL

Functions

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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.
Inherited from C_TEMPORAL

(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.
Inherited from C_DEFINED_OBJECT

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

Generate a prototype value from this constraint object.
Inherited from C_DEFINED_OBJECT

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

has_assumed_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from 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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from 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.
Inherited from C_TEMPORAL

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

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

Inv_valid_assumed_value: valid_value (assumed_value)
Inherited from C_PRIMITIVE_OBJECT

{
    "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"
            }
        }
    }
}
aom2.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
(redefined)

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
(redefined)

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
(effected)

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
(effected)

prototype_value (): Terminology_code

A generated prototype value from this constraint object.

1..1
(effected)

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

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

String leader of ‘identifier’ codes, i.e. codes used to identify archetype nodes.
Inherited from 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.
Inherited from 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.
Inherited from ADL_CODE_DEFINITIONS

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

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

Code_regex_pattern: String = "(0|[1-9][0-9]*)(\.(0|[1-9][0-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.
Inherited from 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..
Inherited from ADL_CODE_DEFINITIONS

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

Code id used for C_PRIMITIVE_OBJECT nodes on creation.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from ARCHETYPE_CONSTRAINT

soc_parent: C_SECOND_ORDER [0..1]

+ Inherited from ARCHETYPE_CONSTRAINT

rm_type_name: String [1..1]

Reference model type that this node corresponds to.
Inherited from 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.
Inherited from C_OBJECT

node_id: String [1..1]

Semantic identifier of this node, used to distinguish 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.
Inherited from C_OBJECT

is_deprecated: Boolean [0..1]

True if this node and by implication all sub-nodes are deprecated for use.
Inherited from 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.
Inherited from C_OBJECT

default_value: Terminology_code [0..1]

assumed_value: Terminology_code [0..1]

Assumed Terminology code value.

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.
Inherited from C_PRIMITIVE_OBJECT

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

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?
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.
Inherited from 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.

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.
Inherited from ADL_CODE_DEFINITIONS

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.
Inherited from C_OBJECT

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

True if the relative path a_path exists at this node.
Inherited from ARCHETYPE_CONSTRAINT

path (): String [1..1]

Path of this node relative to root of archetype.
Inherited from ARCHETYPE_CONSTRAINT

c_conforms_to (
other: C_PRIMITIVE_OBJECT[1],
rmcc: FUNCTION<Boolean,TUPLE2<String,String>>[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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from C_PRIMITIVE_OBJECT

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.
Inherited from ARCHETYPE_CONSTRAINT

is_root (): Boolean [1..1]

True if this node is the root of the tree.
Inherited from 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.
Inherited from ARCHETYPE_CONSTRAINT

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.
Inherited from 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.
Inherited from 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.
Inherited from C_OBJECT

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.
Inherited from C_OBJECT

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.

has_default_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from C_DEFINED_OBJECT

has_assumed_value (): Boolean [1..1]

True if there is an assumed value.
Inherited from 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.
Inherited from C_PRIMITIVE_OBJECT

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

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

Inv_valid_default_value: valid_value (default_value)
Inherited from C_DEFINED_OBJECT

Inv_valid_assumed_value: valid_value (assumed_value)
Inherited from C_PRIMITIVE_OBJECT

{
    "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"
            }
        }
    }
}
aom2.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

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.
Inherited from Integer

equal alias "=", "==" (
other: Integer[1]
): Boolean [1..1]

Reference equality for reference types, value equality for value types.
Inherited from Integer

instance_of (
a_type: String[1]
): Any [1..1]

Create new instance of a type.
Inherited from 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>".
Inherited from Any

not_equal alias "!=", "≠" (
other: Ordered[1]
): Boolean [1..1]

True if current object not equal to other. Returns not equal().
Inherited from Any

less_than alias "<" (
other: Integer[1]
): Boolean [1..1]

Returns True if current Integer is less than other.
Inherited from Integer

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.
Inherited from Ordered

greater_than alias ">" (
other: Ordered[1]
): Boolean

Post_result: Result = (other < self) [1..1]

True if current object greater than other.
Inherited from 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.
Inherited from Ordered

add alias "+" (
other: Integer[1]
): Integer [1..1]

Integer addition.
Inherited from Integer

subtract alias "-" (
other: Integer[1]
): Integer [1..1]

Integer subtraction.
Inherited from Integer

multiply alias "*" (
other: Integer[1]
): Integer [1..1]

Integer multiplication.
Inherited from Integer

divide alias "/" (
other: Integer[1]
): Double [1..1]

Integer division.
Inherited from Integer

exponent alias "^" (
other: Double[1]
): Double [1..1]

Integer exponentiation.
Inherited from Integer

negative alias "-" (): Integer [1..1]

Generate negative of current Integer value.
Inherited from Integer

modulo alias "mod", "\\" (
mod: Integer[1]
): Integer [1..1]

Return self modulo other.
Inherited from Integer

{
    "_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."
    ]
}
aom2.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<Boolean,TUPLE2<String,String>>[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<Boolean,TUPLE2<String,String>>[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",
                        "generic_parameters": [
                            "Boolean",
                            {
                                "_type": "P_BMM_GENERIC_TYPE",
                                "root_type": "TUPLE2",
                                "generic_parameters": [
                                    "String",
                                    "String"
                                ]
                            }
                        ]
                    }
                }
            },
            "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"
            }
        }
    }
}
aom2.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
(redefined)

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<Boolean,TUPLE2<String,String>>[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<Boolean,TUPLE2<String,String>>[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",
                        "generic_parameters": [
                            "Boolean",
                            {
                                "_type": "P_BMM_GENERIC_TYPE",
                                "root_type": "TUPLE2",
                                "generic_parameters": [
                                    "String",
                                    "String"
                                ]
                            }
                        ]
                    }
                }
            },
            "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"
            }
        }
    }
}
aom2.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
(redefined)

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<Boolean,TUPLE2<String,String>>[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<Boolean,TUPLE2<String,String>>[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",
                        "generic_parameters": [
                            "Boolean",
                            {
                                "_type": "P_BMM_GENERIC_TYPE",
                                "root_type": "TUPLE2",
                                "generic_parameters": [
                                    "String",
                                    "String"
                                ]
                            }
                        ]
                    }
                }
            },
            "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"
            }
        }
    }
}
aom2.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