2

FHIR Location resources can have a .partOf property that points to another Location.

Let's say we have locations nested like this. Where each location is partOf the parent Location.

  • hospital
    • building
      • clinic
        • exam room

Let's say that an Appoinment has an actor that is a Location.

How do I query for appointments at these various levels, if I just have a Location Id.

For example: How do I query for all appointments at the hospital? Or for all appointments at the building, etc.

Also, it could be that the actor Location is an ID at any one of these levels and we don't know which, at the time of the search.

I'd like to be able to query Appointments filtered by whatever the current location hierarchy level it is, and everything below.

I know I can do /Appointment?location=LOCATION_ID and /Appointment?location.partOf=LOCATION_ID

But, is there any way to do both and everything below in the same search request?

Henrik Joreteg
  • 1,698
  • 16
  • 18

1 Answers1

2

If the server you are using supports it, you should be able to use the :below modifier on the location search:

/Appointment?location:below=LOCATION_ID

See http://hl7.org/fhir/search.html#recursive for the documentation.

Mirjam Baltus
  • 2,035
  • 9
  • 13
  • Unfortunately, it doesn't seem like Google Cloud supports this. But it definitely seems like the correct answer. Thank you! https://build.fhir.org/search.html#3.2.1.5.2.2.1 I'm going to mark this as the correct answer. What I had to do instead was first fetch locations and build a list of location IDs to pass as follows: `location=ID1,ID2`. – Henrik Joreteg Jan 23 '23 at 21:01