One pre-processing record per chart: the type we assigned it from our own vocabulary, a summary,
and the date/authorship signals pulled out of it.
A separate 1:1 table rather than a column on patient_charts because upsertExternalDocument
rewrites raw_document and circle_metadata wholesale on every EMR sync, so derived data stored
there does not survive re-sync.
A row only exists once pre-processing has started — "never pre-processed" is the absence of a row,
not a status — so every writer inserts on conflict rather than updating.
One pre-processing record per chart: the type we assigned it from our own vocabulary, a summary, and the date/authorship signals pulled out of it.
A separate 1:1 table rather than a column on
patient_chartsbecauseupsertExternalDocumentrewritesraw_documentandcircle_metadatawholesale on every EMR sync, so derived data stored there does not survive re-sync.A row only exists once pre-processing has started — "never pre-processed" is the absence of a row, not a status — so every writer inserts on conflict rather than updating.