A comprehensive AI-powered system for medical prescription verification, drug interaction detection, age-specific dosage recommendations, and NLP-based prescription parsing.
- Drug Interaction Detection: Check for dangerous drug-drug interactions using multiple medical databases
- Age-Specific Dosage: Calculate appropriate dosages based on patient age, weight, and medical conditions
- NLP Prescription Parser: Extract structured information from prescription text using Ollama (granite3.2-vision model) and Google Gemini AI
- Alternative Medication Finder: Suggest safer alternatives when contraindications exist
- Interactive Dashboard: User-friendly Streamlit interface for healthcare professionals
- FastAPI: High-performance API framework
- SQLite/PostgreSQL: Database for caching and storage
- Ollama: Primary NLP processing (using granite3.3:2b model)
- Google Gemini AI: Fallback AI processing
- RxNorm API: Drug terminology and interactions
- OpenFDA: Adverse event data
- Streamlit: Interactive web interface
- Plotly: Data visualizations
- Pandas: Data manipulation
- Requests: API communication
- Python 3.8+
- Docker (for containerized deployment)
- Ollama (for local AI processing) with granite3.3:2b model
# Clone the repository
git clone <repository-url>
cd ibm-project
# Build and run with Docker Compose
docker-compose up --build- Backend Setup
cd backend
python -m venv venv
# On Windows: venv\Scripts\activate
# On Unix/MacOS: source venv/bin/activate
pip install -r requirements.txt- Frontend Setup
cd frontend
python -m venv venv
# On Windows: venv\Scripts\activate
# On Unix/MacOS: source venv/bin/activate
pip install -r requirements.txt- Environment Configuration
cp .env.example .env
# Edit .env with your API keys- Ollama Setup
# Install Ollama from https://ollama.com/
# Pull the granite3.3:2b model
ollama pull granite3.3:2b# Build and run with Docker Compose
docker-compose up --build
# Access the application:
# Frontend: http://localhost:8501
# Backend API: http://localhost:8000
# API Documentation: http://localhost:8000/docs- Start Backend
cd backend
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000- Start Frontend
cd frontend
streamlit run streamlit-frontend.py --server.port 8501- Access Application
- Frontend: http://localhost:8501
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
The system provides RESTful APIs for all functionality:
POST /api/check-interactions- Check drug interactionsGET /api/interaction-details/{drug1}/{drug2}- Get interaction details
POST /api/age-dosage- Calculate age-specific dosageGET /api/dosage-guidelines/{drug_name}- Get dosage guidelines
POST /api/parse-prescription- Parse prescription textPOST /api/extract-entities- Extract medical entities
POST /api/alternative-drugs- Find alternative medicationsGET /api/drug-classes/{drug_name}- Get drug therapeutic classes
- HIPAA Considerations: The system is designed with healthcare compliance in mind
- Data Encryption: All sensitive data is encrypted at rest and in transit
- Access Controls: API authentication and authorization
- Audit Logging: Comprehensive logging for compliance tracking
# Run backend tests
cd backend
pytest tests/
# Run frontend tests
cd frontend
pytest tests/The system includes built-in monitoring and analytics:
- API usage metrics
- Error tracking and logging
- Performance monitoring
- User interaction analytics
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
- Ollama for local AI processing with granite3.3: model
- Google for Gemini AI
- OpenFDA for adverse event data
- RxNorm for drug terminology
For support and questions:
- 🐛 Issues: GitHub Issues
Disclaimer: This system is intended for educational and research purposes only. It should not be used as the sole basis for medical decisions. Always consult qualified healthcare professionals for medical advice.