feat(db): lab_drafts, lab_draws, biomarkers tables

Refs PAI-91.
This commit is contained in:
marcuspaico
2026-08-17 15:17:37 -07:00
parent e3cfc6592e
commit bd4817cb77
5 changed files with 375 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
CREATE TABLE `biomarkers` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`draw_id` text NOT NULL,
`panel` text NOT NULL,
`name` text NOT NULL,
`marker` text NOT NULL,
`analyte_key` text,
`value` text NOT NULL,
`value_num` real,
`unit` text,
`reference_range` text,
`flagged` integer DEFAULT 0 NOT NULL,
`value_canonical` real,
`canonical_unit` text
);
--> statement-breakpoint
CREATE TABLE `lab_drafts` (
`id` text PRIMARY KEY NOT NULL,
`filename` text NOT NULL,
`file_path` text NOT NULL,
`status` text NOT NULL,
`extracted` text,
`error` text,
`created_at` integer NOT NULL
);
--> statement-breakpoint
CREATE TABLE `lab_draws` (
`id` text PRIMARY KEY NOT NULL,
`collected_at` text NOT NULL,
`lab_name` text,
`draft_id` text,
`created_at` integer NOT NULL
);