feat: org-scoped prescriptions backend, wire prescriptions page

Add the prescriptions table, validation, service and CRUD routes
(/api/prescriptions, RBAC-gated; prescriber defaults to the signed-in
clinician, prescribedAt to today) and the frontend data module. The page
now loads/persists real data and computes its status KPIs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Khalid Abdi
2026-06-07 19:37:46 +03:00
parent dec04ec506
commit 7ef9da59bd
14 changed files with 2195 additions and 111 deletions
+3
View File
@@ -8,6 +8,7 @@ import { errorHandler, notFound } from "./middleware/error.js";
import { appointmentsRouter } from "./routes/appointments.js";
import { notesRouter } from "./routes/notes.js";
import { patientsRouter } from "./routes/patients.js";
import { prescriptionsRouter } from "./routes/prescriptions.js";
const app = express();
@@ -47,6 +48,7 @@ app.get("/health", (_req, res) => {
app.use("/api/patients", patientsRouter);
app.use("/api/notes", notesRouter);
app.use("/api/appointments", appointmentsRouter);
app.use("/api/prescriptions", prescriptionsRouter);
app.use(notFound);
app.use(errorHandler);
@@ -57,4 +59,5 @@ app.listen(env.PORT, () => {
console.log(` • patients: /api/patients`);
console.log(` • notes: /api/notes`);
console.log(` • appts: /api/appointments`);
console.log(` • rx: /api/prescriptions`);
});