FHIR Chat · Query bundles using REST · implementers

Stream: implementers

Topic: Query bundles using REST


view this post on Zulip Dave Henderson (Mar 08 2018 at 16:22):

I have been tasked with looking at how or if it is possible to query bundles that have been stored in a central location and return all matching bundles within a searchset bundle. The stored bundles have not been processed in any way and retain their original structure, which consists of multiple FHIR resources.
One of the resources is MessageHeader which identifies the 'type' of data it contains, in addition to the Patient resource. Together these would form the search parameters, which I'd like to use to identify any matching bundles. There are additional parameters that need to be added, but I'd like to know if what is being asked is possible before expanding search parameters. I'm hoping this can be done using REST, but I've never seen this type of search performed, since most bundles are used as a wrapper and not stored.

One of the concerns I have, if this is possible to do in the first place, is the amount of processing that such a search will need to do, having to search down what could be 1000's of bundles, identify matching records and then returning these back to the client.

Any advice/guidance would be appreciated.

Dave

view this post on Zulip Michel Rutten (Mar 08 2018 at 16:31):

Hi @Dave Henderson, maybe the central server could index the bundles? This would allow you to optimize search speed, by resolving searches from the index tables.

view this post on Zulip Lloyd McKenzie (Mar 08 2018 at 16:34):

There is a standard search criteria for Bundle allowing you to chain to the MessageHeader and from there you can filter on MessageHeader elements. It's up to a server whether it supports such chaining and, if so, to what elements. However, if it does, then it will presumably index the Bundle accordingly, so the search should perform fairly well.

view this post on Zulip Dave Henderson (Mar 08 2018 at 16:47):

@Lloyd McKenzie Can you point me to the FHIR documentation for this. I've trawled through it trying to find some guidance on searching bundles, but was unable to locate anything useful. Thanks

view this post on Zulip Dave Henderson (Mar 08 2018 at 16:48):

@Michel Rutten If FHIR has its own indexing and search fucntions as @Lloyd McKenzie has indicated then this could be the answer.

view this post on Zulip Michel Rutten (Mar 08 2018 at 16:50):

FHIR only defines the API, not the actual implementation. However a smart FHIR Server implementation (such as Vonk) would definitely build indexes for known search parameters.

view this post on Zulip Lloyd McKenzie (Mar 08 2018 at 17:36):

Search parameters for Bundle are here: http://hl7.org/fhir/bundle.html#search
Search parameters for Message are here: http://hl7.org/fhir/messageheader.html#search
Discussion on chaining is here: http://hl7.org/fhir/search.html#chaining
Example: GET [baseUrl]/Bundle?message.focus:Encounter.subject:Patient.identifier=[your MRN here]&message.timestamp=ge2017&message.timestamp=lt2018
That'll give you all messages that have a focus that's an encounter whose subject is a Patient with the identifier specified and that were sent in 2017.

view this post on Zulip Dave Henderson (Mar 08 2018 at 22:44):

Thanks guys. I've used Vonk quite a bit so I'll do some test runs using the example and look at the links provided for background information. Much appreciated.

view this post on Zulip Christiaan Knaap (Mar 22 2018 at 15:31):

A warning though: exactly this type of searchparameter (Bundle.composition and Bundle.message, that chain into one of the Bundle entries) are not yet supported by Vonk. It's on the roadmap to add this sometime in the next few months.

view this post on Zulip Adam Hatherly (Oct 28 2019 at 17:32):

Hi @Christiaan Knaap - has this functionality been added in Vonk since this thread? I'm interested in potentially using this in Vonk, but I'm testing a few queries with the current version and am not getting any results back for these types of queries.

view this post on Zulip Christiaan Knaap (Oct 29 2019 at 09:21):

Hi Adam, thanks for asking! I am sorry to say we haven't yet. Since you are the first person actually asking for it, that helps in prioritizing! If others need this type of search (chaining into Bundle entries), please let me know!

view this post on Zulip Keerthivasan Ramanathan (Nov 05 2019 at 09:18):

hi I am new here. I have questions regarding REST FHIR server

view this post on Zulip Keerthivasan Ramanathan (Nov 05 2019 at 09:20):

This is the use case, i am working on now..
For a group of patients, get most recent specific Lab result (A1C, Lipid panel)

I believe that the Response would be a bundle of Observation resource. How can a search query can contain references to multiple patients or group of patients? Can someone guide me?

view this post on Zulip Lloyd McKenzie (Nov 05 2019 at 13:44):

Querying for data across patients is pretty easy (though not all servers will support it). If you just do a search and filter only by Observation type, you'll get all Observations of those types for all patients. In R5, there'll be a parameter that lets you filter for subjects that are 'in' a Group. The hard part about what you're asking for is "most recent per type per patient". That mirror's SQL's "group by" mechanism - and RESTful search doesn't currently have any equivalent. @Grahame Grieve, could this be done with GraphQL?

view this post on Zulip Grahame Grieve (Nov 05 2019 at 20:45):

maybe. This sounds like $lastn space to me


Last updated: Apr 12 2022 at 19:14 UTC