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

Is resolve() function supported? #679

Closed
jackliums opened this issue Aug 29, 2018 · 3 comments
Closed

Is resolve() function supported? #679

jackliums opened this issue Aug 29, 2018 · 3 comments

Comments

@jackliums
Copy link

Hi there,

As part of the issue discussed here, I've updated the expression to use the resolve() function but it seems like the library does not currently support it? When I try to evaluate the expression, it throws the following exception:

ArgumentException: Unknown symbol 'resolve'
Hl7.FhirPath.Expressions.EvaluatorVisitor.resolve(SymbolTable scope, string name, IEnumerable<Type> argumentTypes)

The expression it's trying to evaluate is:

Appointment.participant.actor.where(resolve() is Location)
@brianpos
Copy link
Collaborator

Yes we haven't updated it yet.
In my server I plan to shortcut it to only process the reference itself, and not read the resource for performance reasons.

@ewoutkramer
Copy link
Member

But the question is about resolve(), which we have built in, but it's a FHIR-specific function (FhirPath is used more generally than just within FHIR) so make sure you use a symbol table that is initialized with the FHIR-specific functions. You could either use the extension methods like Select() coming from the Hl7.Fhir.[DSTU].Core libraries or create your own compiler like so:

   var symbolTable = new SymbolTable();
   symbolTable.AddStandardFP();
   symbolTable.AddFhirExtensions();

   var fpCompiler = new FhirPathCompiler(symbolTable);
   // do stuff

@jackliums
Copy link
Author

I am using Select() extension methods from the Core libraries and that was the exception I was getting.

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