FHIR Chat · FHIR Search Query · social

Stream: social

Topic: FHIR Search Query


view this post on Zulip Raheel Sayeed (Dec 05 2017 at 17:27):

Hello people, Totally new here. I'm at BostonChildren's Hospital. Working on a lot fo FHIR.
I had a question regarding efficient resource retrieval through search. I read the docs on search params but didn't quite understand. Would really appreciate some guidance.

I'm trying to search for a resource (QuestionnaireResponse) for a patient (with a known ID) that is based-on multiple ProcedureRequests.
Something like: QuestionnaireResponse?patient={id}&based-on={procedureRequestID-1},{procedureRequest-ID-2}...

I know that using comma separated values work. Not sure if thats a good/efficient way to fetch resources.

view this post on Zulip Lloyd McKenzie (Dec 05 2017 at 18:25):

Comma would give you "or". & would give you "and". Whether a query is "efficient" or not will depend somewhat on the architecture of the server. Certainly it's a "correct" way to query.

view this post on Zulip Raheel Sayeed (Dec 05 2017 at 19:03):

Comma would give you "or". & would give you "and". Whether a query is "efficient" or not will depend somewhat on the architecture of the server. Certainly it's a "correct" way to query.

Thanks for the fast response. It really does work well!

view this post on Zulip Glory Kim (Jun 13 2019 at 22:51):

Hi all, I'm also new to FHIR. I'm reading up on the search query, and the specs do not seem to contain information on the precedence of order. For example, AllergyIntolernace?_include=AllergyIntolerance:patient&_count=3&_sort=birthday,age .. should this return the same results as if the search result paramters were in different order (i.e. sort .. count.. include) ?

view this post on Zulip Jim Steel (Jun 13 2019 at 22:51):

yes

view this post on Zulip Glory Kim (Jun 13 2019 at 22:52):

Thanks for the reply! Do you know which would be the recommended order? It makes sense that it would be sort => count => include. But I'm not able to find any documentation/resource supporting this. @Jim Steel

view this post on Zulip Jim Steel (Jun 13 2019 at 22:53):

It shouldn't matter

view this post on Zulip Glory Kim (Jun 13 2019 at 22:54):

I'm wondering how the backend of FHIR processes this information, if it's in sequence of if the search result parameters have their own hierarchy order

view this post on Zulip Jim Steel (Jun 13 2019 at 22:55):

I imagine it could well be different in different servers

view this post on Zulip Jim Steel (Jun 13 2019 at 22:56):

But regardless of how it's implemented, the order in which the parameters are stated shouldn't affect the result

view this post on Zulip Glory Kim (Jun 13 2019 at 22:58):

Great! I guess, I should rephrase my next question as "Knowing that the order of parameters does not matter, how is the hierarchy of result parameters set?"

Thanks so much Jim.

view this post on Zulip Jim Steel (Jun 13 2019 at 22:59):

If its a question for implementers, you might also have more luck asking in #implementers than in #social

view this post on Zulip Glory Kim (Jun 14 2019 at 00:03):

Thank you!

view this post on Zulip Liam (Sep 06 2019 at 06:22):

I have a use case where I want to get latest Observation(after particular date) for a particular Patient. What will be the best way to do it ?
1.Based on _history (not sure whether it is applicable with Patient search) 2.Perform Search based on observation.effective

view this post on Zulip Grahame Grieve (Sep 06 2019 at 06:25):

get [url]/Observation?patient=X&code=Y&_count=1&_sort=-date

view this post on Zulip Liam (Sep 06 2019 at 09:01):

@Grahame Grieve I have edited the question based on Use-Case. Can you answer now.

view this post on Zulip Grahame Grieve (Sep 06 2019 at 11:58):

depends on the server. Search is a lot easier and less work for the client and less data moved around, but the server has to support that combination


Last updated: Apr 12 2022 at 19:14 UTC