FHIR Chat · Complex extensions reusing elements · conformance

Stream: conformance

Topic: Complex extensions reusing elements


view this post on Zulip Simone Heckmann (Aug 03 2018 at 08:43):

I have a complex extension with the elements A and B which are again complex having multiple sub-element

A
  A1
  A2
  A3
B
  B1
  B2

Question: Can element A be an extension of B, so that I have

A
  A1
  A2
  A3
B
  B1
  B2
  A
    A1
    A2
    A3

?

If so, how do I define that (with Forge)?

view this post on Zulip Michel Rutten (Aug 03 2018 at 09:38):

Hi @Simone Heckmann, interesting scenario. :wink:
In theory, you may be able to (ab)use the ElementDefinition.contentReference property:
Something like Extension.extension:B.extension:A.contentReference = "Extension.extension:A"
However:

  • I'm not sure if derived profiles/extension definitions are allowed to introduce new contentReferences?
  • I've never tested this in Forge, not sure if the tool supports this...

view this post on Zulip Lloyd McKenzie (Aug 03 2018 at 14:39):

I expect the IGPublisher and validator would blow up too...

view this post on Zulip Michel Rutten (Aug 03 2018 at 14:46):

@Lloyd McKenzie, is this even allowed by the spec?

view this post on Zulip Lloyd McKenzie (Aug 03 2018 at 20:14):

There's no prohibition against recursion in defining a complex extension.

view this post on Zulip Lloyd McKenzie (Aug 03 2018 at 20:14):

It's certainly not something explicitly contemplated or discussed, but technically it should be doable.

view this post on Zulip Simone Heckmann (Aug 13 2018 at 08:06):

IMO, this should work the same as with reusing Backbone-Elements, like we do with nested items in Questionnaire, for example.
...which is - I guess - what Michel is proposing.

view this post on Zulip Michel Rutten (Aug 13 2018 at 09:50):

Until now, I assumed that only core resource/datatype definitions (with StructureDefinition.derivation = specialization) are allowed to introduce a contentReference, to reduce complexity of the implementation. Interesting proposal however. Would you like to submit a gForge issue? i.e. also allow (complex) extension definitions to introduce a content reference.

view this post on Zulip Grahame Grieve (Aug 13 2018 at 10:33):

we have very specifically said, in r4, that only specialisations can use contentReference (after we considered all the truly confusing things you could do in a profile)

view this post on Zulip Michel Rutten (Aug 13 2018 at 11:04):

Phew... tool smith sigh of relief ;p

view this post on Zulip David Hay (Aug 13 2018 at 17:56):

Is deep nesting of complex extensions something to be encouraged? It kinda adds to the implementer complexity...

view this post on Zulip Lloyd McKenzie (Aug 13 2018 at 19:19):

Not encouraged. Deeper nesting than 2 levels should be unusual except possibly in Basic


Last updated: Apr 12 2022 at 19:14 UTC