A comprehensive web application designed for dialysis unit nurses to analyze blood test reports with AI-powered clinical insights.
This tool revolutionizes how dialysis units handle blood test analysis by combining automated PDF extraction, intelligent data parsing, and AI-powered clinical recommendations. Built by a dialysis nurse with software development aspirations, it bridges the gap between clinical needs and technology.
- 📄 Automated PDF Processing - Upload blood test PDFs and extract results instantly
- 🤖 AI Clinical Insights - Get intelligent analysis powered by Google Gemini AI
- 👤 Patient Information Extraction - Automatically detect age, name, and patient ID
- 🧪 Comprehensive Lab Analysis - Track 30+ blood markers with reference ranges
- 🧬 Serology Testing - Automated HIV, Hepatitis B/C result interpretation
- 📊 Dialysis Adequacy - KT/V and URR calculation with clinical targets
- 🔒 Rate Limiting - Built-in API protection (15 requests/minute)
- 💾 Secure & Private - No data storage, all processing in-memory
Clean, professional interface with automatic PDF processing:
- Upload blood test reports
- View extracted lab results
- Auto-detected patient information
- AI-powered clinical recommendations
Comprehensive clinical insights including:
- Critical findings identification
- Dialysis adequacy assessment
- Clinical recommendations
- Nursing considerations
| Component | Technology | Purpose |
|---|---|---|
| Frontend | Streamlit | Interactive web interface |
| PDF Processing | PyMuPDF (fitz) | Text extraction from PDFs |
| Data Analysis | Pandas | Lab result organization |
| AI Engine | Google Gemini API | Clinical insights generation |
| Rate Limiting | Custom Python class | API usage protection |
| Deployment | Streamlit Cloud | Free hosting |
- Renal function: Creatinine, Urea, Uric Acid
- Electrolytes: Sodium, Potassium, Calcium, Phosphate
- Liver function: ALT, AST, Bilirubin, Alkaline Phosphatase
- Hematology: Hemoglobin, WBC, Platelets
- Metabolic: Glucose, HbA1C, Cholesterol, Triglycerides
- Bone health: Parathyroid Hormone, Calcium, Phosphate
- Iron status: Serum Iron, Ferritin, TIBC, Saturation
- HIV antibody
- Hepatitis B (HBsAg, HBsAb, HBcAb)
- Hepatitis C antibody
- KT/V calculation (target ≥1.2)
- URR calculation (target ≥65%)
- Personalized recommendations
- ✅ Quick review of monthly blood work
- ✅ Identify critical values requiring immediate attention
- ✅ Track dialysis adequacy (KT/V, URR)
- ✅ Generate patient care recommendations
- ✅ Document serology status for infection control
- ✅ Standardize blood test review process
- ✅ Reduce time spent on manual calculations
- ✅ Improve consistency in patient assessment
- ✅ Support clinical decision-making
- ✅ Educational tool for new staff
- ✅ Better understand lab results
- ✅ Track health trends over time
- ✅ Prepare for doctor consultations
Simply visit: blood-reportkt-v.streamlit.app
- Python 3.12 or higher
- Google AI Studio API Key (free)
# Clone the repository
git clone https://github.com/USAGI7878/Blood-report_kt-v.git
cd Blood-report_kt-v
# Install dependencies
pip install -r requirements.txt
# Create secrets file
mkdir .streamlit
echo 'GOOGLE_API_KEY = "your-api-key-here"' > .streamlit/secrets.toml
# Run the app
streamlit run app.py- Visit: https://aistudio.google.com/app/apikey
- Click "Create API Key"
- Copy the key (starts with
AIza...) - Add to
.streamlit/secrets.toml
- Click "Browse files" or drag & drop
- Supported format: PDF with text (not image-only)
- The app automatically extracts all text
- Patient Information: Age, name, ID auto-detected
- Lab Results: 30+ markers with reference ranges
- Serology: HIV, Hep B/C status
- Abnormal Values: Marked with
*for easy identification
- Dialysis duration (hours)
- Ultrafiltration volume (L)
- Post-dialysis weight (kg)
- KT/V and URR calculated automatically
In the sidebar:
- Patient age (if not auto-detected)
- Known conditions (e.g., Diabetes, Hypertension)
- Current medications (e.g., Insulin, EPO)
- Click "🔍 Generate AI Analysis & Recommendations"
- Wait 5-10 seconds for AI processing
- Review comprehensive clinical insights:
- Critical Findings: Urgent issues
- Key Observations: Overall health picture
- Dialysis Adequacy: KT/V and URR assessment
- Clinical Recommendations: Actionable suggestions
- Nursing Considerations: Practical care tips
- ✅ No data storage - All processing in-memory
- ✅ No logs - Patient data not saved to disk
- ✅ Secure API - Keys stored in Streamlit secrets
- ✅ HIPAA considerations - Suitable for healthcare use
- ✅ Session-based - Data cleared when you close the browser
- 15 requests per minute per session
- Prevents API quota abuse
- Fair usage across multiple users
- Automatic reset every 60 seconds
This tool is designed to assist healthcare professionals, not replace clinical judgment.
- AI analysis is for informational purposes only
- Always verify with licensed physicians
- Do not use as sole basis for medical decisions
- Emergency situations require immediate medical attention
- Not a substitute for professional medical advice
Always consult with qualified healthcare providers for medical decisions.
- PDF upload and text extraction
- Automated lab result parsing
- Patient information extraction
- AI-powered clinical analysis
- KT/V and URR calculation
- Serology interpretation
- Rate limiting protection
- Multi-language support (English, Chinese, Malay)
- Trend analysis across multiple reports
- Export results to PDF/Excel
- Historical data comparison
- Custom reference ranges
- Mobile app version
- OCR for image-only PDFs
- Medication interaction checker
- Integration with hospital EMR systems
- Machine learning for pattern detection
- Automated lab ordering suggestions
- Patient portal for result access
- Multi-facility support
- Advanced analytics dashboard
Contributions are welcome! This project was created by a dialysis nurse learning software development.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- 🐛 Bug fixes and testing
- 📝 Documentation improvements
- 🌐 Translation to other languages
- 🎨 UI/UX enhancements
- 🧪 Additional lab test patterns
- 📊 Data visualization features
Blood-report_kt-v/
├── app.py # Main application
├── requirements.txt # Python dependencies
├── .streamlit/
│ └── secrets.toml # API keys (local only)
├── .gitignore # Git ignore rules
├── README.md # This file
└── .devcontainer/ # Dev container config
streamlit>=1.50.0- Web frameworkPyMuPDF>=1.26.5- PDF processingpandas>=2.3.3- Data manipulationgoogle-generativeai>=0.3.0- AI integration
class RateLimiter:
- Tracks requests per session
- Rolling 60-second window
- Prevents API abuse
- User-friendly countdown- Google Gemini API: 1,500 requests/day (FREE)
- Streamlit Cloud: Unlimited hosting (FREE)
- Total Cost: $0/month for typical usage
- Small clinic (10 patients/day): ~10 API calls/day
- Medium facility (50 patients/day): ~50 API calls/day
- Large unit (200 patients/day): ~200 API calls/day
All within free tier limits! 🎉
Q: "AI features disabled" message
A: Check your API key in Streamlit secrets. Get a new key from https://aistudio.google.com/app/apikey
Q: "No compatible models found"
A: You're using the wrong API key. Use Google AI Studio (not Google Cloud Console).
Q: PDF not extracting text
A: Your PDF might be image-only. Try using the debug section to check extracted text.
Q: Age/patient info not detected
A: The app looks for common patterns. You can manually enter the information in the sidebar.
Q: Rate limit reached
A: Wait 60 seconds. The limit resets every minute (15 requests/min).
- 🐛 Bug Reports: GitHub Issues
- 💡 Feature Requests: GitHub Discussions
- 📧 Direct Contact: Open an issue on GitHub
- Live App: https://blood-reportkt-v-6ekbavp3osoe8ajbit9ysh.streamlit.app/
- GitHub Repo: https://github.com/USAGI7878/Blood-report_kt-v
- Google AI Studio: https://aistudio.google.com/
- Streamlit Docs: https://docs.streamlit.io/
Created by a dialysis nurse in Malaysia passionate about:
- 🏥 Improving patient care through technology
- 💻 Learning software development
- 🌉 Bridging healthcare and tech
- 🚀 Building practical clinical tools
This project combines years of frontline dialysis experience with modern AI technology to solve real healthcare challenges.
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License - Free for personal and commercial use
- ✅ Use commercially
- ✅ Modify the code
- ✅ Distribute copies
- ✅ Private use
- ❌ No liability or warranty
- Google Gemini AI - For providing free AI capabilities
- Streamlit - For the amazing web framework
- PyMuPDF - For reliable PDF processing
- Dialysis Community - For inspiration and feedback
- Open Source Contributors - For dependencies and tools
If this tool helps your clinical practice:
- ⭐ Star this repository
- 🐛 Report bugs to help improve it
- 💡 Suggest features you'd like to see
- 📢 Share with colleagues who might benefit
Together, we can improve dialysis care worldwide! 🌍💙
Made with ❤️ by a Nurse who Codes