Files
HealthLog/prisma/migrations/0483_inbound_document_extraction_incomplete/migration.sql
T
Marc-André Bombeck 958d230b9f fix(documents): keep an incomplete extraction on the document
A long document read in parts can end with a part cut at the provider's
output limit, a part never read, or more facts than one review takes.
That was told once, as a notice when the run finished; a review opened
later looked complete.

InboundDocument.extractionIncomplete (migration 0483) is written with
the facts by both stagings, the extract route or run and lab
auto-staging. The document detail publishes it and the review shows the
same note whenever it is opened. The disaster-recovery backup carries
it; an older file restores it as false.

Refs #1257
2026-10-25 01:01:13 +02:00

22 lines
865 B
SQL

-- Whether a document's staged facts may leave part of it out.
--
-- An extraction that read a long document in parts can end with a part cut
-- at the provider's output limit, a part never read, or more facts than one
-- review takes. That was told once, as a notice when the run finished; a
-- review opened later looked complete. The column keeps it on the document,
-- written with the facts every staging replaces.
--
-- Not null, default false: a document extracted before this release is read
-- as complete, which is what it has always been shown as.
-- Reversibility: dropping the column loses only the marker.
--
-- @retry-on-lock-timeout
DO $migration$
BEGIN
PERFORM set_config('lock_timeout', '5s', true);
ALTER TABLE "inbound_documents"
ADD COLUMN IF NOT EXISTS "extraction_incomplete" BOOLEAN NOT NULL DEFAULT false;
END
$migration$;