ZayedShahcode/Health_Report_Parser

A modern, AI-powered web application that allows users to upload lab reports (PDF or images) and instantly see their health parameters extracted into a clean, interactive table with insights and trends.

★ 0Forks 0TypeScriptGitHub ↗Compare

Project website ↗

README

Korai Health - Lab Report Analyzer

A modern, AI-powered web application that allows users to upload lab reports (PDF or images) and instantly see their health parameters extracted into a clean, interactive table with insights and trends.

Features

✅ File Upload: Smooth drag-and-drop interface for PDF and image files ✅ OCR Processing: Uses Tesseract.js for text extraction from images and PDFs ✅ Data Extraction: Automatically extracts health parameters, values, units, and ranges ✅ Interactive Display: Clean, responsive table showing extracted health data ✅ Health Trends: Simulated historical data with interactive charts ✅ AI Insights: Flags abnormal values and provides actionable recommendations ✅ Modern UI: Beautiful dark theme with Tailwind CSS ✅ Responsive Design: Works perfectly on desktop and mobile devices

Tech Stack

  • Frontend: Next.js 15 with React 19
  • Styling: Tailwind CSS 4
  • OCR: Tesseract.js for text extraction
  • Charts: Recharts for data visualization
  • Icons: Lucide React
  • Language: TypeScript

Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

  1. Clone the repository:
git clone <repository-url>
cd korai_health
  1. Install dependencies:
npm install
  1. Run the development server:
npm run dev
  1. Open http://localhost:3000 in your browser.

How to Use

  1. Upload a Lab Report:

    • Drag and drop a PDF or image file onto the upload area
    • Or click to browse and select a file
    • Supported formats: JPEG, PNG, PDF
  2. Processing:

    • The app will automatically extract text using OCR
    • Health parameters will be identified and analyzed
    • Processing typically takes 10-30 seconds depending on file size
  3. View Results:

    • Health Parameters Table: Shows extracted values with status indicators
    • Health Trends: Interactive chart showing historical data
    • AI Insights: Recommendations for abnormal values

Sample Data

For testing purposes, you can use the sample lab report text file located at public/sample-lab-report.txt. This file contains common health parameters that the app can recognize and analyze.

Health Parameters Supported

The application currently recognizes and analyzes these health parameters:

  • Glucose (mg/dl)
  • Cholesterol (mg/dl)
  • Hemoglobin (g/dl)
  • Creatinine (mg/dl)
  • Sodium (mmol/l)
  • Potassium (mmol/l)
  • Calcium (mg/dl)
  • Vitamin D (mcg/dl)

Status Indicators

  • 🟢 Normal: Values within healthy range
  • 🟡 High/Low: Values outside normal range (attention needed)
  • 🔴 Critical: Values significantly outside normal range (immediate attention)

Development

Project Structure

korai_health/
├── app/
│   ├── layout.tsx          # Root layout with metadata
│   ├── page.tsx            # Main application component
│   └── globals.css         # Global styles
├── public/
│   └── sample-lab-report.txt  # Sample data for testing
├── package.json
└── README.md

Key Components

  • File Upload: Drag-and-drop interface with file validation
  • OCR Processing: Tesseract.js integration for text extraction
  • Data Parser: Extracts health parameters from OCR text
  • Results Display: Interactive table and charts
  • AI Insights: Status analysis and recommendations

Customization

To add support for new health parameters:

  1. Add the parameter name to the healthKeywords array in extractHealthData()
  2. Define normal ranges and status logic in the parsing function
  3. Update the historical data structure if needed

Security Features

  • Client-side processing (no data sent to external servers)
  • File type validation
  • Secure file handling
  • No sensitive data storage

Future Enhancements

  • User authentication and report history
  • More sophisticated NLP for better parameter extraction
  • Integration with health APIs
  • Export functionality (PDF, CSV)
  • Mobile app version
  • Real-time health monitoring

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

This project is licensed under the MIT License.

Support

For questions or support, please open an issue in the repository.

Contributors

ZayedShahcode

Issues