CDCgov / phdi

https://cdcgov.github.io/dibbs-site/
Creative Commons Zero v1.0 Universal
28 stars 11 forks source link

Update TEFCA API Output to Bundle #2034

Closed m-goggins closed 3 days ago

m-goggins commented 4 days ago

PULL REQUEST

Summary

This PR updates the format of the API output to include a bundle of data. I added the createBundle function that puts all of the parsed resources from a UseCaseQueryResponse into a single Bundle.

Originally, I tried to have branching logic for the way that we parse (so that we don't break apart and then put back together). It quickly became a headache to pass around the request type (api or viewer) and parse differently. With the current implementation, the queries function exactly the same whether you query from the API or the viewer. Plus, this would allow for future users to operate the queries from the viewer and still get back machine readable data as well (with say, an "export" button) that could be passed to a surveillance system; a hybrid of a manual and an automatic workflow.

Related Issue

Fixes #2029

Additional Information

Anything else the review team should know?

Checklist