Stream: implementers
Topic: Can I use paths as query parameters?
Tim Berezny (Apr 08 2022 at 13:37):
In FHIR I search for all healthcareservice in a specific organization, I do:
GET baseurl/healthcareservice?_organization=123
However, is it ok for me to build an API using a modern path based approach such as the following, or is it strongly discouraged?
GET baseurl/organization/123/healthcareservice
Tim Berezny (Apr 08 2022 at 14:06):
More specifically, I'm trying to GET all appointments in a specific calendar in our application, but i can't find a concept of calendar ("Schedule" resource) as it exists for Appointment, as "Schedule" is intended only for open Slots
Where my local restful path to get all appointments in a calendar is:
My native API: GET baseurl/calendar/123/appointment
I can't figure out the equivalent way to get all appointments in a calendar in FHIR as there's not query parameter for a schedule or calendar in the appointment resource
FHIR: GET baseurl/Appointment/?_??????
Some options i'm considering right now:
1) create a custom search parameter called ?_calendar
2) when GETting fhir appointments by calendar, say that the base url = api.base.com/calendar/123/
Does option 2 make sense in a FHIR world or is that discouraged?
John Moehrke (Apr 08 2022 at 14:31):
see http://hl7.org/fhir/compartmentdefinition.html
John Moehrke (Apr 08 2022 at 14:32):
the compartments supported will be dependent on the server capabilities
Tim Berezny (Apr 08 2022 at 14:43):
If i'm reading this correctly, it means that there's only compartments for 5 resources, so I COULDN'T do things like
/Organization/123/HealthcareService
/Schedule/873/Slot
and that it's would be very unwise to do this for our implementation b/c these have to be approved at the HL7 international level, which is a big deal?
Tim Berezny (Apr 08 2022 at 15:53):
What is the best way to GET appointments by calendar?
e.g., a vaccination clinic has a calendar for 6 different rooms, all managed within one system, and I want to get the list of appointments for only Room A?
The two options I've come up with so far are:
1) conceptualize the "calendar" as a "location"
2) create a custom search parameter for my implementation ?_calendar=123
Lloyd McKenzie (Apr 08 2022 at 15:55):
Compartments haven't been widely implemented. They're a stylistic convention, but don't really add value. They also presume that data exists in a hierarchy, and in some cases it doesn't.
Each 'resource' (person, location, significant piece of equipment) can have a 'Schedule' (i.e. a calendar). So if you want a calendar for a room, you'd be looking for the Schedule associated with that Location.
Brian Postlethwaite (Apr 12 2022 at 01:21):
And yes, it does very much depend on what is considered a calendar in the system you're talking to.
The calendar is typically a Schedule resource, which has slots, and those can have appointments attached to them.
Alternately you can search just based on your specific resource of interest via the Appointment?participant=resource/id
Last updated: Apr 12 2022 at 19:14 UTC