FHIR Chat · Forge/FHIR discriminators · implementers

Stream: implementers

Topic: Forge/FHIR discriminators


view this post on Zulip Brian Reinhold (Apr 12 2017 at 12:18):

Maybe I am not correctly interpreting the FHIR discriminators documentation but I would have expected that one could use the value of another element within the resource as a discriminator. I would think that would be an easy way for implementers to support discriminators in profile compliance testing. For example, say I have a set of value[x] slices for different types of measurements. Now an ideal discriminator would be the Observation.identifier.type.code which would be required to have a certain value. Is there a way to do that? I thought that might be the FHIRPATH aspect of the discriminator but I don't see how that comes in using Forge.

view this post on Zulip Michel Rutten (Apr 12 2017 at 12:22):

Hi @Brian Reinhold yes, this is a very common use case and fortunately FHIR allows you to define this. In STU3, specify discriminator.type = "value" and discriminator.path = "type.code" (relative path to child element). In other words, recognize slices by inspecting the value of that child element.

view this post on Zulip Brian Reinhold (Apr 12 2017 at 18:36):

Michel,
That's not quite what I meant. I was thinking of using a field in another element (Not the one I am slicing) as the discriminator.

view this post on Zulip Eric Haas (Apr 12 2017 at 19:51):

Sound like an invariant

view this post on Zulip Michel Rutten (Apr 13 2017 at 09:15):

Indeed, you can specify a FHIR path constraint that controls several elements. You can check the (STU3) core profiles for examples of FHIR path expressions.

view this post on Zulip Jonathan Mew (Apr 19 2017 at 15:51):

I have been looking at a profile on the Patient resource, created using Forge. A number of extensions are declared with specific types, so slicing has been set up. The slicing discriminator is "url". There are no Patient.extension.url elements, but there is a url present in at element/type/profile/@value. This appears to be the only URL information related to these extensions.

Is this correct? And if so, are there any other special cases like this to be aware of?

Sorry if this is an obvious question, I'm still getting my teeth into FHIR profiles!

view this post on Zulip Michel Rutten (Apr 19 2017 at 16:03):

Hi @Jonathan Mew this is correct. A profile references an external extension definition by constraining the element type profile to the canonical uri of the extension definition. The extension.url element is (only) used in Extension definitions.

view this post on Zulip Jonathan Mew (Apr 20 2017 at 15:47):

Many thanks @Michel Rutten, that resolves my query.


Last updated: Apr 12 2022 at 19:14 UTC