Thinking a little about node identifiers I have thought some
problematic use cases.
First, this is the current 'rule' in the wiki
(http://www.openehr.org/wiki/pages/viewpage.action?pageId=196633) for
when node identifiers are really needed. I copy the relevant part for
ease the discussion:
---------------------------------------------
ADL takes a minimalist approach and does not require node identifiers
where sibling object nodes can be otherwise distinguished.
Node identifiers are mandatory in the following cases:
* all immediate child object nodes of an attribute defined as
multiply-valued in the underlying information model (i.e. a container
type such as a List<T>, Set<T> etc.). This applies even if a
particular archetype only specifies one child object of the attribute;
* all immediate child object nodes of single-valued attributes that
are of the same reference model type, i.e. of the form of the
example shown in section 5.3.2;
* with the exception of use_node constraints where the node identifier
can be inferred from that of the target node.
In all other cases node identifiers are optional.
---------------------------------------------
Summarizing: Attributes defined as multiply-valued (I will use the
term 'multiple attributes'/'single attributes' to simplify) must have
always an at-code, but single attributes only if the type is used more
than once.
The problem with this rules come with the (explicit or implicit)
specialization of single attributes. take this example:
ELEMENT[at0009] occurrences matches {0..1} matches { -- Position
value existence matches {0..1} matches {
DV_TEXT occurrences
matches {0..1} matches {*}
}
}
What happens if a DV_TEXT is added on the specialization? Does it need
at code? Do we consider the rule to be applied to the archetype +
parent or only to the archetypes? Do we need to add an at-code also to
the parent?
This would need either a rewriting of the rule to state the issue with
flat archetypes or a potential problem if an at-code is not specified.
Another use case is when valid children types are part of the same
class hierarchy (no need for specialization). Do we need at-codes when
we create siblings such as DV_TEXT and DV_CODED_TEXT?
If we have several different data types, such as DV_BOOLEAN,
DV_QUANTITY, and DV_TEXT and then we want to add a DV_CODED_TEXT,
which one of the data types gets an at-code? all? only the text ones?
none?
Again, rewording/clarification is needed or problems may occur.
What is so wrong about having at-codes in every class of the archetype
with no ontology definition for that code?
Regards