How TriageSense Works

A deep dive into the technical architecture and AI-powered workflow that powers our intelligent patient triage system.

System Architecture

The complete data flow from patient input to medical staff notification

👤

Patient

Provides symptoms via form or voice

📝

Intake Form

Next.js 14 with voice-to-text

🔧

API Endpoint

/api/triage validation & processing

🤖

Infermedica AI

Parse + Diagnosis APIs

🧠

AI Analysis

Symptom parsing & triage classification

Triage Level

Emergency/Urgent/Non-Urgent

📱

Slack Integration

Rich Block Kit notifications

👩‍⚕️

Medical Staff

Real-time alerts & patient data

Technical Implementation

Detailed breakdown of the AI-powered workflow and system components

AI-Powered Workflow

1. Symptom Parsing

Patient symptoms are sent to Infermedica's Parse API, which converts natural language into structured medical evidence using advanced NLP.

POST /v3/parse
Input: "I have severe headache and fever"
Output: Structured evidence objects

2. AI Diagnosis

The structured evidence is analyzed by Infermedica's Diagnosis API, which uses machine learning models trained on medical data to determine triage levels.

POST /v3/diagnosis
Input: Evidence + patient demographics
Output: Triage level + condition probabilities

3. Triage Classification

The AI determines urgency levels based on symptom severity, potential conditions, and medical best practices.

🚨Emergency: Immediate attention required
⚠️Urgent: Medical attention within hours
Non-Urgent: Routine care or follow-up

System Components

Frontend (Next.js 14)

  • • React components with TypeScript
  • • Tailwind CSS for responsive design
  • • Voice-to-text integration (Web Speech API)
  • • Real-time form validation
  • • Loading animations and UX feedback

Backend API

  • • Next.js API routes (/api/triage)
  • • Input validation and sanitization
  • • Age calculation from date of birth
  • • Error handling and logging
  • • Environment variable management

AI Integration

  • • Infermedica Parse API integration
  • • Infermedica Diagnosis API integration
  • • Two-step AI workflow simulation
  • • Mock data generation for portfolio
  • • Realistic timing and delays

Notifications

  • • Slack Incoming Webhooks
  • • Block Kit message formatting
  • • Rich media notifications
  • • Medical staff alert system
  • • Patient data formatting

Data Flow & Security

How patient data flows through the system with security and privacy considerations

🔒

Data Security

  • • HTTPS encryption for all communications
  • • Environment variable protection
  • • Input validation and sanitization
  • • No persistent data storage
  • • Secure API key management

Performance

  • • Optimized API calls with proper timing
  • • Client-side form validation
  • • Efficient state management
  • • Responsive loading animations
  • • Minimal external dependencies
🔄

Scalability

  • • Stateless API design
  • • Horizontal scaling capability
  • • Modular component architecture
  • • Environment-based configuration
  • • Cloud deployment ready

Technology Stack

Modern technologies powering the TriageSense platform

⚛️

React 18

Component-based UI with hooks

🚀

Next.js 14

App Router & API routes

🎨

Tailwind CSS

Utility-first styling

🤖

Infermedica AI

Medical AI diagnosis

📱

Slack API

Real-time notifications

🎤

Web Speech API

Voice-to-text input

📦

TypeScript

Type-safe development

🔧

ESLint

Code quality & standards

Ready to Try TriageSense?

Experience the AI-powered patient triage system in action