The DSTU2 May ballot version has a StructureDefintion resource (replaces Profile) that allows for "differential" definition of structures.
It's pretty straightforward to use this to add elements to an existing structure - all elements in the differential are "adds" to the base.
However, how does one modify or reduce an existing profile? More specifically:
How can an element in a base structure be reliably matched to an element in a differential structure so that the differential can modify the base?
I can see two possibilities:
- Use Path. A required element that works for non-sliced elements but not for slices (extensions are always slices).
- Use Name. Except it's optional, so if the base didn't name their element, this won't work.
Is there another way?
Working example here: http://hl7.org/fhir/2015May/extensibility-examples.html#1.16.2.1.2
In this example, matching by path would replace any other extension, and name matching won't work because neither element is named. The only option is to treat it as an addition (which luckily is the intent here). But if I wanted to further modify this structure using this one as the base (perhaps to set max="1") I'd be unable to.