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

Support position information in FHIRPath expressions #2517

Closed
brianpos opened this issue Jul 5, 2023 · 4 comments · Fixed by #2774
Closed

Support position information in FHIRPath expressions #2517

brianpos opened this issue Jul 5, 2023 · 4 comments · Fixed by #2774

Comments

@brianpos
Copy link
Collaborator

brianpos commented Jul 5, 2023

Is your feature request related to a problem? Please describe.
The FhirPath Expression and derived classes have support for location information however this is never populated by the sprache parser.

Describe the solution you'd like
During the parsing of a fhirpath expression optionally support the inclusion of the position information for each sub-expression in the AST.

Additional context
I plan to use this information in the fhirpath-lab project through my open source FhirPath Expression validator nuget package.
This will help significantly with error messages and also highlighting expressions in related tooling.

@ewoutkramer
Copy link
Member

I did make it work in the MappingLanguage parser (which was based on Superpower). Too bad we cannot use that code anymore. Are we sure we can make this work in sprache? maybe by patching the original code, which we have included anyway?

@brianpos
Copy link
Collaborator Author

brianpos commented Jul 7, 2023

After spending some time in there, I do believe that we can. Just wanted to check before I really started into it to ensure I hadn't missed something already.

@brianpos
Copy link
Collaborator Author

brianpos commented Aug 7, 2023

I've progressed with this and have something to demonstrate, but not quite to the level of a branch to show.
@ewoutkramer Any chance we have a catchup to show what I have and see if I'm not doing something too drastic that would prevent it merging in if completed...

brianpos added a commit that referenced this issue Apr 22, 2024
…he Expression objects

and also handling comments in fhirpath expressions (they are skipped and not retained in the expression AST)
@brianpos
Copy link
Collaborator Author

brianpos commented May 3, 2024

As noted in the PR this is now fully functional and combined with the comments/whitepsace branch code will permit full round tripping with ObjectModel, which can permit some manual tweaks to the Model and then back out to a string again without losing the whitespace/comments

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