Skip to content
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

resolve() FHIRPath function seems not to be supported #9

Open
JozefAerts opened this issue Oct 14, 2021 · 2 comments
Open

resolve() FHIRPath function seems not to be supported #9

JozefAerts opened this issue Oct 14, 2021 · 2 comments

Comments

@JozefAerts
Copy link

No description provided.

@cames-be
Copy link

Even if this isn't the correct place, I wanted to post this for anyone that has issues getting the resolve() function to work with FhirPath. (Note, I've only tested this with STU3 and R4)

By default, the FhirPathCompiler only uses the standard FhirPath functions by invoking the AddStandardFP extension on the SymbolTable. To use the resolve(), hasValue(), memberOf(), and htmlchecks functions, the AddFhirExtensions() extension method must be called against the symbol table and passed to the FhirPathCompiler.

What this means for this project is that 3 changes need to be made (note I only looked at the WPF project):

  1. In the CustomFluentPathFunctions, the call _st = new SymbolTable().AddStandardFP(); needs to be changed to _st = new SymbolTable().AddStandardFP().AddFhirExtensions();
  2. In MainWindow.ButtonGo_Click a ScopedNode needs to be passed into the CompiledExpression. The resolve() function can only be used against a ScopedNode. This means that after creating a ScopedNode instance to wrap the ITypedExpression, the node must be passed into the CompiledExpression.
    prepopulatedValues = xps(inputNav, evalContext);
    becomes
    ScopedNode node = new ScopedNode(inputNav);
    prepopulatedValues = xps(node, evalContext);
  3. The FhirPathProcessor.ProcessPrepopulatedValues needs to be modified to hande the ScopedNode. Instead of using ToFhirValues, use the ToPoco extension off of the ScopedNode (ITypedElement).

Feel free to ask me any questions regarding FhirPath or its implementation.

@brianpos
Copy link
Owner

It's not supported as there is no way to setup a source server to resolve the content from.
(Though I guess could at least resolve within a contained resource/bundle)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants