How shitij07/prescriptionsetu works
PrescriptionSetu turns prescription text or images into medication candidates, requires caregiver verification before activating them, then schedules reminders and tracks patient replies for caregiver escalation. The dashboard supports prescription review and operational views; backend routes, parsing, verification, reminders, adherence, and retention form the main product layers. Several route and dashboard implementations were not sampled, so only documented or source-supported wiring is shown; translation is documented but has no dedicated directory in the supplied tree.
Main entry points: app.ts Express API application · connection.ts PostgreSQL data store · prescriptions.ts Prescription routes · service.ts Reminder generation
Components 26
Caregiver dashboard
- Review and patient views
apps/dashboard/src/app - Prescription upload
apps/dashboard/src/components/UploadPrescriptionModal.tsx - Dashboard API client
apps/dashboard/src/lib/api.ts
Clinical processing
- Express API application
apps/api/src/app.ts - Prescription routes
apps/api/src/routes/prescriptions.ts - OCR provider seam
apps/api/src/ocr/types.ts - Deterministic shorthand parser
apps/api/src/parser/parse.ts - Prescription persistence
apps/api/src/db/repository.ts - PostgreSQL data store
apps/api/src/db/connection.ts - Verification gate
apps/api/src/verification/gate.ts - Medication routes
apps/api/src/routes/medications.ts
Reminders and delivery
- Reminder generation
apps/api/src/reminders/service.ts - Reminder scheduler
apps/api/src/reminders/scheduler.ts - BullMQ job queue
apps/api/src/reminders/queue.ts - Reminder worker
apps/api/src/reminders/worker.ts - Translation providers
apps/api/src - WhatsApp / console provider
apps/api/src/delivery/types.ts
Adherence tracking
- Adherence routes
apps/api/src/routes/adherence.ts - Reply classification and stats
apps/api/src/adherence/service.ts - Keyword classifier
apps/api/src/adherence/classifier.ts
Privacy and audit
- Erasure and image retention
apps/api/src/retention/service.ts - Audit routes
apps/api/src/routes/audit.ts - Sanitized structured logging
apps/api/src/logging/logger.ts
Other components
- Caregiver / verifier
- Patient
- Redis
Connections 34
- Caregiver / verifier → Prescription upload: uploads prescription
- Prescription upload → Dashboard API client: submits upload
- Dashboard API client → Express API application: calls API
- Express API application → Prescription routes: dispatches requests
- Prescription routes → OCR provider seam: requests OCR
- Prescription routes → Deterministic shorthand parser: parses OCR text
- Prescription routes → Prescription persistence: saves candidates
- Deterministic shorthand parser → Prescription routes: returns candidates
- Prescription persistence → PostgreSQL data store: writes records
- Review and patient views → Dashboard API client: loads review data
- Caregiver / verifier → Review and patient views: reviews candidates
- Express API application → Medication routes: dispatches requests
- Medication routes → Verification gate: confirms or rejects
- Verification gate → PostgreSQL data store: guards and updates
- Verification gate → Reminder generation: activates reminders
- Reminder generation → Reminder scheduler: calculates times
- Reminder generation → PostgreSQL data store: persists reminders
- Reminder generation → BullMQ job queue: enqueues jobs
- BullMQ job queue → Redis: stores jobs
- Redis → Reminder worker: dispatches jobs
- Reminder worker → PostgreSQL data store: checks live state
- Reminder worker → Translation providers: translates reminder
- Reminder worker → WhatsApp / console provider: sends message
- WhatsApp / console provider → Patient: delivers reminder
- Patient → Adherence routes: replies to reminder
- Express API application → Adherence routes: dispatches requests
- Adherence routes → Reply classification and stats: records reply
- Reply classification and stats → Keyword classifier: classifies reply
- Reply classification and stats → PostgreSQL data store: reads and writes logs
- Reply classification and stats → WhatsApp / console provider: escalates attention
- Express API application → Audit routes: dispatches requests
- Audit routes → PostgreSQL data store: reads audit data
- Erasure and image retention → PostgreSQL data store: scrubs patient data
- Express API application → Sanitized structured logging: logs requests and errors