Uploaded image for project: 'Specifications - Archetype model'
  1. SPECAM-5

Archetype slot regular expressions should cover whole identifier

    Details

    • Type: Change Request
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: ADL 1.4
    • Fix Version/s: ADL 2.0
    • Component/s: ADL, AOM
    • Labels:
      None
    • Impact Analysis:
      There will be minor impact on tools to ensure that this checking is performed, however implementation in the Java project shows that it is easy to implement.
    • Change Description:
      Hide
      The following changes are proposed to the ADL sepcification, section 5.3.8.1 - Slots based on Archetype Identifiers and Concepts:

      There are two ways in which archetype_id regular expressions patterns can be used:
      * as a pattern against which to test a particular archetype identifier being proposed for that slot;
      * as a pattern to use against a population of archetypes (e.g. all archetypes in a particular repository) in order to generate a list of all possible archetypes for filling the slot.
      Due to the second use, it is required that the regular expression pattern always cover a full archetype identifier rather than only sub-parts. As a consequence, a 'meta-pattern' can be defined to check archetype_id regular expressions for validity:
      ^.+-.+-.+\..*\..+$


      The following changes are made to the AOM:

      A new type EXPR_ARCHETYPE_ID_CONSTRAINT is added to the Assertion package, to represent constraints specifically on archetype identifiers. This enables the meta-pattern ^.+-.+-.+\..*\..+$ to be enforced as a template.
      Show
      The following changes are proposed to the ADL sepcification, section 5.3.8.1 - Slots based on Archetype Identifiers and Concepts: There are two ways in which archetype_id regular expressions patterns can be used: * as a pattern against which to test a particular archetype identifier being proposed for that slot; * as a pattern to use against a population of archetypes (e.g. all archetypes in a particular repository) in order to generate a list of all possible archetypes for filling the slot. Due to the second use, it is required that the regular expression pattern always cover a full archetype identifier rather than only sub-parts. As a consequence, a 'meta-pattern' can be defined to check archetype_id regular expressions for validity: ^.+-.+-.+\..*\..+$ The following changes are made to the AOM: A new type EXPR_ARCHETYPE_ID_CONSTRAINT is added to the Assertion package, to represent constraints specifically on archetype identifiers. This enables the meta-pattern ^.+-.+-.+\..*\..+$ to be enforced as a template.

      Description

      In archetypes based on the current specifications (1.0.x), archetype slots have often been defined with partial regular expressions, which match only part of an archetype identifier.
      Given the Archetype ID is something like :
          openEHR-EHR-CLUSTER.address.v1
      instead of :
          archetype_id/value matches {/address\.v1/}
      we should have (at the very least):
          archetype_id/value matches {/CLUSTER\.address\.v1 /}
      or (preferably)
         archetype_id/value matches {/openEHR-EHR-CLUSTER\.address\.v1 /}

      The reason for this is that slot regexes are not just used to determine if a given archetype identifier matches the slot (when a partial regex might work, although probably not reliably), but archetype id regexes are also used against a whole library of archetypes to generate lists of archetype_ids that match the slot, and the intended classes and reference model names need to be used to guarantee correct matching.

      Note that regex matching on archetype identifiers is syntactic; it does not ensure that archetypes based on subtypes of a mentioned type will match, since matching is a lexical operation. Such matches have to be specified explicitly by a multi-pattern regex (usually using the '|' character).

        Attachments

          Activity

            People

            • Assignee:
              thomas.beale Thomas Beale
              Reporter:
              thomas.beale Thomas Beale
              Raised By:
              Adam Flinton (Inactive)
              Analyst:
              Thomas Beale
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0.5d
                0.5d
                Remaining:
                Remaining Estimate - 0.5d
                0.5d
                Logged:
                Time Spent - Not Specified
                Not Specified