Currently when vets-website displays an appointment list, the VistA clinic name is present in the response body received from vets-api -on each appointment object that is returned. In this case vets-api is (essentially) acting as a reverse-proxy to VAR resources and passing the clinic name through to vets-website where it is displayed to the end-user.
When we switch over to the new VAOS service, the clinic name will not be present in the response body, therefore an additional request will need to be made by vets-api to retrieve that data.
In order to retrieve the VistA clinic names for each VistA location a request will need to be submitted to the new VAOS service clinics endpoint /vaos/v1/locations/#{location_id}/clinics. It may be the case that multiple requests are required, one for each VistA location. The VistA locationId can be found by taking the first 3 digits of the facilityId returned on each appointment object. For each locationId a request will be submitted that includes that locationId and any associated clinicIds that were returned by the appointment endpoint. Each appointment returned will have both a facilityId and an associated clinicId.
Once we know the clinic name it will need to be merged into the response object for each appointment that vets-api sends back to vets-website.
Clinic names are present for each appointment returned to vets-website when booked appointments are requested
Clinic names are present for each appointment returned to vets-website when past appointments are requested
Currently when vets-website displays an appointment list, the VistA clinic name is present in the response body received from vets-api -on each appointment object that is returned. In this case vets-api is (essentially) acting as a reverse-proxy to VAR resources and passing the clinic name through to vets-website where it is displayed to the end-user.
When we switch over to the new VAOS service, the clinic name will not be present in the response body, therefore an additional request will need to be made by vets-api to retrieve that data.
In order to retrieve the VistA clinic names for each VistA location a request will need to be submitted to the new VAOS service clinics endpoint
/vaos/v1/locations/#{location_id}/clinics
. It may be the case that multiple requests are required, one for each VistA location. The VistAlocationId
can be found by taking the first 3 digits of thefacilityId
returned on each appointment object. For eachlocationId
a request will be submitted that includes thatlocationId
and any associatedclinicId
s that were returned by the appointment endpoint. Each appointment returned will have both afacilityId
and an associatedclinicId
.Once we know the clinic name it will need to be merged into the response object for each appointment that vets-api sends back to vets-website.
include
query parameter, please see https://www.hl7.org/fhir/search.html#include for reference.