-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The default context for FhirPath evaluation is leaving out %resource
#2177
Labels
Comments
%resource
Note that finding defaults is only possible if the caller supplies input data that is itself a resource, or a node within a ScopedNode - otherwise we won't be able to find a sensible default "resource" node within the parents of the data passed in. |
See also: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
When you execute one of the extension methods for FhirPath on POCO or ITypedElement - and you don't supply the optional parameter for the context, a default, empty context is provided. This means that
%resource
and%rootResource
will return null. Although these environment variables are not used often, they are not expected to be null. In fact, the constructor forFhirEvaluationContext
that takes aScopedNode
as a parameter, will try to locate the nearest resource in the input data and then set the%resource
accordingly. It makes total sense that this is the default. In fact, when we ourselves invoke the FP engine in the validator, we are always supplying the correct parameters.Describe the solution you'd like
Pick a sensible default, instead of null. Preferably the same approach as the constructor taking
ScopedNode
.The text was updated successfully, but these errors were encountered: