How hijyotirmoy/ekms-triage works
EKMS Triage Sandbox supports agent-led caller intake, clinical urgency assessment, facility routing, and case logging, alongside live call handling, case review, facility management, and API/feedback tools. The principal documented flow is intake through triage evaluation and location-based facility ranking to persistence. Sampled source confirms the triage route’s calls into the evaluation, geography, and storage layers; several UI-to-route connections and unsampled endpoint internals are based on the documented capabilities, so uncertain wiring is omitted.
Main entry points: route.js Triage Endpoint · db.js Case and Facility Storage · CallManager.jsx Call Manager · TriageConsole.jsx Triage Console
Components 23
Intake and Calls
- Application Shell
src/components/AppShell.jsx - Triage Console
src/components/TriageConsole.jsx - Call Manager
src/components/CallManager.jsx - Call Signaling
src/app/api/call/signal/route.js - Speech Services
src/app/api/scribe/whisper/route.js
Clinical Assessment
- Adaptive Chat
src/lib/doctorChatEngine.js - Clinical Questioning
src/lib/clinicalAdaptiveEngine.js - Triage Endpoint
src/app/api/triage/route.js - Urgency Evaluator
src/lib/triageEngine.js - Groq AI
src/lib/groqPool.js - Feedback Manager
src/components/FeedbackManager.jsx - Feedback Endpoint
src/app/api/feedback/route.js - Feedback Learning
src/lib/feedbackLearningEngine.js
Facility Routing
- Facility Directory
src/components/FacilityDirectory.jsx - Facility Endpoints
src/app/api/facilities/route.js - Location and Ranking
src/lib/geo.js
Records and Operations
- Case Logs
src/components/CaseLogs.jsx - Case Endpoints
src/app/api/cases/route.js - Case and Facility Storage
src/lib/db.js - API Playground
src/components/DeveloperApi.jsx
Other components
- Caller
- Triage Agent
- Firestore
Connections 28
- Caller → Triage Agent: reports symptoms
- Triage Agent → Triage Console: enters intake
- Application Shell → Triage Console: presents
- Triage Agent → Call Manager: handles calls
- Call Manager → Call Signaling: signals calls
- Call Manager → Speech Services: submits audio
- Triage Console → Adaptive Chat: conducts probing
- Adaptive Chat → Clinical Questioning: extracts clinical context
- Triage Console → Triage Endpoint: submits intake
- Triage Endpoint → Urgency Evaluator: evaluates urgency
- Urgency Evaluator → Groq AI: requests evaluation
- Urgency Evaluator → Feedback Learning: loads rules
- Triage Endpoint → Location and Ranking: resolves and ranks
- Triage Endpoint → Case and Facility Storage: loads facilities
- Triage Endpoint → Case and Facility Storage: saves case
- Triage Agent → Case Logs: reviews cases
- Case Logs → Case Endpoints: requests case records
- Case Endpoints → Case and Facility Storage: reads and deletes
- Triage Agent → Facility Directory: manages directory
- Facility Directory → Facility Endpoints: searches facilities
- Facility Endpoints → Case and Facility Storage: reads facilities
- Triage Agent → Feedback Manager: submits corrections
- Feedback Manager → Feedback Endpoint: sends feedback
- Feedback Endpoint → Feedback Learning: manages feedback rules
- Triage Agent → API Playground: tests API
- Call Signaling → Firestore: reads and updates calls
- Call Manager → Firestore: subscribes to calls
- Case and Facility Storage → Firestore: persists when configured