Health Records Live Low priority
Doctor-issued prescriptions stored under each consumer's profile, viewable across family members.
Status note: feature is functional but deprioritized for revenue (project memory — not driving GMV at launch). Will receive less attention until commerce flows are stable.
1. Overview
Doctors register, log into a doctor portal, can search for a patient by phone or QR code, and either fill out a prescription form OR upload a prescription image. The patient sees these in Profile → Health Records, grouped by family member, with date filters.
2. User journey
Doctor
- Doctor logs in (separate auth flow)
- Searches consumer by phone OR scans the consumer's QR code
- Form prescription: medication, dosage, instructions, follow-up
- OR: photo upload (handwritten paper prescription)
- Submit → consumer notified
Consumer
- Profile → Health → Health Records
- See chronological list grouped by family member
- Tap a prescription → see form data OR fullscreen image
- Optional: order medications via Pharmacy (Shop → Stores filtered to pharmacies)
3. Web ↔ Mobile parity
| Capability | Web | Mobile |
|---|---|---|
| Consumer view records | ✅ Profile → Health | ✅ health-records.tsx |
| Doctor portal (prescribe) | ✅ /doctor/* | ❌ Doctor is web-only |
| Image upload | ✅ | — |
| Family member grouping | ✅ | ✅ |
4. Key components
- Web (consumer):
src/app/(consumer)/medical/page.tsx - Web (doctor):
src/app/doctor/*— login, dashboard, prescribe form - Mobile:
mobile/app/health-records.tsx
5. APIs
| Endpoint | Method | Purpose |
|---|---|---|
/api/prescriptions | GET | Consumer's own prescriptions |
/api/doctor/prescriptions | POST | Doctor creates prescription |
/api/doctor/patients | GET | Search patient by phone / QR |
/api/doctor/auth | POST | Doctor login/signup (single endpoint with action) |
6. Database touchpoints
Doctor— auth, profile, license number, specialization, photoUrl,resetToken+resetTokenExp(added 2026-04-17)Prescription— doctor-issued prescription (medication, dosage, instructions, image, consumer relation, doctor relation)DoctorNotification,DoctorNotifPrefs— doctor's notification bell + per-channel prefs
7. Business logic
- QR code search: each consumer has a unique QR (
KA26-XXXXXX). Doctor scans → identifies patient. - Family member grouping: prescriptions for the same
consumerIdbut differentpatientNameare grouped by name in the UI. - Doctor broadcast: doctors can send broadcasts to all patients (e.g., "Clinic closed Monday").
doctorBroadcastToPatients()pushes to patients AND doctor (was missing patient push before).
8. Feature flags / env vars
None.
9. Tests
tests/seller-verification.test.ts(also covers doctor auth surface)- Mobile health-records screen presence
10. Known gotchas
- Pharmacy ordering deprioritized: not driving revenue per project memory. Don't invest heavily in this flow until commerce side is stable.
- Doctor portal is web-only — there's no mobile doctor app yet. Doctors use the responsive web view at
/doctor/*. - Image prescriptions are stored in GCS with consumer-readable signed URLs — be careful with retention policy (medical data has DPDP Act implications).
11. Related
- Authentication — doctor auth
- Notifications — doctor broadcast