FHIR Chat · antlr · fhirpath

Stream: fhirpath

Topic: antlr


view this post on Zulip nicola (RIO/SS) (Sep 10 2018 at 13:49):

Official fhirpath antlr grammar is failing on contains function :( at least in js )

view this post on Zulip nicola (RIO/SS) (Sep 10 2018 at 13:59):

I think, because of clash with contains operator

view this post on Zulip Paul Lynch (Sep 10 2018 at 14:07):

Do you have a reference for the JavaScript "contains" operator? I do not see it here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators

view this post on Zulip nicola (RIO/SS) (Sep 10 2018 at 14:09):

There is includes function. I mean antlr grammar fails with contains - i fixed it - https://github.com/lhncbc/fhirpath.js/commit/b54c49c1a3585b58ca62a53e3bebfe8067b3f1d6

view this post on Zulip nicola (RIO/SS) (Sep 10 2018 at 14:12):

so the fix is to add hardcoded 'contains' into identifiers definition - @Bryn Rhodes

view this post on Zulip Paul Lynch (Sep 10 2018 at 14:12):

I see, you meant that the contains operator in FHIRPath was missing from the grammar. That seems significant.

view this post on Zulip nicola (RIO/SS) (Sep 10 2018 at 14:13):

contains keyword clashes with contains function

view this post on Zulip Paul Lynch (Sep 11 2018 at 21:50):

Is there a way we can submit a pull request for our tweaked ANTLR FHIRPath.g4 file?

view this post on Zulip Grahame Grieve (Sep 11 2018 at 21:58):

sure. it's in https://github.com/FHIR/fluentpath

view this post on Zulip Paul Lynch (Oct 11 2018 at 15:39):

Under https://github.com/FHIR/fluentpath/tree/master/spec, I see both a "fhirpath.g4" and a "fluentpath.g4" grammar. I thought fluentpath was an older name for fhirpath, but the fluentpath.g4 file was modified more recently. Why would there be a different grammar file for each? If I submit a pull request for the grammar, which file would should I be changing?

view this post on Zulip Paul Lynch (Oct 11 2018 at 22:18):

The git commit history for the two grammar files show that @Bryn Rhodes renamed fluentpath.g4 to fhirpath.g4 in March, but then @Grahame Grieve readded fluentpath.g4 in April (perhaps with a few changes?) It looks to me like something went wrong with a merge, and that 1) the current file should be fhirpath.g4 but 2) fluentpath.g4 might have changes that need to be made to fhirpath.g4 before fluentpath.g4 is removed.

view this post on Zulip Bryn Rhodes (Oct 11 2018 at 22:27):

Sorry, was answering this earlier and got distracted. What's in the root is the currently published. The 2018Sep directory has the balloted normative content, which only has one grammar file.

view this post on Zulip Paul Lynch (Oct 12 2018 at 15:11):

Okay, thanks. I submitted a pull request on that file. (https://github.com/FHIR/fluentpath/pull/7).


Last updated: Apr 12 2022 at 19:14 UTC