FHIR Chat · necessity to mention BackboneElements · implementers

Stream: implementers

Topic: necessity to mention BackboneElements


view this post on Zulip Georg Fette (Oct 09 2019 at 08:23):

When defining a custom profile as a new StructureDefinition, is it necessary to define the intermediate BackboneElements as explicit elements or can they be ommited and only their contained elements have to be listed ? Because the existence of the BackboneElements can be implicitely assumed, when there is a path to subelements.

view this post on Zulip Chris Moesel (Oct 09 2019 at 11:56):

You need to define it, because otherwise we don't know the cardinality (i.e., is it 0..1, 1..1, 0..*, etc). I also think we can't assume it is a BackboneElement, because it also could be a normal Element. I think the only difference is that BackboneElement allows modifierExtension -- so technically modelers could use either one depending on what they want to allow.

view this post on Zulip Michel Rutten (Oct 09 2019 at 12:03):

In a logical model, BackBoneElement nodes can introduce child elements. Element nodes contain a single value.

view this post on Zulip Michel Rutten (Oct 09 2019 at 12:04):

And yes, a logical model definition must explicitly introduce all parent elements. Only constraining profiles can be sparse.

view this post on Zulip Chris Moesel (Oct 09 2019 at 12:53):

In a logical model, BackBoneElement nodes can introduce child elements. Element nodes contain a single value.

@Michel Rutten -- I did not know that. Is that documented somewhere or is it a convention? I can't seem to find it in the docs, but I may be looking in the wrong place.

view this post on Zulip Michel Rutten (Oct 09 2019 at 13:01):

Good question... not sure if this is explicitly documented in the spec. But if you look at the profiles that define the FHIR core resources, you will notice the same pattern.

view this post on Zulip Michel Rutten (Oct 09 2019 at 13:03):

An ElementDefinition in a profile can either:

  • Contain a primitive value => base Element
  • Introduce child elements => base BackboneElement
  • Reference an external type profile => base is the root element of the external profile

Last updated: Apr 12 2022 at 19:14 UTC