The Assertion Package
Overview
Assertions are expressed in archetypes in typed first-order predicate logic (FOL). They are used in two places: to express archetype slot constraints, and to express rules in complex object constraints. In both of these places, their role is to constrain something inside the archetype. Constraints on external resources such as terminologies are expressed in the constraint binding part of the archetype ontology, described in [_terminology_package]. The assertion package is illustrated below.
Semantics
Archetype assertions are statements which contain the following elements:
-
variables, which are inbuilt, archetype path-based, or external query results;
-
manifest constants of any primitive type, including the date/time types
-
arithmetic operators:
+,*,-,/,^(exponent),%(modulo division) -
relational operators:
>,<,>=,<=,=,!=,matches -
boolean operators:
not,and,or,xor -
quantifiers applied to container variables:
for_all,exists
The written syntax of assertions is defined in the openEHR ADL document. The package described here is currently designed to allow the representation of a general-purpose binary expression tree, as would be generated by a parser. This may be replaced in the future by a more specific model, if needed.
This relatively simple model of expressions is sufficiently powerful for representing FOL expressions on archetype structures, although it could clearly be more heavily subtyped.
Class Descriptions
Unresolved include directive in modules/AOM1.4/pages/assertion_package.adoc - include::ROOT:partial$classes/aom14.assertion.adoc[] Unresolved include directive in modules/AOM1.4/pages/assertion_package.adoc - include::ROOT:partial$classes/aom14.expr_item.adoc[] Unresolved include directive in modules/AOM1.4/pages/assertion_package.adoc - include::ROOT:partial$classes/aom14.expr_leaf.adoc[] Unresolved include directive in modules/AOM1.4/pages/assertion_package.adoc - include::ROOT:partial$classes/aom14.expr_operator.adoc[] Unresolved include directive in modules/AOM1.4/pages/assertion_package.adoc - include::ROOT:partial$classes/aom14.expr_unary_operator.adoc[] Unresolved include directive in modules/AOM1.4/pages/assertion_package.adoc - include::ROOT:partial$classes/aom14.expr_binary_operator.adoc[] Unresolved include directive in modules/AOM1.4/pages/assertion_package.adoc - include::ROOT:partial$classes/aom14.assertion_variable.adoc[] Unresolved include directive in modules/AOM1.4/pages/assertion_package.adoc - include::ROOT:partial$classes/aom14.operator_kind.adoc[]