How daviddelchan-creator/delchan-health-frontend works
Delchan Health OS is a multitenant clinical-management platform with practitioner administration, clinical records, scheduling, omnichannel CRM, patient portal, and companion mobile app. A typical patient-facing flow is dashboard state loading through the portal API into consultation views; practitioners also manage patient workspaces, while CRM webhooks analyze incoming messages and route them through FHIR resource construction and ZernFlow. Separate document workflows generate tracked forms and ingest scans. The README describes a Medplum FHIR R4 foundation, but the excerpts do not establish every screen-to-service or mobile integration link, so those connections are omitted.
Main entry points: PatientWorkspace.tsx Patient workspace · route.ts CRM webhook · page.tsx Admin console · usePatientDashboard.ts Dashboard state
Components 32
Tenant administration
- Admin console
app/(dashboard)/admin/page.tsx - Staff management
components/admin/StaffManager.tsx - Tenant context
contexts/TenantContext.tsx
Clinical workspace
- Doctor agenda
app/(dashboard)/doctor/agenda/page.tsx - Patient workspace
components/patient/PatientWorkspace.tsx - Patient sidebar
components/patient/PatientSidebar.tsx - Patient timeline
components/patient/PatientTimeline.tsx - Care plans
components/CarePlanList.tsx - Exam records
components/patient/ExamsTab.tsx
Patient portal
- Dashboard state
app/patient/state/usePatientDashboard.ts - Dashboard context
app/patient/state/PatientDashboardContext.tsx - Dashboard API client
app/patient/api/dashboard.ts - Patient consultations
app/patient/consultas/page.tsx
Omnichannel CRM
- Channel configuration
components/crm/ChannelManager.tsx - Channel settings
lib/crm/channels-config.ts - CRM webhook
app/api/crm/webhook/route.ts - Intent and FHIR builder
lib/crm/antigravity-agent.ts - CRM routing engine
lib/crm/zernflow-engine.ts - Intake link builder
lib/crm/patient-intake-link.ts
Documents and mobile
- Form generation API
app/api/forms/generate/route.ts - Tracked PDF generator
lib/qr-pdf-generator.ts - Scan ingestion API
app/api/scan/ingest/route.ts - QR tracking decoder
lib/scan/qr-decoder.ts - Document processing
app/api/patient/documents/[id]/process/route.ts - Document extraction
utils/extraction/extraction-pipeline.ts - OCR provider
utils/ocr/ocr-provider.ts - OCR review
components/review/OCRReviewModal.tsx - Patient mobile app
mobile/app/patient/index.tsx - Health Connect service
mobile/services/HealthConnectService.ts
Other components
- Practitioner
- Patient
- Messaging channels
Connections 19
- Admin console → Tenant context: uses tenant state
app/(dashboard)/admin/page.tsx - Admin console → Staff management: renders staff manager
app/(dashboard)/admin/page.tsx - Channel configuration → Channel settings: saves channel settings
components/crm/ChannelManager.tsx - Messaging channels → CRM webhook: sends webhook events
app/api/crm/webhook/route.ts - CRM webhook → Intent and FHIR builder: analyzes and builds FHIR
app/api/crm/webhook/route.ts - CRM webhook → Intake link builder: builds intake link
app/api/crm/webhook/route.ts - CRM webhook → CRM routing engine: executes routing
app/api/crm/webhook/route.ts - CRM routing engine → Intent and FHIR builder: uses agent context
lib/crm/zernflow-engine.ts - Form generation API → Tracked PDF generator: generates tracked PDF
app/api/forms/generate/route.ts - Scan ingestion API → QR tracking decoder: decodes tracking code
app/api/scan/ingest/route.ts - Dashboard context → Dashboard state: provides dashboard state
app/patient/state/PatientDashboardContext.tsx - Dashboard state → Dashboard API client: fetches dashboard data
app/patient/state/usePatientDashboard.ts - Patient consultations → Dashboard context: reads dashboard state
app/patient/consultas/page.tsx - Patient workspace → Patient sidebar: renders sidebar
components/patient/PatientWorkspace.tsx - Patient workspace → Patient timeline: renders timeline
components/patient/PatientWorkspace.tsx - Patient workspace → Care plans: renders care plans
components/patient/PatientWorkspace.tsx - Patient workspace → Exam records: renders exam records
components/patient/PatientWorkspace.tsx - Document processing → Document extraction: extracts document fields
- Document extraction → OCR provider: consumes OCR results
utils/extraction/extraction-pipeline.ts