Skip to content

About

Emergency AI — medical triage chatbot with AI severity assessment, first-aid guides, and one-tap emergency actions. React + Express + OpenAI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Emergency AI — mini_ashptal

AI-powered medical triage assistant. Describe a situation, get a severity assessment, first-aid guidance, and one-tap emergency actions.

React Vite Express License: MIT

A full-stack emergency-response web app: an AI triage engine (OpenAI) analyzes medical situations described in chat, classifies severity, and — when it's an emergency — arms a dashboard with one-tap actions: call an ambulance, alert emergency contacts, find the nearest hospital, and share your location.

Features

  • 🩺 AI triage — chat describes the situation, the model returns follow-up questions or a severity classification with risk score (0–100)
  • 🚨 Emergency mode — auto-activates on EMERGENCY severity with a dedicated dashboard
  • 🆘 One-tap actions — call ambulance (tel:108), call a contact, find nearest hospital (Google Maps), SMS location alert
  • 🩹 First-aid quick guides — keyword-triggered cards for heart attack, stroke, choking, severe bleeding, burns
  • 👤 Onboarding + profile — name, age, blood group, emergency contacts (persisted in localStorage)
  • 📱 Responsive — mobile-first chat UI

Quick start

# 1. Install dependencies
npm install

# 2. Set your OpenAI key
cp .env.example .env    # add OPENAI_API_KEY=sk-...

# 3. Run (client + server together)
npm run dev

Open http://localhost:5173

How triage works

User message ──▶ POST /api/analyze ──▶ OpenAI Responses API
                                          │  medical triage system prompt
                                          ▼
                          JSON: follow-up questions
                          OR: { severity, risk_score, advice, disclaimer }
  • Follow-up questions are shown when symptoms are unclear
  • Severity + risk score + advice render as the bot reply
  • EMERGENCY severity flips the app into emergency mode automatically
  • API failure falls back to "contact emergency services"

Project structure

mini_ashptal/
├── src/
│   ├── App.jsx                     # routing + profile gate
│   └── pages/
│       ├── Onboarding.jsx          # profile + emergency contacts
│       └── EmergencyDashboard.jsx  # triage chat + emergency actions
├── server/
│   ├── index.js                    # Express API
│   └── openai.js                   # OpenAI Responses integration
├── api/                            # serverless handlers (analyze, health)
└── FUNCTIONALITY.md                # detailed behavior spec

License

MIT

About

Emergency AI — medical triage chatbot with AI severity assessment, first-aid guides, and one-tap emergency actions. React + Express + OpenAI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages