AI-Powered Healthcare Provider Validation with Interactive CALL/SMS Verification
Automatically validates provider credentials across multiple data sources using hybrid AI validation (Ollama LLM + deterministic rules), calculates realistic confidence scores, and provides interactive CALL/SMS-based verification for data corrections.
- Primary: Ollama CrewAI with LLM-powered intelligent analysis
- Fallback: Deterministic helper functions for 100% reliability
- Weighted Multi-Dimensional Scoring:
- Identity Match (25%) - Cross-source provider matching
- License Validity (20%) - Certification status check
- Location Accuracy (20%) - Phone/address verification
- Specialty Verification (15%) - Medical specialty confirmation
- Hospital Affiliation (10%) - Current affiliation check
- Data Consistency (10%) - Cross-source discrepancy detection
- Realistic Confidence Scores: 60%-95% range with penalty-based adjustments
- Smart questioning - asks only about mutable fields (address, hospital)
- Chat-style conversation display in frontend
- Real-time status updates
- DEMO_MODE - Limits CALL/SMS to you for safe demos (no charges!)
Validates against 5 independent data sources:
- NPI Registry - Provider identity and basic info
- License Registry - Certification status and expiration
- Hospital Roster - Affiliation and department
- Maps Listing - Practice location verification
- Clinic Website - HTML scraping for additional details
- Historical Data - Tracks changes in data
- Dashboard - System stats + Interactive WorldMap
- Directory - Provider search and filtering
- Provider Detail - Full validation breakdown with SMS conversation
- Bulk Outreach - CALL/SMS campaign management
- Drift Monitoring - Automated change detection
- Manual Review - Flagged records queue
- Activity Logs - Complete audit trail
- Interactive WorldMap with zoom/pan
- Pulsing markers for provider concentrations
- Regional statistics (West, Central, East, International)
- Hover effects with dynamic country colors
- Python 3.11+
- Node.js 18+
- Ollama (for AI validation)
- Conda (recommended)
-
Clone Repository
git clone <repository-url> cd provider_data_validation
-
Run Setup Script
# Windows scripts\install.bat # This will: # - Create conda environment # - Install Python dependencies # - Install frontend dependencies # - Set up Ollama model
-
Configure Environment
# Copy example and edit cp .env.example .env # Key settings: DEMO_MODE=true # Disable real SMS OLLAMA_MODEL=llama3.1:latest API_PORT=8000
-
Start System
# Windows scripts\start_system.bat # Starts: # - Backend API (port 8000) # - Frontend Dev Server (port 5173)
-
Access Application
- Frontend: http://localhost:5173
- API Docs: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
- Input Received - Provider name(optional - specialty, contact info)
- Ollama Crew - AI-powered analysis with context understanding
- Extract from Sources - Query 5 data sources with fuzzy matching
- Calculate Scores - Weighted scoring across 6 dimensions
- Apply Penalties:
- Missing sources: -5% each
- Data inconsistencies: -8% each
- Inactive license: -10%
- Location issues: -7%
- Add Variance - Β±2% deterministic randomness
- Final Confidence - 60%-95% realistic range
- Status Decision:
- β₯60%: VERIFIED
- 40-60%: PARTIALLY_VERIFIED
- <40%: UNVERIFIED
POST /validate # Validate single provider
POST /batch/validate # Validate multiple providers
GET /batch/{batch_id} # Check batch status
GET /providers # List validated providers
GET /providers/{id} # Get provider details
GET /stats # System statisticsPOST /verify/start # Initiate SMS verification
POST /verify/webhook # Twilio webhook handler
GET /verify/session/{id} # Check session status
GET /verify/history/{id} # Verification historyGET /health # System health checkcurl -X POST http://localhost:8000/validate \
-H "Content-Type: application/json" \
-d '{
"provider_name": "Dr. Aarav Mehta",
"phone": "+91 98765 43210",
"specialty": "Cardiology"
}'{
"provider_id": "uuid-here",
"provider_name": "Dr. Aarav Mehta",
"validation_status": "VERIFIED",
"confidence_scores": {
"overall_confidence": 0.87,
"identity_match": 0.95,
"license_validity": 1.0,
"contact_info_accuracy": 0.85,
"hospital_affiliation": 0.9,
"specialty_verification": 0.8
},
"sources_matched": ["npi", "license", "hospital", "maps"],
"issues": [],
"requires_manual_review": false
}# Ollama (AI Validation)
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=llama3.1:latest
# Demo Mode
DEMO_MODE=true # Set to false for production# Twilio Configuration
TWILIO_SID=your_account_sid
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_PHONE_NUMBER=+1234567890
NOTIFY_TO=+your_test_number # Fallback number for testing- Total Providers - System-wide count
- Issues Found - Flagged records
- Auto Updated - Successfully validated
- Needs Review - Manual attention required
- Avg Confidence - Overall quality score
- Interactive geography with zoom/pan
- Provider distribution by region
- Pulsing markers for concentrations
- Neon color effects on hover
- Regional statistics display
- Full validation breakdown
- Confidence scores by dimension
- Matched sources visualization
- SMS conversation display (demo mode)
- Verification history timeline
provider_data_validation/
βββ src/provider_data_validation/
β βββ api.py # FastAPI endpoints
β βββ services.py # Validation orchestration
β βββ models.py # Pydantic models
β βββ main.py # CLI entry point
β βββ crews/
β β βββ data_validation_crew/ # AI validation
β β βββ drift_monitoring_crew/ # Change detection
β β βββ notification_crew/ # Alerts
β βββ tools/
β βββ twilio_tools.py # SMS functionality
β βββ verification_service.py # SMS verification logic
β βββ verification_store.py # Session management
β βββ ocr_agent.py # Vision LLM OCR
β βββ file_processor.py # Document handling
βββ external_frontend/
β βββ src/
β βββ pages/ # Dashboard, Directory, etc.
β βββ components/ # StatCard, WorldMap, etc.
β βββ services/ # API client
βββ mock_data/ # Test data sources
β βββ npi_registry.json
β βββ license_registry.json
β βββ hospital_roster.json
β βββ maps_listing.json
β βββ clinic_website.html
βββ scripts/
βββ install.bat # Setup automation
βββ start_system.bat # Launch script
The system includes realistic mock data for testing:
- Dr. Aarav Mehta - Cardiology, 95% confidence (perfect match)
- Dr. Shalini Rao - Dermatology, 72% confidence (specialty mismatch)
- Dr. Vikram Singh - Orthopedics, 65% confidence (multiple issues)
- Dr. Priya Patel - Pediatrics, 78% confidence (minor discrepancies)
- Perfect Match - All sources agree, 90-95% confidence
- Minor Discrepancy - Phone format different, 80-89% confidence
- Specialty Mismatch - "Cardiology" vs "Interventional Cardiology", 70-79%
- Multiple Issues - Missing sources + data conflicts, 60-69%
- Failed Validation - Inactive license, <60% confidence
# Start Ollama service
ollama serve
# Pull required model
ollama pull llama3.1:latest
# Test
ollama run llama3.1:latest "Hello"cd external_frontend
rm -rf node_modules package-lock.json
npm install
npm run dev# Verify activated environment
conda activate crewai-env
# Reinstall dependencies
pip install -r requirements.txt- Hybrid Validation - Combining AI with deterministic fallbacks ensures reliability
- Realistic Scoring - Weighted dimensions + penalties + variance = believable results
- Demo Mode - Essential for hackathons to avoid charges and demonstrate functionality
- Phone Verification - Successful SMS delivery implicitly validates phone number
- Set
DEMO_MODE=false - Configure valid Twilio credentials
- Set up ngrok or production webhooks
- Migrate to persistent database (replace in-memory storage)
- Set up error monitoring (Sentry, etc.)
- Configure CORS for production domain
- Enable HTTPS
- Set up backup/restore procedures
- Backend: AWS EC2 / Azure VM / DigitalOcean
- Frontend: Vercel / Netlify
- Database: PostgreSQL for sessions/history
- SMS: Twilio with local number for target region
- Monitoring: Grafana + Prometheus
- API Docs: http://localhost:8000/docs (when running)
- Health Check: http://localhost:8000/health
β PRODUCTION READY FOR HACKATHON!
All features implemented, tested, and documented:
- β Hybrid AI + Rule-based validation
- β Interactive SMS verification (demo mode)
- β Beautiful React UI with WorldMap
- β Realistic confidence scoring (60-95%)
- β Multi-source data integration
- β Complete API documentation
- β Comprehensive testing
Built with CrewAI, FastAPI, React, and Ollama
Last Updated: December 13, 2025