AI-Assisted Fever Triage System

Inspiration

The inspiration for this project came from witnessing the overwhelming pressure on healthcare systems, particularly during flu seasons and health crises. Emergency rooms are often flooded with patients seeking guidance for fever-related symptoms, many of whom could receive initial assessment and care recommendations remotely.

We realized that while fever is one of the most common symptoms people experience, the decision of whether to seek immediate medical attention, wait it out at home, or take specific actions is often unclear to patients. This uncertainty leads to unnecessary ER visits for minor cases and delayed care for serious conditions.

Our goal was to bridge this gap by creating an AI-powered system that could provide immediate, reliable, and medically-sound triage assessments while maintaining the safety protocols that healthcare professionals follow.


💡 What it does

Our AI-Assisted Fever Triage System is a comprehensive healthcare application that:

Core Triage Functionality

  • Intelligent Symptom Assessment: Collects detailed patient information including temperature, duration, accompanying symptoms, and medical history
  • AI-Powered Analysis: Uses advanced language models (Google Gemini) trained on medical protocols to assess symptom severity
  • SIRS Criteria Integration: Implements Systemic Inflammatory Response Syndrome criteria for accurate medical assessment
  • Risk Stratification: Categorizes patients into immediate emergency, urgent care, or home care recommendations

Advanced Features

  • User Profiling System: 4-step comprehensive health profile including medical conditions, allergies, medications, and emergency contacts
  • Temperature Tracking: Daily temperature logging with visual charts and trend analysis
  • Smart Medicine Reminders: Customizable medication schedules with browser notifications
  • AI Chatbot: Follow-up care guidance, symptom monitoring, and 24/7 health support
  • Demo Cases: Educational scenarios showing system capabilities and decision-making process

Emergency Protocols

  • Immediate Alert System: Detects high-risk symptoms requiring immediate medical attention
  • Clear Action Plans: Provides specific, actionable recommendations based on assessment results
  • Professional UI: Medical-grade interface designed for clarity and trust in healthcare decisions

🛠️ How we built it

Architecture Overview

We designed a modern, scalable full-stack application with clear separation of concerns:

Frontend: Next.js 14 with TypeScript and Tailwind CSS Backend: FastAPI with Python AI Integration: Multi-provider architecture supporting Google Gemini, OpenAI, and others Deployment: Vercel (frontend) + Render (backend)

Technical Implementation

Backend Development (FastAPI)

# Core triage assessment endpoint
@app.post("/assess-symptoms")
async def assess_symptoms(request: TriageRequest):
    # Implement SIRS criteria and medical protocols
    # Multi-provider AI integration with intelligent fallback
    # Structured medical assessment with severity scoring

Key Backend Features:

  • RESTful API design with comprehensive error handling
  • Multi-provider AI architecture for reliability
  • Medical protocol integration (SIRS criteria)
  • Rate limiting and security measures
  • Health check endpoints for monitoring

Frontend Development (Next.js)

Component Architecture:

  • SymptomForm.tsx: Comprehensive symptom collection with validation
  • ResultsDisplay.tsx: Clear, color-coded triage results
  • UserProfile.tsx: Multi-step health profile management
  • TemperatureTracker.tsx: Interactive temperature logging
  • MedicineReminder.tsx: Smart notification system
  • Chatbot.tsx: AI-powered follow-up care

State Management:

  • React hooks for local state
  • localStorage for user data persistence
  • Real-time updates and responsive design

Prompt Engineering:

  • Medical-specific prompts with clinical protocols
  • Structured response formats for consistency
  • Safety-first approach with conservative recommendations

Development Workflow

  1. Requirements Analysis: Researched medical triage protocols and emergency criteria
  2. Architecture Design: Planned scalable, maintainable system structure
  3. Backend Implementation: Built robust API with medical protocol integration
  4. Frontend Development: Created intuitive, professional healthcare UI
  5. AI Integration: Implemented multi-provider system for reliability
  6. Testing & Refinement: Tested with various medical scenarios
  7. Deployment Configuration: Set up production-ready hosting

Challenges we ran into

Technical Challenges

1. AI Provider Reliability

Problem: Initial implementation used only OpenAI, which hit quota limits during development

Error 429: You exceeded your current quota

Solution: Built multi-provider AI architecture with intelligent fallback system

  • Google Gemini as primary provider
  • OpenAI, Hugging Face, and Ollama as backups
  • Dynamic provider testing and selection

