Skip to content

Clinical KB data: outstanding presentation import, differential gaps, and document provenance #289

Description

@BigSimmo

Summary

Follow-up work after the Clinical KB Database audit and cleanup (Supabase project sjrfecxgysukkwxsowpy). Canonical data is now 185 differentials, 328 medications, and 226 services under primary owner 4f1b3c19-3c39-4597-b9df-168c8e6007ff. Recent cleanup removed 62 empty presentation stubs, deduplicated a secondary owner copy, enriched 9 service contacts, and completed a verification pass.

Three content/provenance gaps remain and are not auto-fixable without source material or import work.

Background

  • Empty kind: presentation stubs were deleted because they had no payload; presentation-level navigation content was never imported.
  • Diagnosis records (kind: diagnosis) are populated; presentation topics still need a separate import path.
  • clinical_registry_record_sources has 0 rows — registry/services are not linked to source PDFs or documents.

Tasks

  • Import 31 presentation topics — Add presentation-level navigation content (sections, related diagnoses, clinical hinges). Diagnosis-only records exist today; presentations must be imported separately, not recreated as empty stubs.
  • Fill differential content gaps — Review diagnosis records missing immediateActions and/or investigations in payload (audit snapshot: ~194 without immediate actions, ~268 without investigations among 185 diagnosis rows; counts were pre-cleanup on diagnosis set). Prioritize high-use differentials first.
  • Backfill document provenance — Populate clinical_registry_record_sources (and related source metadata on clinical_registry_records where needed) so services/registry entries link to source PDFs or uploaded documents.

Acceptance criteria

  1. All intended presentation topics exist as kind: presentation with non-empty payload (sections and related content), unique per (owner_id, slug, kind).
  2. Diagnosis records flagged for missing immediateActions / investigations are either enriched or explicitly deferred with a tracked list.
  3. Each clinically important service/registry record has at least one row in clinical_registry_record_sources pointing to a document_id (or documented reason if internal-only).
  4. Re-run Supabase advisors / spot-check queries confirm no regression in deduplication or RLS on affected tables.

References

  • Supabase project: Clinical KB Database (sjrfecxgysukkwxsowpy)
  • Tables: differential_records, clinical_registry_records, clinical_registry_record_sources, medication_records

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions