CDCgov / prime-reportstream

ReportStream is a public intermediary tool for delivery of data between different parts of the healthcare ecosystem.
https://reportstream.cdc.gov
Creative Commons Zero v1.0 Universal
72 stars 40 forks source link

Lookup Table API Enhancements: Allow single row updates #5706

Open sethdarragile6 opened 2 years ago

sethdarragile6 commented 2 years ago

Problem statement

Currently in the Lookup Table API, in order to update even a single row in the table, you must submit the entire content of the updated lookup table. While this has thus far met the needs for OnO, when using this from a UI, the experience is inelegant and expensive- requiring in one POST the sending of 1600+ element JSON. We would like a way to submit one row for update.

In the design doc for Valueset Editor UI, we outline two possible approaches- a "short lift" and a "heavy lift":

“short lift”: if the API still kept its “insert full table at once” approach, row level posts could still be supported if key information about the row was posted with it, by...

  • Querying the full set of rows by the key information (minus the row being replaced), then
  • Writing the full set of rows back (plus the new replacement row) with a new version #

“heavy lift”: API keeps full table copies, however it would do it in a “full + incremental(s)” way. In other words, a brand new lookup table would be fully inserted but any inserts, updates or deletes that came after that would simply track as deltas from the first full set. This is obviously a major refactor of the API, but would have the added advantage of saving a great deal of disk space all around

What you need to know

Acceptance criteria

JGreenFearless commented 2 years ago

@sethdarragile6 Is this something that requires work from the Pipeline Team?

sethdarragile6 commented 2 years ago

@JGreenFearless not necessarily. it's backend/API work that traditionally would be done by the pipeline team, but also doable by experience (w/pipeline's eyes/help) @bgantick