diff --git a/backend/package-lock.json b/backend/package-lock.json index f6bcd9b..e8b53a7 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -1,12 +1,12 @@ { "name": "medassist-ng-backend", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "medassist-ng-backend", - "version": "1.0.1", + "version": "1.0.2", "dependencies": { "@fastify/cookie": "^10.0.1", "@fastify/cors": "^10.0.1", diff --git a/backend/src/routes/medications.ts b/backend/src/routes/medications.ts index 7aa2a41..8c65cc4 100644 --- a/backend/src/routes/medications.ts +++ b/backend/src/routes/medications.ts @@ -353,7 +353,7 @@ export async function medicationRoutes(app: FastifyInstance) { }); const currentPills = Math.max(0, originalTotalPills - consumedUntilNow); - const stripsNeeded = pillsPerBlister > 0 ? Math.ceil(usageTotal / pillsPerBlister) : 0; + const blistersNeeded = pillsPerBlister > 0 ? Math.ceil(usageTotal / pillsPerBlister) : 0; // Calculate current stock using realistic consumption order (loose first, then blisters) const consumed = originalTotalPills - currentPills; @@ -373,8 +373,8 @@ export async function medicationRoutes(app: FastifyInstance) { medicationName: row.name, totalPills: currentPills, plannerUsage: usageTotal, - stripSize: pillsPerBlister, - stripsNeeded, + blisterSize: pillsPerBlister, + blistersNeeded, fullBlisters, loosePills, enough, diff --git a/backend/src/routes/planner.ts b/backend/src/routes/planner.ts index df1270c..dbd64cc 100644 --- a/backend/src/routes/planner.ts +++ b/backend/src/routes/planner.ts @@ -12,9 +12,10 @@ type PlannerRow = { medicationName: string; totalPills: number; plannerUsage: number; - stripSize: number; - stripsNeeded: number; - stripsAvailable: number; + blisterSize: number; + blistersNeeded: number; + fullBlisters: number; + loosePills: number; enough: boolean; }; @@ -102,8 +103,8 @@ export async function plannerRoutes(app: FastifyInstance) { ${row.medicationName} ${row.totalPills} ${row.plannerUsage} - ${row.stripsNeeded} × ${row.stripSize} - ${row.stripsAvailable} + ${row.blistersNeeded} × ${row.blisterSize} + ${row.fullBlisters}${row.loosePills > 0 ? ` (+${row.loosePills})` : ""} `${r.medicationName}: ${r.totalPills} pills in stock, ${r.plannerUsage} pills needed, ${r.fullBlisters} blisters available${r.loosePills > 0 ? ` (+${r.loosePills} loose)` : ""} (${r.blistersNeeded} needed) - ${r.enough ? "Enough" : "OUT OF STOCK"}`).join("\n")} --- Sent from MedAssist-ng Medication Planner`; diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 35672cf..16904a4 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -32,8 +32,8 @@ type PlannerRow = { medicationName: string; totalPills: number; plannerUsage: number; - stripSize: number; - stripsNeeded: number; + blisterSize: number; + blistersNeeded: number; fullBlisters: number; loosePills: number; enough: boolean; @@ -1855,7 +1855,7 @@ function AppContent() {
med && setSelectedMed(med)}> {row.medicationName} {row.plannerUsage} {t('common.pills')} - {row.stripsNeeded} × {row.stripSize} + {row.blistersNeeded} × {row.blisterSize} {row.fullBlisters} {t('common.blisters')}{row.loosePills > 0 && ` + ${row.loosePills} ${t('common.pills')}`}