Skip to content

Developed an AI-powered health information platform using Python, Streamlit, and Perplexity AI to provide trusted medical insights with features like symptom analysis, drug interaction checks, and medical translation, ensuring privacy compliance and cross-platform deployment.

Notifications You must be signed in to change notification settings

coder-royswarnajit/Dr-Home

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Dr. Home - AI-Powered Health Information Platform

Dr. Home Python Streamlit Perplexity AI

๐Ÿฅ Overview

Dr. Home is an AI-powered health information platform that provides evidence-based medical information from trusted sources. Built with Streamlit and powered by Perplexity AI, it offers a user-friendly interface for exploring symptoms, checking drug interactions, translating medical terms, and accessing health resources.

โš ๏ธ Important Medical Disclaimer

This platform is for educational purposes only and does not replace professional medical advice.

  • Always consult healthcare professionals for medical concerns
  • In emergencies, call your local emergency number immediately
  • This information should not be used for self-diagnosis or treatment
  • Drug interactions shown are for reference only - consult your pharmacist or doctor

โœจ Features

๐Ÿ” Symptom Explorer

  • Get evidence-based information about symptoms from trusted medical sources
  • Advanced filtering by age group, severity, and duration
  • Comprehensive information including causes, red flags, and when to seek care

๐Ÿ’Š Drug Interaction Checker

  • Check potential interactions between medications
  • Support for multiple drug combinations
  • Detailed interaction analysis with severity ratings
  • Clinical management recommendations

๐Ÿฅ Medical Translator

  • Term Lookup: Translate complex medical terms into understandable language
  • Document Translation: Convert medical reports into patient-friendly language
  • Simple definitions with pronunciation guides
  • Context and related terms

๐Ÿ“š Health Resources

  • Curated list of trusted medical sources (NIH, WHO, CDC, Mayo Clinic)
  • Emergency contact information
  • Health calculators (BMI, Heart Rate Zones)
  • Links to official health resources

๐Ÿš€ Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/dr-home.git cd dr-home
  2. Install dependencies:

    pip install -r requirements.txt
  3. Run the application:

    streamlit run app.py

    Or using the main entry point:

    streamlit run main.py
  4. Configure API Key:

    • Open the application in your browser
    • Enter your Perplexity API key in the sidebar
    • Start exploring health information!

๐Ÿ“ Project Structure

dr-home/ โ”œโ”€โ”€ .gitattributes # Git configuration โ”œโ”€โ”€ README.md # This file โ”œโ”€โ”€ requirements.txt # Python dependencies โ”œโ”€โ”€ config.py # Configuration settings โ”œโ”€โ”€ api_service.py # Perplexity API service โ”œโ”€โ”€ app.py # Main application (legacy) โ”œโ”€โ”€ main.py # Main application entry point โ”œโ”€โ”€ styles.py # CSS styles โ”œโ”€โ”€ utils.py # Utility functions โ””โ”€โ”€ pages/ # Page modules โ”œโ”€โ”€ __init__.py # Package initialization โ”œโ”€โ”€ symptom_explorer.py # Symptom exploration functionality โ”œโ”€โ”€ drug_interaction.py # Drug interaction checker โ”œโ”€โ”€ medical_translator.py # Medical term translator โ””โ”€โ”€ health_resources.py # Health resources and calculators 

๐Ÿ”ง Configuration

API Configuration

The application requires a Perplexity AI API key. You can configure it through:

  • The sidebar in the web interface (recommended)
  • Environment variables (for deployment)

Trusted Medical Sources

The platform queries information from trusted sources including:

  • PubMed/MEDLINE articles
  • NIH (National Institutes of Health)
  • WHO (World Health Organization)
  • CDC (Centers for Disease Control)
  • Mayo Clinic
  • WebMD
  • Medical journals and peer-reviewed research

๐Ÿ› ๏ธ Development

Code Structure

The application follows a modular architecture:

  • config.py: Central configuration management
  • api_service.py: Perplexity API integration with specialized medical queries
  • styles.py: Custom CSS styling
  • utils.py: Utility functions for common tasks
  • pages/: Individual page modules for different features

