FHIR Chat · Polymorphic/Union extensions · implementers

Stream: implementers

Topic: Polymorphic/Union extensions


view this post on Zulip nicola (RIO/SS) (Aug 30 2019 at 13:22):

Can we define polymorphic/union extensions?
Do we have examples of such extensions?

view this post on Zulip Lloyd McKenzie (Aug 30 2019 at 13:32):

Yes - you can have an extension that allows a mix of types. I vaguely recall having done that, though I don't remember where. Should work just fine.

view this post on Zulip nicola (RIO/SS) (Aug 30 2019 at 14:01):

Thank you, Lloyd. Any examples of definition?

view this post on Zulip Lloyd McKenzie (Aug 30 2019 at 14:37):

http://build.fhir.org/extension-condition-dueto.html

view this post on Zulip nicola (RIO/SS) (Aug 30 2019 at 16:12):

Awesome - thank you!

view this post on Zulip nicola (RIO/SS) (Aug 30 2019 at 19:14):

Another question - is it possible to have extension with has extensions and value?
i.e.
extension: [{url: ..., value[x]: ..., extension: [{....}]}

view this post on Zulip Lloyd McKenzie (Aug 30 2019 at 19:18):

No. There's an invariant that prevents that. If you have a value, you can't have sibling extensions. I.e. An extension is either complex or simple - it can't be a mix. However, if an extension has a value, you can put extensions inside the value.

view this post on Zulip nicola (RIO/SS) (Aug 30 2019 at 20:54):

Thank you!

view this post on Zulip Grahame Grieve (Aug 30 2019 at 22:26):

if an extension has a value, you can put extensions inside the value.

that's why we don't allow the other way -it would have the same meaning, so eliminate superfluous choice

view this post on Zulip Michel Rutten (Sep 02 2019 at 09:40):

FYI Forge should support all of this, if you want to experiment.


Last updated: Apr 12 2022 at 19:14 UTC