FHIR Chat · FluentPath · dotnet

Stream: dotnet

Topic: FluentPath


view this post on Zulip Angus Millar (May 30 2016 at 05:52):

Does anyone know where I might find some simple examples of the use of the FluentPath dotnet libaray "HL7.Fhir.FluentPath". Just something to get started on. I have read the https://github.com/ewoutkramer/fhirpath/blob/master/fluentpath.md which is great to understand the language as a whole but I seem to be missing a very simple example of to get started on with the libaray. Maybe a simple example of extracting the first patient name I asume using a FluentPath string like "Patient.name[0].given[0]". How do I parse such a string with the library against a Patient resource to get the first given name.

view this post on Zulip Brian Postlethwaite (May 30 2016 at 06:17):

Have a look at the unit tests in that project on github, did you know where to find that?

view this post on Zulip Angus Millar (May 30 2016 at 06:18):

Yes have cloned the project but can not see any test project within it

view this post on Zulip Angus Millar (May 30 2016 at 06:19):

Oh I cloned master, dev has the tests

view this post on Zulip Angus Millar (May 30 2016 at 06:19):

will look at them

view this post on Zulip Angus Millar (May 30 2016 at 06:22):

OK thanks Brian, have something to chew on now

view this post on Zulip Brian Postlethwaite (May 30 2016 at 06:41):

good stuff.

view this post on Zulip Angus Millar (May 30 2016 at 07:29):

Wow, there is a fair bit more in that test project than I was expecting

view this post on Zulip Michel Rutten (May 30 2016 at 09:42):

Hi Angus, the FluentPath API support is fairly new. My colleague Ewout implemented most of the syntax. Possibly there is still some work to be done on complex use cases/operators and type casting/coercion. Since this is all new and under development, we haven't started to integrate FluentPath support into our tools yet. So your feedback on the current API support is welcome!

view this post on Zulip Brian Postlethwaite (May 30 2016 at 23:48):

Angus, if you are just looking to be trying out the fluentpath stuff for some initial work, there is a slightly older version available on github integrated ina branch of the DSTU2 version.
We are using it for validation, and actively updating it for support.

view this post on Zulip Brian Postlethwaite (May 30 2016 at 23:49):

Once Ewout and Michel have the first cut of the new project done. I'll be moving to that and getting it integrated into the dotnet client to work on the models.

view this post on Zulip Angus Millar (May 31 2016 at 00:37):

Thanks for your comments guys. I will keep pushing on. I'm new to using FluentPath and had just the conceptual idea of how it worked and was now trying to put it into practice. Not looking to do anything complex at this stage really just trying to get up and running with a basic working implementation, I can expand out from there. Rightly or wrongly, naively, I was thinking it was going to extend the dotnet FHIR API in some fashion. I.e. parse a resource into the FHIR API POCOs and then be able to call some FluentPath extension method on the root (something like: Patient.ResolveFluentPathExpression(“Patient.name[0].given[0]”) that resolves to an appropriate FluentPath object result.
But I can also now understand that it is agnostic to any API and works directly on XML or JSON. Yet even here the test project seem to have a lot of infrastructural work within it. Everything in the ‘Instance Tree’ and ‘Navigation’ folders and the whole implementation of the static class ‘TreeConstructor’ seems like it should have been abstracted away from me the API user.
But these are only first impressions, I’ve only been on this for a few hours.

view this post on Zulip Brian Postlethwaite (May 31 2016 at 01:10):

That's where we want it to get to once it's a part of the spec in STU3, but for now is external.

view this post on Zulip Brian Postlethwaite (May 31 2016 at 01:11):

I guess I could create an extension method that does this for you in the background pretty simply.

view this post on Zulip Brian Postlethwaite (May 31 2016 at 01:11):

There are 2 main fluentpath operations, once for validating a predicate (IsTrue) and another for extracting data.

view this post on Zulip Grahame Grieve (May 31 2016 at 01:26):

the java version does work that way - it returns a set of fhir objects

view this post on Zulip Angus Millar (May 31 2016 at 01:30):

Don't worry Brian, I can make do for now as I’m only exploring how I will use it. I'm already over to the Pre Release May STU3 so don't want to go back to DSTU2. I think for now I will just explore with what is here and will look forward to the real STU3 release and then look hard using it. I want it to generically populate my db indexes off the search parameter fluent paths.

view this post on Zulip Michel Rutten (May 31 2016 at 07:52):

@Angus The FHIR .NET API implementation of fluentpath works against *any* tree structure, XML/JSON/PoCo/..., hence the need for a (public) abstract tree datastructure. We are trying to move towards exposing both low level and high level API functionality, to cater for different types of clients. But as Brian mentioned, this is all work in progress and will probably be refactored a bit before the final release.


Last updated: Apr 12 2022 at 19:14 UTC