FHIR Chat · Getting all the patients for a physician · implementers

Stream: implementers

Topic: Getting all the patients for a physician


view this post on Zulip Sandeep (Jul 09 2019 at 09:56):

Hi Everyone,

I am new to this forum and this domain, so upfront apologies if the question is irrelevant or too noob to be posted here.

I am trying to see if I can search all the patients for a physician using HAPI API (FHIR 4.0.0). The hl7 standard https://www.hl7.org/fhir/search.html says that you can search something like this.

`Note that chained parameters are applied independently to the target resource. For example,

GET Patient?general-practitioner.name=Joe&general-practitioner.address-state=MN`

And I feel this is what may satisfy my usecase but wanted to confirm and also wanted to check what is corresponding HAPI API method(Java) that I need to use

view this post on Zulip Simone Heckmann (Jul 09 2019 at 12:54):

Careful: since Patient.generalPractitioner is 0..*, your search could potentially return false positve Patients that have one GP thats called "joe" and another that lives in "MN"

view this post on Zulip Simone Heckmann (Jul 09 2019 at 12:55):

I'd recommend to use _revinclude with something like /Practitioner?name=x&address=y&_revinclude=Patient:general-practitioner

see http://hl7.org/implement/standards/fhir/search.html#revinclude

view this post on Zulip Simone Heckmann (Jul 09 2019 at 13:00):

Alternatively, you could first search for the GP by both name and address and then query for the Patients by using /Patient?general-practitioner._id=x
While the _revinclude will give you a Bundle with both the Practitioner and the Patients, this way you'd get only the Patients...
Depends on what you need...

view this post on Zulip Brian Postlethwaite (Jul 10 2019 at 00:41):

Alternately use the practitioners id resolving that first before executing this query.
I'd also be curious on the real purpose for the query, as there are many forms of this, such as those with appointments, or rthose that had an encounter in the last 2 years or...

view this post on Zulip Sandeep (Jul 10 2019 at 08:53):

Thank you for the response. The use case would be something as simple as like i want a physician portal and when the physician logs in he sees all his patients information and additionally lets say phyisician wants to further filter patients based on some criteria


Last updated: Apr 12 2022 at 19:14 UTC