Stream: implementers
Topic: Polymorphic/Union extensions
nicola (RIO/SS) (Aug 30 2019 at 13:22):
Can we define polymorphic/union extensions?
Do we have examples of such extensions?
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.
nicola (RIO/SS) (Aug 30 2019 at 14:01):
Thank you, Lloyd. Any examples of definition?
Lloyd McKenzie (Aug 30 2019 at 14:37):
http://build.fhir.org/extension-condition-dueto.html
nicola (RIO/SS) (Aug 30 2019 at 16:12):
Awesome - thank you!
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: [{....}]}
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.
nicola (RIO/SS) (Aug 30 2019 at 20:54):
Thank you!
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
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