Redefining occurrences: example contradicts specification
Description
Attachments
PR is addressed in
Activity
Thomas Beale May 26, 2018 at 1:18 PM
Well, I think that would have to be understood as a special kind of shorthand, which at the moment ADL does not have. I am inclined to be more literal, and require explicit removal of all currently defined nodes in whatever level. If we wanted a shorthand for removing all idX, including idX children, I'd say we need a syntax modifier of some kind.

Diego Bosca May 26, 2018 at 1:14 PM
but people could expect no id1.X nodes as they have prohibited the one in the parent, not redefined in their children. I can see this as something you could want to say on your local templates, to just remove a node and all the specializations made in an intermediate archetype.
Thomas Beale May 26, 2018 at 12:57 PM
good example - I might add that to the spec. But I think it has a fairly obvious interpretation: in the flattened grandchild, what you have is:
Node[id1.1] {0..2}
Node[id1.2] {1..2}
Node[id1.3] {0..4}
Node[id1.3] {0..*}
Whereas the child had
Node[id1] {0..2}
Node[id1.1] {0..2}
Node[id1.2] {1..2}
Node[id1.3] {0..4}
Node[id1.3] {0..*}
i.e. the grandchild just knocks out just the id1 node (NB: it can't be id1, that's the root node, so the above should be understood to be something like di2, id2.x etc).
The AWB indeed processes it like this - see the attached screenshots.

Diego Bosca May 26, 2018 at 12:00 PM
What I fear is things like this example:
original archetype:
Node[id1] {0..*}
children archetype:
Node[id1.1] {0..2}
Node[id1.2] {1..2}
Node[id1.3] {0..4}
Node[id1.3] {0..*}
grandchildren archetype:
Node[id1] {0}
Thomas Beale May 26, 2018 at 10:55 AM
With respect to the original question about node-id redefinition, the correct rules are here: https://www.openehr.org/releases/AM/latest/docs/ADL2/ADL2.html#_node_identifiers_3
The sentence about redefining node id if occurrences is redefined is wrong - it is a hangover from an older version of ADL. I'll correct this.
@Diego, well you always have access to the parent, so you can detect the presence of occurrences there (or not) and determine that the child is defining new, or redefining. I can dig out the code in the AWB validator if you want to check.
Details
Details
Reporter

In https://www.openehr.org/releases/AM/latest/docs/ADL2/ADL2.html#_occurrences_redefinition_and_exclusion , the specification says:
'If occurrences is redefined on an identified node, the node identifier must be specialised.'
Then an example follows that shows the redefinition of ocurrenes on an identified node. In the example, the same node identifier id4 is used both in the parent and child archetype - so no specialised node identifier is used.
Which one of these two is correct?
The examples after that show exclusion (occurrences matches {0}). Which is allowed specifically with the same node id according to earlier parts in the specification. So a non-specialised node identifier is at least allowed in some cases.
another trivial thing: Also the text says the example redefines the occurrences of id3, the example does it on id4.