feat(labs): surface lab results in the doctor report and FHIR export

Add a Lab results section to the report aggregator (latest reading per
analyte over the window), a new labs section toggle (ON by default, the
same stance as BP and weight since the user recorded these to share with
a clinician), a PDF table with a quiet non-colour in/out-of-range marker,
and one laboratory Observation per result in the FHIR bundle carrying the
lab's reported referenceRange. Everything stays server-authoritative.
This commit is contained in:
Marc-André Bombeck committed 2026-06-14 23:39:29 +02:00
1 parent 271cc0dcfa
commit fbecb6b5c8
12 files changed
+394

No files matched your search

@@ -87,6 +87,11 @@ interface SectionAvailability {
// the cycle toggle. Present so `keyof DoctorReportPrefs` indexing
// typechecks. Optional — the availability endpoint may not provide it.
cycle?: boolean;
// v1.17.1 — labs section. Like cycle, not rendered by this legacy dialog;
// the flagship export panel surfaces the toggle. Optional — the
// availability endpoint may not provide it. Present so the
// `keyof DoctorReportPrefs` indexing typechecks.
labs?: boolean;
}
export interface DoctorReportSubmitPayload {
@@ -547,6 +552,9 @@ const SECTION_LABEL_KEYS: Record<keyof DoctorReportPrefs, string> = {
// v1.15.0 — not rendered by this legacy dialog (SECTION_ORDER omits it);
// present so the `keyof DoctorReportPrefs` record stays exhaustive.
cycle: "doctorReport.sections.cycle",
// v1.17.1 — labs section; the flagship export panel drives the toggle,
// present here so the `keyof DoctorReportPrefs` record stays exhaustive.
labs: "doctorReport.sections.labs",
};
/**