How cdb26/emergensave-pub works
EmergenSave coordinates emergency response across patients, dispatchers, ambulance responders, and hospitals, with separate patient-care and administrative features. The main documented flow is emergency request, dispatcher review and assignment, responder status/location updates, then hospital preparation with triage information. Firebase provides the documented real-time shared state; authentication guards form an internal access-control layer. Paths and connections for some features are based on the README and tree because their source was not sampled; the tree does not include the README-mentioned doctorPanel directory.
Main entry points: [dispatchId]/page.tsx Active Case · voicecall/page.tsx Live Voice Call · dispatchPanel/page.tsx Dispatch Queue · ambuPanel/page.tsx Responder Dispatch
Components 20
Emergency Response
- Emergency Request
app/homepage/page.tsx - Dispatch Queue
app/dispatchPanel/page.tsx - Responder Dispatch
app/ambuPanel/page.tsx - Active Case
app/onAction/[facilityId]/[dispatchId]/page.tsx - Live Voice Call
app/voicecall/page.tsx
Patient Care
- Appointments
app/medSched/page.tsx - Medical History
app/medRec/page.tsx - Patient Profile
app/profile/page.tsx
Hospital Operations
- Urgent Cases
app/hospitalPanel/components/UrgentCasesDashboard.tsx - Triage Notes
app/adminPanel/triage.tsx - Hospital Management
app/hospitalPanel/page.tsx - Admin Oversight
app/adminPanel/page.tsx
Identity and Access
- Role Guards
components/Auth
Other components
- Patient
- Dispatcher
- Ambulance Responder
- Receiving Hospital
- Firebase Services
- Google Maps
- Agora Calling
Connections 23
- Patient → Emergency Request: triggers
- Emergency Request → Firebase Services: stores request
- Firebase Services → Dispatch Queue: updates live
- Dispatcher → Dispatch Queue: reviews
- Dispatch Queue → Responder Dispatch: assigns case
- Ambulance Responder → Responder Dispatch: receives case
- Responder Dispatch → Active Case: opens case
- Active Case → Firebase Services: updates status
- Active Case → Google Maps: shows location
- Firebase Services → Urgent Cases: updates live
- Urgent Cases → Receiving Hospital: alerts
- Active Case → Triage Notes: shares notes
- Dispatcher → Live Voice Call: initiates call
- Ambulance Responder → Live Voice Call: initiates call
- Live Voice Call → Patient: connects
- Live Voice Call → Agora Calling: uses RTC
- Patient → Appointments: books
- Patient → Medical History: manages history
- Patient → Patient Profile: manages profile
- Hospital Management → Appointments: manages
- Hospital Management → Urgent Cases: manages
- Admin Oversight → Firebase Services: oversees records
- Role Guards → Firebase Services: checks identity