department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
283 stars 204 forks source link

Include vista clinic name in response body of appointment list requests #28208

Closed grossb1 closed 3 years ago

grossb1 commented 3 years ago

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.

laurenernest commented 3 years ago

image.png