Archetype slot regular expressions should cover whole identifier


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 :
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).


(Sam Heard) inactive
June 26, 2009, 1:01 AM

I believe this is a specification issue and is already implemented in all the tools


Thomas Beale

Raised By

Adam Flinton


Affects versions