How christinaprado/open-health-stack works
PHOHSP is an offline-first community health records app for Philippine health workers and patients. Users register households and patients, record or review clinical information, and use patient-portal features such as appointment requests, home readings, referrals, and encrypted summary sharing. Records are stored locally first; the sync worker sends patient records through OpenHIM toward OpenCR and other FHIR resources toward HAPI FHIR. The README documents the major capabilities and integrations; source excerpts confirm local persistence and sync behavior, but most feature-specific wiring was not sampled.
Main entry points: app Mobile app · resourceRepository.ts FHIR resource repository · fhir FHIR clinical services · syncWorker.ts Sync worker
Components 24
Mobile experience
- Mobile app
src/app - Household registration
src/app/register-household.tsx - Patient registration
src/app/register-patient.tsx - Patient portal
src/components/patient/PatientPortalHome.tsx - Appointments
src/app/appointments.tsx - Chatbot
src/chatbot/engine.ts
Clinical records
- Clinical capture
src/app - FHIR clinical services
src/fhir - Patient records
src/fhir/patientRecord.ts - Patient summary
src/fhir/ipsService.ts - Integrity provenance
src/fhir/provenanceService.ts - Terminology coding
src/terminology
Offline data and sync
- SQLite database
src/db/database.ts - FHIR resource repository
src/db/resourceRepository.ts - Sync queue
src/sync/syncQueue.ts - Sync worker
src/sync/syncWorker.ts
Interoperability
- OpenHIM router
- OpenCR MPI
- HAPI FHIR
Identity and sharing
- Supabase auth and sharing
src/lib/supabase.ts - Smart Health Links
src/shl/smartHealthLink.ts
Other components
- Health worker
- Patient
- Doctor
Connections 25
- Health worker → Mobile app: uses
- Patient → Mobile app: uses
- Mobile app → Household registration: registers
- Mobile app → Patient registration: registers
- Mobile app → Clinical capture: records care
- Mobile app → Patient portal: views portal
- Mobile app → Appointments: manages requests
- Mobile app → Chatbot: asks questions
- Clinical capture → FHIR clinical services: creates records
- FHIR clinical services → FHIR resource repository: saves resources
- Patient records → FHIR resource repository: reads resources
- Patient summary → FHIR resource repository: reads records
- Patient summary → Integrity provenance: checks integrity
- FHIR clinical services → Terminology coding: codes concepts
- FHIR resource repository → SQLite database: reads and writes
- FHIR clinical services → Sync queue: queues changes
- Sync worker → Sync queue: processes items
- Sync worker → FHIR resource repository: reads and marks
- Sync worker → OpenHIM router: sends FHIR
- OpenHIM router → OpenCR MPI: routes patients
- OpenHIM router → HAPI FHIR: routes clinical data
- Mobile app → Supabase auth and sharing: authenticates
- Patient portal → Smart Health Links: shares summary
- Smart Health Links → Supabase auth and sharing: stores encrypted file
- Doctor → Smart Health Links: receives summary