FHIR Chat · extending a polymorphic element · shorthand

Stream: shorthand

Topic: extending a polymorphic element


view this post on Zulip Giorgio Cangioli (Apr 22 2020 at 09:52):

I'm trying to add an extension to a polymorphic element. (Coverage resource)
costToBeneficiary.value[x].extension contains dataAbsentReason named no-value 0..1 MS

view this post on Zulip Giorgio Cangioli (Apr 22 2020 at 09:52):

but if I do so I've a lot of errors back..e.g.
error No element found at path costToBeneficiary.value[x].extension for CoverageItEsensioni, skipping rule

view this post on Zulip Giorgio Cangioli (Apr 22 2020 at 09:53):

It works properly instead in this case
* costToBeneficiary.valueQuantity.extension contains dataAbsentReason named no-value 0..1 MS

view this post on Zulip Giorgio Cangioli (Apr 22 2020 at 09:55):

what I'm doing wrong in the first case ? (BTW, I don't want to add in the profile the same extension to each possible type of value[x])

view this post on Zulip Mint Thompson (Apr 23 2020 at 15:12):

This looks like something that certainly ought to be allowed. The team will investigate to see if there is existing syntax that will allow this, and if not, we will work to implement support for this.

view this post on Zulip Patrick Werner (Dec 07 2020 at 21:01):

is there an update on this? I'm still getting the error trying to extend value[x]

view this post on Zulip Chris Moesel (Dec 07 2020 at 21:28):

@Patrick Werner -- can you post a specific example? I just tested this with the following FSH and it worked fine:

Alias: DataAbsentReason = http://hl7.org/fhir/StructureDefinition/data-absent-reason

Profile: MyCoverage
Parent: Coverage
* costToBeneficiary.value[x].extension contains DataAbsentReason named no-value 0..1 MS

Profile: MyObservation
Parent: Observation
* value[x].extension contains DataAbsentReason named no-value 0..1 MS

view this post on Zulip Patrick Werner (Dec 07 2020 at 21:34):

your example works

view this post on Zulip Patrick Werner (Dec 07 2020 at 21:36):

oh, i missed the named part. my bad

view this post on Zulip Patrick Werner (Dec 07 2020 at 21:38):

the reported error was: No element found at path value[x].extension[http://hl7.org/fhir/StructureDefinition/observation-delta] for Test, skipping rule

view this post on Zulip Patrick Werner (Dec 07 2020 at 21:38):

which confused me

view this post on Zulip Nick Freiter (Dec 07 2020 at 23:01):

This looks like it could be a known bug raising it's head: https://github.com/FHIR/sushi/issues/674. SUSHI sometimes will have that error for paths that contain a URL. If you alias the URL:

Alias: observation_delta = http://hl7.org/fhir/StructureDefinition/observation-delta

And then reference the element using the alias:

value[x].extension[observation_delta]

Does that work?

view this post on Zulip Nick Freiter (Dec 07 2020 at 23:03):

Or, my mistake, maybe this shouldn't work at all unless you do have the named keyword. I was thinking it could still work even without using named.

view this post on Zulip Chris Moesel (Dec 08 2020 at 00:16):

I think that when you say extension contains w/ a URL, then you have to also specify named -- because a URL doesn't make for a valid slice name. Now... we could probably make an error message that just says that instead of the weird thing it says now...


Last updated: Apr 12 2022 at 19:14 UTC