mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 13:52:20 +00:00
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:
1 parent
47c8f52001
commit
a868bd1cf2
3 files changed
+37
No files matched your search
@@ -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",
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user