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

+2
View File
@@ -29,6 +29,8 @@ const MEDICATION_CATEGORY_KEYS: Record<string, string> = {
HORMONE: "medications.categoryHormone",
SKIN: "medications.categorySkin",
SLEEP_AID: "medications.categorySleepAid",
DIABETES: "medications.categoryDiabetes",
ANTIBIOTIC: "medications.categoryAntibiotic",
OTHER: "medications.categoryOther",
};
+11
View File
@@ -1,6 +1,14 @@
import { z } from "zod/v4";
const timeRegex = /^([01]\d|2[0-3]):([0-5]\d)$/;
/**
* Clinical-category values stored in the `medication_categories` side-
* table (TEXT column). v1.5.4 adds `DIABETES` and `ANTIBIOTIC` so the
* wizard's Step 2 taxonomy can write a first-class bucket for those
* two rows instead of collapsing them into `OTHER`. The column is a
* plain TEXT field — no Prisma enum exists to migrate; the Zod values
* list is the only enforcement layer.
*/
export const MEDICATION_CATEGORY_VALUES = [
"BLOOD_PRESSURE",
"VITAMIN",
@@ -12,8 +20,11 @@ export const MEDICATION_CATEGORY_VALUES = [
"HORMONE",
"SKIN",
"SLEEP_AID",
"DIABETES",
"ANTIBIOTIC",
"OTHER",
] as const;
export type MedicationCategoryValue = (typeof MEDICATION_CATEGORY_VALUES)[number];
/**
* v1.4.25 W4d — Prisma-level treatment class. Orthogonal to