FHIR Chat · Extensions with 0..1 children · dotnet

Stream: dotnet

Topic: Extensions with 0..1 children


view this post on Zulip Kim Ruben Vatnehagen (Apr 27 2020 at 10:10):

Just wondering if it is correct to assume that an extension defined without value, but with one optional child is not valid if that one child is missing?

Say you have a ContactPoint and you use the value property of it to store the value.
You also want to add an extension to this ContactPoint that:

  1. Identifies the type of custom ContactPoint
  2. And might have one more value in reference to the type in 1

We are seeing that using httpclient to post a resource with just an empty extension is working fine, but when using the FhirClient it strips away the extension if it does not have any children.

Is this behavior as intended?

view this post on Zulip Johannes Höhn (Apr 27 2020 at 10:15):

Elements cannot be empty in Fhir. Having an optional child does not make much sense. The only way you can leave off the element is if you add extensions to your extension.

view this post on Zulip Kim Ruben Vatnehagen (Apr 27 2020 at 10:28):

Thanks for the quick reply! Clear and concise.


Last updated: Apr 12 2022 at 19:14 UTC