firely-net-sdk icon indicating copy to clipboard operation
firely-net-sdk copied to clipboard

Add environment variables to FhirPath

Open ewoutkramer opened this issue 1 year ago • 2 comments

At this moment, it is possible to add constants to the SymbolTable so you can supply your own external values (just like functions) and refer to them from FhirPath.

However, it is also really useful to supply extrernal variables that can be different from invocation to invocation of a compiled fhirpath statement, variables that are specific for a single run of an expression.

We already pass in an EvaluationContext when we run an expression, so a natural extension point would be to make it possible to add context variables here, that can then be referenced from the FhirPath, e.g. with the normal % syntax.

Alternatively, we could introduce our own syntax in FhirPath, but that requires changes to the parser and brings little added value.

ewoutkramer avatar Aug 09 '23 13:08 ewoutkramer