Henrik Joreteg
Henrik Joreteg

Reputation: 1736

FHIR Appointment search filtered by location and all its partOf locations

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.

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?

Upvotes: 4

Views: 485

Answers (1)

Mirjam Baltus
Mirjam Baltus

Reputation: 2299

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.

Upvotes: 3

Related Questions