2. Medical Protocol Integration

Problem: Ensuring AI responses align with actual medical triage protocols Solution:

  • Integrated SIRS (Systemic Inflammatory Response Syndrome) criteria
  • Structured prompts with medical decision trees
  • Conservative approach prioritizing patient safety

3. Model Configuration Issues

Problem: API errors due to incorrect model names and endpoints

Error 404: Model gemini-2.0-flash-thinking-exp not found

Solution:

  • Implemented dynamic model testing
  • Created fallback model hierarchy
  • Added comprehensive error handling

4. Professional UI Standards

Problem: Initial UI had excessive emojis and casual appearance inappropriate for healthcare Solution: Complete UI overhaul with medical-grade design principles

  • Removed all emojis and casual elements
  • Implemented professional color schemes
  • Added clear, clinical typography

Development Process Challenges

5. SSL Certificate Issues

Problem: Development environment SSL verification failures Solution: Implemented conditional SSL verification with secure production settings

6. State Management Complexity

Problem: Managing complex user profiles, temperature data, and medicine schedules Solution: Created modular state management with local Storage persistence


🎉 Accomplishments that we're proud of

Technical Achievements

1. Robust AI Integration

  • Multi-Provider Architecture: Built resilient system that never fails due to single AI provider issues
  • Medical Protocol Compliance: Successfully integrated SIRS criteria and clinical decision-making protocols
  • Intelligent Fallback: System automatically switches providers and adapts to API limitations

2. Production-Ready Application

  • Full-Stack Implementation: Complete end-to-end system from API to user interface
  • Deployment Configuration: Ready for immediate production deployment on Vercel and Render
  • Professional Healthcare UI: Medical-grade interface that builds trust and confidence

3. Advanced Healthcare Features

  • Comprehensive User Profiling: 4-step system capturing medical history, allergies, and emergency contacts
  • Temperature Tracking: Visual analytics for health monitoring and trend analysis
  • Smart Reminders: Browser-based notification system for medication management
  • AI Chatbot: Contextual follow-up care and continuous health monitoring

Healthcare Impact

4. Medically Sound Assessments

  • Evidence-Based Decisions: Triage recommendations based on established medical protocols
  • Safety-First Approach: Conservative recommendations that prioritize patient safety
  • Clear Action Plans: Specific, actionable guidance for each triage category

5. Accessibility and Usability

  • Intuitive Design: Easy-to-use interface for users of all technical levels
  • Educational Value: Demo cases that help users understand when to seek different levels of care
  • 24/7 Availability: Instant access to triage assessment without waiting for healthcare providers

Development Excellence

6. Code Quality and Architecture

  • Modular Design: Well-structured components that are maintainable and extensible
  • Error Handling: Comprehensive error management with user-friendly feedback
  • Type Safety: Full TypeScript implementation for robust development experience

📚 What we learned

Technical Learnings

1. AI Provider Diversity is Critical

Key Insight: Relying on a single AI provider creates significant reliability risks Implementation: Multi-provider architecture with intelligent fallback ensures 99.9% uptime Future Application: Always design systems with provider redundancy for production applications

2. Healthcare UI/UX Requires Different Standards

Key Insight: Medical applications need professional, trust-building interfaces Implementation: Removed casual elements, implemented clinical design principles Future Application: Industry-specific design considerations are crucial for user acceptance

3. Prompt Engineering for Medical Applications

Key Insight: Generic AI prompts don't provide reliable medical assessments Implementation: Structured prompts with medical protocols and safety guidelines Future Application: Domain-specific prompt engineering is essential for professional applications

Healthcare Domain Knowledge

4. Medical Triage Protocols

Learning: Understanding SIRS criteria and emergency warning signs Application: Integrated clinical decision-making processes into AI assessment Value: Ensures medically sound recommendations that align with healthcare standards

5. Patient Safety Considerations

Learning: Healthcare applications must prioritize safety over convenience Application: Conservative recommendations and clear emergency guidance Value: Builds trust and ensures patient wellbeing is never compromised

Development Process Insights

6. Iterative Development in Healthcare

Learning: Healthcare features require extensive testing and refinement Application: Built comprehensive demo cases and tested various medical scenarios Value: Thorough validation ensures reliable performance in real-world situations

Built with ❤️ for better healthcare accessibility

Built With

Share this project:

Updates