Skip to content

nismail4/MTC_Hacks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Medical Worker Portal with AI X-ray Analysis

A comprehensive web-based medical portal that allows healthcare workers (doctors, nurses, radiologists) to access patient information and perform AI-assisted X-ray analysis with comparison capabilities.

Features

Authentication & Access Control

  • Secure login system for medical workers
  • Role-based access control (Doctor, Nurse, Radiologist)
  • Doctors can only access their assigned patients
  • Session management

Patient Management

  • 100 pre-generated fake patient records
  • Comprehensive patient demographics
  • Detailed medical history including:
    • Allergies
    • Chronic conditions
    • Current medications
    • Previous surgeries
    • Family medical history
    • Blood type

AI-Powered X-ray Analysis

  • HOPPR AI Integration: Analyzes chest X-rays using state-of-the-art radiology AI
  • Doctor Input: Doctors provide their own diagnosis and findings
  • Gemini AI Comparison: Automatically compares doctor's assessment with AI results
  • Agreement Analysis: Provides detailed comparison showing:
    • Agreement level (High/Medium/Low)
    • Key agreements and differences
    • Clinical significance
    • Recommendations for follow-up

Supported X-ray Conditions

The system includes sample DICOM images for:

  • Aortic enlargement
  • Atelectasis
  • Calcification
  • Cardiomegaly
  • Consolidation
  • Interstitial Lung Disease (ILD)
  • Infiltration
  • Lung Opacity
  • Normal studies
  • Pleural effusion
  • Pleural thickening
  • Pneumothorax
  • Pulmonary fibrosis

Installation

Prerequisites

  • Python 3.8 or higher
  • pip package manager

Setup Instructions

  1. Navigate to the project directory:

    cd c:\Users\nours\Downloads\hackathon
  2. Install required packages:

    pip install -r requirements.txt
  3. Generate fake patient data:

    python generate_fake_data.py

    This will create:

    • 20 doctors
    • 10 nurses
    • 5 radiologists
    • 100 patients with complete medical histories
  4. Start the web application:

    python app.py
  5. Access the portal: Open your web browser and navigate to:

    http://localhost:5000
    

Usage

Login Credentials

All accounts use the password: password123

Sample Doctor Logins:

  • Username: drsmith1, drjohnson1, drwilliams1, etc.

Sample Nurse Logins:

  • Username: nursebrown1, nursejones1, etc.

Sample Radiologist Logins:

  • Username: radgarcia1, radmiller1, etc.

Performing X-ray Analysis

  1. Login to the portal using your credentials
  2. Select a patient from the dashboard
  3. Click "New X-ray Analysis" button
  4. Enter your assessment:
    • Diagnosis
    • Clinical findings
    • Severity (mild/moderate/severe)
  5. Select a DICOM file from the available X-rays
  6. Click "Analyze with AI"
  7. Review the comparison between your assessment and the AI analysis

Understanding Results

The results page shows:

  • Your Assessment: Your diagnosis, findings, and severity rating
  • AI Analysis: HOPPR AI's diagnosis, findings, and confidence level
  • Gemini Comparison: Detailed comparison including:
    • Agreement percentage
    • Points of agreement
    • Key differences
    • Clinical significance
    • Recommendations

Project Structure

hackathon/
├── app.py                          # Main Flask application
├── generate_fake_data.py           # Data generation script
├── hoppr_integration.py            # HOPPR AI integration
├── gemini_comparison.py            # Gemini AI comparison logic
├── requirements.txt                # Python dependencies
├── templates/                      # HTML templates
│   ├── base.html                   # Base template
│   ├── login.html                  # Login page
│   ├── dashboard.html              # Main dashboard
│   ├── patient_detail.html         # Patient information
│   ├── analyze_xray.html           # X-ray analysis form
│   └── analysis_result.html        # Analysis results
├── HackathonSampleDICOMImages/     # DICOM image files
└── medical_portal.db               # SQLite database (created after setup)

Database Schema

MedicalWorker

  • Login credentials
  • Full name, role, department
  • Relationship to patients

Patient

  • Demographics (age, sex, blood type)
  • Medical history
  • Assigned doctor

XRayAnalysis

  • Doctor's assessment
  • AI analysis results
  • Gemini comparison data
  • Timestamps and file references

API Keys

The application uses the following APIs:

  • HOPPR AI: For chest X-ray analysis
  • Gemini AI: For comparing doctor and AI assessments

API keys are configured in:

  • classification_demo_single.py: Contains both API keys
  • hoppr_integration.py: HOPPR API key
  • gemini_comparison.py: Gemini API key

Security Notes

  • This is a demonstration/educational project
  • Passwords are simplified for demo purposes
  • In production, use proper password hashing and environmental variables
  • Implement proper HIPAA compliance for real medical data
  • Use HTTPS for all communications
  • Store API keys securely

Technologies Used

  • Backend: Flask, SQLAlchemy
  • Frontend: Bootstrap 5, Bootstrap Icons
  • AI/ML:
    • HOPPR AI (Medical imaging analysis)
    • Google Gemini (Natural language comparison)
  • Medical Imaging: pydicom for DICOM file handling
  • Database: SQLite

Demo Workflow Example

  1. Login as drsmith1 / password123
  2. View your assigned patients on the dashboard
  3. Click on a patient (e.g., "John Doe")
  4. Review patient's medical history
  5. Click "New X-ray Analysis"
  6. Enter your diagnosis:
    • Diagnosis: "Pleural effusion, moderate"
    • Findings: "Blunting of right costophrenic angle with opacity in lower right lung field"
    • Severity: "moderate"
  7. Select a DICOM file from the Pleural_effusion folder
  8. Click "Analyze with AI"
  9. Review the detailed comparison showing agreement/differences

Troubleshooting

Database not found:

python generate_fake_data.py

Port 5000 already in use: Edit app.py and change:

app.run(debug=True, host='0.0.0.0', port=5001)

Missing dependencies:

pip install -r requirements.txt --force-reinstall

Future Enhancements

  • Real-time DICOM viewer
  • Export analysis reports to PDF
  • Multi-factor authentication
  • Advanced search and filtering
  • Audit logging
  • Integration with hospital information systems
  • Support for additional imaging modalities (CT, MRI)

License

This is an educational/demonstration project for the hackathon.

Contact

For questions or issues, please refer to the project documentation.

About

MTC_Hacks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •