GROUP BY-like Search

152 views
Skip to first unread message

alexandre...@gmail.com

unread,
Jun 18, 2018, 5:12:27 PM6/18/18
to HAPI FHIR
Hello all,

I am trying to implement a function to fetch the latest (i.e. the most recent) observation associated to a list of devices (as a list of string identifiers).

However, I cannot seem to be able to do that. Is there any way to return only the latest observation for each device in a single request to the Hapi FHIR server?

PS. See GROUP BY-like function in FHIR Search for a similar question that I asked on StackOverflow. 

Patrick Werner

unread,
Jun 18, 2018, 6:36:38 PM6/18/18
to HAPI FHIR
I answered your question on StackOverflow

James Agnew

unread,
Jun 18, 2018, 9:45:27 PM6/18/18
to Patrick Werner, HAPI FHIR
Just to add to Patrick's answer, there is also the $lastn operation: http://hl7.org/fhir/observation-operations.html#lastn

I think that would meet your use case, but unfortunately it is not yet implemented in HAPI FHIR. Absolutely I would like for it to be, but at this point it's not yet there. (Help wanted, or happy to collaborate as always)

Cheers,
James

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/29a1a3e1-b7bd-4316-a17a-952d3766f947%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

alexandre...@gmail.com

unread,
Jun 19, 2018, 3:17:29 PM6/19/18
to HAPI FHIR
Thanks again for your answer; I have responded to you in the comments.

alexandre...@gmail.com

unread,
Jun 19, 2018, 3:18:30 PM6/19/18
to HAPI FHIR
If this isn't planned in the near future, I would be happy to contribute, although I have never worked with the HAPI FHIR code base -- what would I need to know to get started?

Cheers,
Alexandre.
Reply all
Reply to author
Forward
0 new messages