Existence matches {0} and further specialization: Should it be removed when flattening?

Description

  • prohibited attributes (existences matches {0}) should be removed from the flat structure according to the ADL2 spec. So if i do:

1:

Then in specializing archetype:

Then in the third or even fourth specilization level I do:

You would think this is not valid. But there is no way to check in the flattener, because the values attribute has been removed from the flat parent. If specialized at the third level, you could still check with the flat parent. But at the fourth level, the values attribute is gone, so there's no longer a way to check if the values attribute is allowed to be present in the flat parent.

Shouldn't the CAttribute just be kept in place until say operational template creation, to prevent this problem?

Problem is not present at the CObject level because of node ids and specialization level.

Environment

None

Activity

Show:
Thomas Beale
October 4, 2017, 2:55 PM

Firstly, it would be impossible to directly specialise
existence matches {0}
into
existence matches {1}

because only narrowed constraints are allowed, e.g. {0..1} => {0} or {1}.

But the problem you mention does exist at later levels. For this reason, 'deleted' attributes are not actually deleted during the flattening process, but retained and marked as deleted, so as to ensure the knowledge of earlier deletion is not lost. See here in the code: https://github.com/openEHR/adl-tools/blob/master/components/adl_compiler/src/comparator/archetype_flattener.e#L285

This should be explained more clearly in the spec.

Reporter

Pieter Bos

Labels

None

Components

Affects versions

Priority

Minor
Configure