Key Components

PerplexityService Class

from api_service import PerplexityService service = PerplexityService(api_key) result = service.query_symptom("headache")

Styling System

Custom CSS classes for consistent UI:

  • .main-header: Application header
  • .warning-box: Medical disclaimers
  • .symptom-card: Symptom information display
  • .drug-warning: Drug interaction alerts
  • .source-citation: Source references

๐Ÿ“Š Features in Detail

Symptom Explorer

  • Input: Symptom description
  • Filters: Age group, severity level, duration
  • Output: Medical definition, causes, red flags, diagnostic approaches

Drug Interaction Checker

  • Input: Multiple medications
  • Analysis: Major, moderate, and minor interactions
  • Output: Severity ratings, mechanisms, management recommendations

Medical Translator

  • Term Lookup: Individual medical terms
  • Document Translation: Full medical reports
  • Output: Patient-friendly explanations with context

Health Resources

  • Calculators: BMI, Heart Rate Zones
  • Emergency Contacts: Region-specific emergency numbers
  • Trusted Sources: Direct links to official health resources

๐Ÿ”’ Privacy & Security

  • No personal health information is stored
  • API keys are handled securely through session state
  • All queries are processed through Perplexity's secure API
  • No data persistence beyond the current session

๐ŸŒ Deployment

Local Development

streamlit run main.py

Streamlit Cloud

  1. Push to GitHub repository
  2. Connect to Streamlit Cloud
  3. Configure API key in secrets
  4. Deploy automatically

Docker (Optional)

FROM python:3.9-slim WORKDIR /app COPY requirements.txt . RUN pip install -r requirements.txt COPY . . EXPOSE 8501 CMD ["streamlit", "run", "main.py"]

๐Ÿ“ˆ Usage Statistics

The application tracks basic usage statistics:

  • Number of queries made per session
  • Feature usage patterns
  • No personal data collection

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Guidelines

  • Follow Python PEP 8 style guidelines
  • Add docstrings to all functions
  • Include appropriate error handling
  • Test with various medical scenarios
  • Ensure medical accuracy and appropriate disclaimers

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

โšก Performance & Limitations

Rate Limits

  • Perplexity API has rate limits based on your plan
  • The application tracks query usage
  • Consider implementing caching for repeated queries

Response Time

  • Typical response time: 2-5 seconds
  • Depends on query complexity and API response time
  • Loading indicators provide user feedback

๐Ÿ†˜ Support & Troubleshooting

Common Issues

  1. API Key Not Working

    • Verify API key is correct
    • Check Perplexity AI account status
    • Ensure sufficient API credits
  2. Slow Response Times

    • Normal for complex medical queries
    • Check internet connection
    • Perplexity API may have temporary delays
  3. Missing Information

    • Try rephrasing the query
    • Use more specific medical terms
    • Check if the topic is covered by trusted sources

Getting Help

  • Check the Issues page
  • Review Perplexity AI documentation
  • Contact support through GitHub issues

๐Ÿ”ฎ Future Enhancements

  • Multi-language support
  • Offline medical reference database
  • Integration with more medical APIs
  • User account system for query history
  • Mobile app version
  • Voice input for accessibility
  • PDF report generation
  • Integration with telehealth platforms

๐Ÿ“ž Emergency Contacts

  • US Emergency: 911
  • EU Emergency: 112
  • US Poison Control: 1-800-222-1222
  • US Mental Health Crisis: 988

๐Ÿ™ Acknowledgments

  • Perplexity AI for providing the AI-powered search capabilities
  • Streamlit for the excellent web framework
  • Medical community for trusted health information sources
  • Open source contributors who make projects like this possible

Remember: This tool is designed to complement, not replace, professional medical advice. Always consult with healthcare professionals for medical concerns.

About

Developed an AI-powered health information platform using Python, Streamlit, and Perplexity AI to provide trusted medical insights with features like symptom analysis, drug interaction checks, and medical translation, ensuring privacy compliance and cross-platform deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages