Skip to content

Parth-Dua/RiageNav

Repository files navigation

TriageNav

AI-powered emergency medical triage and routing. Describe your symptoms — by typing or voice — and TriageNav uses Claude to classify urgency, picks the right facility type, and ranks nearby care on a live crowding + distance map.

What it does

  • Live hospital map (Google Maps + custom animated overlay markers) where each marker encodes three signals at once: crowding (fill), proximity (size), urgency match (color).
  • Symptom input via text or browser-native voice (Web Speech API).
  • Claude-powered triage (claude-sonnet-4-20250514) returns urgency level, facility type, a 3-sentence arrival card for the nurse, red flags, and reasoning for the patient.
  • Facility ranking with a composite score: urgencyMatch × 0.4 + proximity × 0.3 + (100 − crowding) × 0.3.
  • Crowding simulation (hourly base × hospital-size factor × weekend boost + deterministic per-place noise) — labeled clearly as simulated.
  • Arrival card — a nurse-facing, print-friendly summary at /card.
  • 911 lane — life-threatening triage hides facility cards and surfaces a direct call CTA.

Stack

  • Next.js 16 (app router) + React 19 + TypeScript
  • Tailwind CSS v4
  • Framer Motion, Recharts, lucide-react
  • Google Maps JavaScript API + Places API
  • Anthropic Claude (Sonnet 4)

Getting started

npm install
cp .env.example .env.local
# fill in ANTHROPIC_API_KEY, NEXT_PUBLIC_GOOGLE_MAPS_API_KEY, GOOGLE_MAPS_API_KEY
npm run dev

Open http://localhost:3000.

Without keys?

The app degrades gracefully:

  • No ANTHROPIC_API_KEY → a keyword-based heuristic runs on the server so the triage lane always works.
  • No Google Maps keys → a hand-drawn synthetic map + synthetic nearby facilities render so the map visualization still shines.

App structure

app/
  page.tsx                  # Home (map + symptom input)
  HomeClient.tsx
  results/page.tsx          # Triage + ranked facilities + charts
  results/ResultsClient.tsx
  card/page.tsx             # Nurse-facing arrival card (printable)
  card/CardClient.tsx
  api/triage/route.ts       # POST — Claude triage
  api/facilities/route.ts   # GET  — Places + crowding + score
components/
  HospitalMap.tsx           # Google map + custom animated overlay + fallback
  SymptomInput.tsx
  UrgencyBadge.tsx
  FacilityCard.tsx
  ArrivalCard.tsx
  ComparisonCharts.tsx      # Radar + crowding timeline
  Call911Banner.tsx
  CrowdingRing.tsx
  InsuranceToggle.tsx
  RedFlags.tsx
  TopBar.tsx
lib/
  claude.ts                 # Triage prompt, Anthropic client, heuristic fallback
  crowding.ts               # Simulation engine
  scoring.ts                # Urgency/facility match, composite score, cost est.
  places.ts                 # Google Places wrapper + synthetic data
  utils.ts

Next steps (not built)

  • Login, history, real EHR/HL7 integration
  • Real-time WiFi / occupancy data (today's crowding is simulated — clearly labeled)
  • Multi-language support (triage prompt is English-only)
  • SMS fallback for low-signal environments
  • Nurse-side dashboard to preview arriving patients

Not a substitute for professional medical advice. Call 911 for life-threatening emergencies.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors