Stream: shorthand
Topic: Constrain datatype choice to Reference(Any)
Jean Duteau (Oct 14 2020 at 04:31):
I'm trying to constrain a datatype choice to just be a valueReference but want the reference to be any type. (Claim.supportingInfo.value[x]). I can't figure out how to do this as Reference(Any), Reference(any), Reference() all fail and the documentation doesn't refer to this case.
Chris Moesel (Oct 14 2020 at 12:13):
I'm assuming the Reference
in the choice is already a reference to any (otherwise you'd be widening the scope, which is not allowed). In that case, have you tried simply this: * value[x] only Reference
? I think that would say to only allow the Reference
type without impacting what the reference can point to.
Jean Duteau (Oct 14 2020 at 15:35):
that appears to have worked (running the build now but sushi didn't fail) but if I wanted to create an extension and specify that the value was Reference(Any), would the same work?
Chris Moesel (Oct 14 2020 at 17:09):
Yes, since by default, the reference in Extension.value[x]
is to any.
Mark Kramer (Oct 22 2020 at 11:48):
We should document that. It's definitely not in the documentation currently. I added FHIR-29399
Last updated: Apr 12 2022 at 19:14 UTC