FHIR Chat · Environment variables that are collections · fhirpath

Stream: fhirpath

Topic: Environment variables that are collections


view this post on Zulip JP (Jun 09 2021 at 17:49):

Hi! I have a use case where I'm trying to use a List of Encounters as the Environment variable %encounters. In trying to implement the IEvaluationContext interface I discovered that it expects to return a single Base object:

https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-structures-r5/org/hl7/fhir/r5/utils/FHIRPathEngine.IEvaluationContext.html#resolveConstant(java.lang.Object,java.lang.String,boolean)

I can't find any restriction on the use of collections in FHIRPath in any of the relevant guidance, and in fact it seems that everything should be treated as a collection:

http://hl7.org/fhir/fhirpath.html#vars

Note that these tokens are not restricted to simple types,

http://hl7.org/fhirpath/#collections

Collections are fundamental to FHIRPath, in that the result of every expression is a collection

Is there a different interface I should be implementing? Or is this an oversight in the IEvaluationContext interface?

view this post on Zulip JP (Jun 10 2021 at 17:48):

Is this a question more appropriate for the hapi thread?

view this post on Zulip Paul Lynch (Jun 10 2021 at 18:05):

Possibly. I know FHIRPath, but I don't know what IEvaluationContext or Base are. But, there are probably some people on this stream who do.

view this post on Zulip JP (Jun 10 2021 at 18:09):

That makes sense. They are part of the org.hl7.fhir implementation of a FhirPath engine.

view this post on Zulip Grahame Grieve (Jun 10 2021 at 18:24):

it looks like an oversight to me

view this post on Zulip JP (Jun 10 2021 at 18:57):

https://github.com/hapifhir/org.hl7.fhir.core/issues/535


Last updated: Apr 12 2022 at 19:14 UTC