Stream: shorthand
Topic: Error on creation of complex Extensions
Diana_Ovelgoenne (Mar 28 2022 at 09:29):
Hi, I think I found a bug.
I created a Complex Extension that includes 3 elements, 2 of them start with the text "coordinate", one is plain "coordinate" (defined as decimal), the other one "coordinateType"(defined as CodeableConcept). While defining them I get the error :
error Type constraint on Extension.extension.value[x] makes rules in WithError obsolete for choices: valueCodeableConcept
I changed the name of "coordinateType" to "cType" and the error disappears. I left the 2 definitions at FSHOnline
https://fshschool.org/FSHOnline/#/share/3LoSpGv
Chris Moesel (Mar 28 2022 at 15:16):
Yes, that does seem like a bug. Thanks for reporting it and thanks for providing a reproducible example.
I'd actually recommend a slightly different approach. Rather than this:
* extension[coordinateType].value[x] only CodeableConcept
* extension[coordinateType].valueCodeableConcept from SHSCoordinateTypeValueSet
I'd suggest this:
* extension[coordinateType].value[x] only CodeableConcept
* extension[coordinateType].value[x] from SHSCoordinateTypeValueSet
Since value[x]
is already restricted to a single type, there isn't a need to call out the type-specific slice of it. By just applying the binding directly to value[x]
:
- the resulting profile is simpler (no extra type slices)
- and you avoid the bug that you reported here
Chris Moesel (Apr 07 2022 at 14:47):
While I still recommend the workaround, I've also created SUSHI#1061 to track the original error.
Al Pivonka (Apr 07 2022 at 15:06):
yes I did make your recommended changes and it did resolve my FSH issue(s).
I greatly appreciate your insights.
Last updated: Apr 12 2022 at 19:14 UTC