Stream: conformance
Topic: Significance of StructureDefinition.derivation
Simone Heckmann (Dec 19 2017 at 13:10):
I'm not sure I understand the meaning of StructureDefinition.derivation.
http://build.fhir.org/structuredefinition-definitions.html#StructureDefinition.derivation
The Spec says "If the definition is a specialization, then it adds new elements in the differential, and the snapshot includes the inherited elements.
If the definition is a constraint, then it can not define new elements, it can only make new rules about existing content "
Am I not always constaining, even if I add new elements? To me that would mean adding an extension, which in turn is a constraint on one slice of the base resource's extensions.
What is the significance/consequence of either choice?
Simone Heckmann (Dec 19 2017 at 13:11):
Also: which one is the correct choice when defining an extension?
Michel Rutten (Dec 19 2017 at 15:15):
Hi @Simone Heckmann, derivation="specialization" indicates core resource & datatype definitions. Such StructureDefinitions are allowed to introduce new elements. Derivation="constraint" is for defining a profile on a core resource/datatype and for defining an extension definition (= constraint on core Extension).
Simone Heckmann (Dec 19 2017 at 15:17):
Ok, thanks. So the only place in Forge where derivation=specialisation would make sense is when defining a LogicalModel, right?
Simone Heckmann (Dec 19 2017 at 15:17):
Constraint is the default in Forge and I realized only today, that you can actually change that ;-)
Michel Rutten (Dec 19 2017 at 15:59):
Correct, Logical models are considered to be "specializations" and are allowed to introduce new elements.
Note that in theory, FHIR could also allow "derived" logical models with derivation=constraint, based upon another logical model. However I deliberately decided not to support this in Forge initially, until the community starts asking for this feature.
It doesn't make sense for the end user to change the derivation value. I'll make a note to display the derivation property value as read-only.
Last updated: Apr 12 2022 at 19:14 UTC