feat(meds): extend MedicationCategory with diabetes and antibiotic

Adds DIABETES and ANTIBIOTIC to MEDICATION_CATEGORY_VALUES so the
upcoming modal wizard's Step 2 taxonomy can write the two rows as
first-class clinical categories instead of falling back to OTHER.
The clinical category column on medication_categories is plain TEXT
backed by Zod for validation; no Prisma enum exists to ALTER, so the
migration is documentation-only and the category-label drift-guard
gets the matching keys. Both new values feed back into the rendered
badges on the medication card.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marc-André BombeckandClaude Opus 4.7 committed 2026-05-28 19:33:11 +02:00
1 parent 47c8f52001
commit a868bd1cf2
3 files changed
+37

No files matched your search

@@ -0,0 +1,24 @@
-- v1.5.4 — Clinical category bucket additions.
--
-- The medication's clinical category lives in a side-table
-- (`medication_categories`) with a TEXT column rather than a Prisma
-- enum, so adding a new bucket does not require an ALTER TYPE. The
-- migration is documentation-only — the new "DIABETES" and
-- "ANTIBIOTIC" values are enforced at the Zod layer
-- (`MEDICATION_CATEGORY_VALUES` in src/lib/validations/medication.ts)
-- and the side-table's `normalizeCategory` helper accepts them on
-- the same path as the pre-existing buckets.
--
-- The modal-wizard's Step 2 taxonomy adds Diabetes and Antibiotikum
-- as first-class rows. The mapping table (see
-- src/components/medications/wizard/wizard-payload.ts —
-- WIZARD_TREATMENT_MAPPING) writes "DIABETES" and "ANTIBIOTIC" to
-- the side-table for those rows instead of collapsing them into
-- "OTHER".
--
-- No SQL changes are needed — the index on `category` already covers
-- the new values, and existing rows retain their previous bucket.
-- Force a non-empty migration body so prisma records the new step
-- in the `_prisma_migrations` ledger.
SELECT 1 WHERE FALSE;