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

Fhirpath iif function context... #2625

Open
brianpos opened this issue Nov 15, 2023 · 1 comment
Open

Fhirpath iif function context... #2625

brianpos opened this issue Nov 15, 2023 · 1 comment
Assignees

Comments

@brianpos
Copy link
Collaborator

Describe the bug
The fhirpath function iif does not consider contexts correctly, and appears to always want to be executed at the root.

To Reproduce
Steps to reproduce the behavior:

  1. Using the below test fhirpath expression (and test engine)
name.iif((trace('iif').use = 'official').trace('tr'), family, given.join(''))

🧪 Test with FHIRPath-Lab

  1. When selecting the Firely Engine see that there is no result returned, as the context (as shown in the trace window) is the resource still, the focus wasn't moved to the name collection.

Expected behavior
As demonstrated in the tool, the focus should be set to the name before evaluating the arguments to the function.

Version used:

  • FHIR Version: R4B (but really version agnostic)
  • Version: 5.3.0

Additional context
http://hl7.org/fhirpath/N1/#iifcriterion-expression-true-result-collection-otherwise-result-collection-collection
Discussion on Zulip with Grahame

@brianpos
Copy link
Collaborator Author

Correction, I think this is also related to how collections on the input (focus) side are handled.
If you use a select() around the iff, then it works the same as the other engines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants