How amanpandey284/sehat-saathi works
Sehat Saathi is a pre-consultation clinical intake prototype: patients provide consent and a complaint, complete adaptive history, optionally add prior documents, then review and submit a record for physician review. The product also supports urgent-safety flags, AYUSH history, multilingual and voice interaction, and a physician workflow for verification, conflicts, timeline, summaries, and FHIR-ready export. The graph centers the src/ application and its API; duplicated frontend/ modules are not expanded separately. Some subsystem links rely on README descriptions because their implementation was not sampled.
Main entry points: App.tsx Application routes · PatientSessionContext.tsx Patient session · PatientReview.tsx Patient review · main.py FastAPI application
Components 33
Patient intake
- Application routes
src/App.tsx - Patient session
src/features/patient/state/PatientSessionContext.tsx - Consent and profile
src/features/patient/ConsentScreen.tsx - Chief complaint
src/features/patient/ChiefComplaintFlow.tsx - Adaptive history
src/features/patient/AdaptiveHistoryFlow.tsx - Document upload
src/pages/PatientDocuments.tsx - AYUSH history
src/pages/AyushMode.tsx - Patient review
src/pages/PatientReview.tsx - Language support
src/i18n/LanguageContext.tsx - Voice input
src/components/VoiceInputButton.tsx
Clinical processing
- Question engine
src/features/patient/engine/questionEngineCore.ts - Complaint classifier
src/features/patient/services/complaintClassifier.ts - Answer normalization
src/features/patient/services/clinicalNormalizer.ts - Safety checks
src/features/safety/safetyEngine.ts - Clinical routing
src/features/routing/routingService.ts
Physician review
- Record timeline
src/features/history/recordUtils.ts - Physician dashboard
src/features/doctor/DoctorDashboard.tsx - Conflict detection
src/features/history/conflictEngine.ts - Evidence summary
src/features/history/summaryGenerator.ts - FHIR export
src/features/history/fhir.ts - Patient records
src/features/doctor/patientRecords.ts
API and services
- API client
src/services/api.ts - Session tokens
src/services/authStorage.ts - FastAPI application
backend/app/main.py - Authentication API
backend/app/api/auth.py - Encounter API
backend/app/api/encounters.py - Document OCR API
backend/app/api/documents.py - AI summary API
backend/app/api/ai.py - Auth services
backend/app/core/auth.py - Database
backend/app/core/db.py - Medical extractor
backend/app/core/medical_extractor.py
Other components
- Patient
- OpenAI provider
Connections 42
- Patient → Application routes: starts workflow
src/App.tsx - Application routes → Consent and profile: routes to
src/App.tsx - Application routes → Chief complaint: routes to
src/App.tsx - Application routes → Adaptive history: routes to
src/App.tsx - Application routes → Document upload: routes to
src/App.tsx - Application routes → Patient review: routes to
src/App.tsx - Application routes → AYUSH history: routes to
src/App.tsx - Application routes → Patient session: provides state
src/App.tsx - Application routes → Language support: provides language
src/App.tsx - Chief complaint → Patient session: records complaint
- Adaptive history → Patient session: records history
- Patient session → Complaint classifier: classifies complaint
src/features/patient/state/PatientSessionContext.tsx - Adaptive history → Question engine: uses questions
- Patient session → Answer normalization: normalizes answers
src/features/patient/state/PatientSessionContext.tsx - Patient session → Safety checks: checks safety
src/features/safety/safetyEngine.ts - Complaint classifier → Clinical routing: informs routing
src/features/routing/routingService.ts - Patient → Voice input: provides speech
README.md - Patient → Document upload: uploads records
README.md - Patient review → Patient session: reads intake
src/pages/PatientReview.tsx - Patient review → Patient records: saves record
src/pages/PatientReview.tsx - Patient review → FastAPI application: posts encounter
src/pages/PatientReview.tsx - Patient review → Session tokens: gets session token
src/pages/PatientReview.tsx - Patient review → Record timeline: builds timeline
src/pages/PatientReview.tsx - Physician dashboard → Conflict detection: detects contradictions
README.md - Physician dashboard → Evidence summary: shows summary
README.md - Physician dashboard → FHIR export: exports record
README.md - Physician dashboard → Patient records: reviews records
README.md - FastAPI application → Authentication API: registers router
backend/app/main.py - FastAPI application → Encounter API: registers router
backend/app/main.py - FastAPI application → Document OCR API: registers router
backend/app/main.py - FastAPI application → AI summary API: registers router
backend/app/main.py - Authentication API → Auth services: uses auth
backend/app/api/auth.py - Encounter API → Auth services: uses auth
backend/app/api/encounters.py - Document OCR API → Auth services: uses auth
backend/app/api/documents.py - AI summary API → Auth services: uses auth
backend/app/api/ai.py - Encounter API → Database: uses database
backend/app/api/encounters.py - Document OCR API → Database: uses database
backend/app/api/documents.py - AI summary API → Database: uses database
backend/app/api/ai.py - Document OCR API → Medical extractor: extracts medical data
backend/app/api/documents.py - API client → Session tokens: uses tokens
src/services/api.ts - Session tokens → Authentication API: requests guest session
src/services/authStorage.ts - AI summary API → OpenAI provider: optionally summarizes
README.md