A comprehensive Streamlit-based web application for processing SmartCare Pro exports to generate HIV program indicators and clinical dashboards for HIV treatment programs.
This tool processes SmartCare Pro Excel exports to calculate key HIV program indicators following PEPFAR/WHO standards. It provides real-time analysis of treatment outcomes, viral load cascades, and patient management metrics to support clinical decision-making and program monitoring.
- TX_CURR - Current treatment status with age disaggregation (<15 and 15+ years)
- TX_PVLS - Viral load cascade (eligible, documented, suppressed) by age groups
- Retention Analysis - 6-month and 12-month retention rates
- Appointment Management - Missed, due, and upcoming appointment tracking
- SmartCare Pro Integration - Direct processing of ART Register and QAQI Report exports
- Data Validation - Automatic validation of column structures and data types
- Error Handling - Robust error handling for file operations and data processing
- Memory Optimization - Efficient processing of large datasets
- CSV Downloads - Export patient lists and summary reports
- Print-Friendly Reports - Formatted summary reports for clinical use
- Custom Styling - Consistent branding and professional appearance
- Python 3.8 or higher
- SmartCare Pro system access for data exports
- Clone the repository:
git clone <repository-url>
cd hiv-indicators-tool- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Run the application:
streamlit run app.py- Open your browser to
http://localhost:8501
-
Export from SmartCare Pro:
- Generate ART Register Report (Excel format)
- Generate QAQI Report (Excel format)
-
Upload to Tool:
- Use the file upload interface
- Files are automatically validated upon upload
-
Review Results:
- View calculated indicators in real-time
- Download patient lists and reports as needed
- Required Columns: Patient ID, TX_CURR status, demographics, ART start dates
- Format: Excel (.xlsx/.xls) with headers starting at row 7
- Content: Active patient treatment data
- Required Columns: TX_PVLS indicators (eligible, documented, suppressed)
- Format: Excel (.xlsx/.xls) with headers starting at row 5
- Content: Viral load testing and suppression data
hiv-indicators-tool/
├── app.py # Main Streamlit application
├── config/
│ ├── settings.py # Application settings
│ └── facility_config.py # Facility-specific configurations
├── processors/
│ ├── art_processor.py # ART Register data processing
│ └── qaqi_processor.py # QAQI Report data processing
├── utils/
│ ├── file_utils.py # File handling utilities
│ └── report_generator.py # Report generation functions
├── components/
│ └── ui_components.py # Reusable UI components
├── tests/
│ ├── test_processors.py # Unit tests for processors
│ └── test_utils.py # Unit tests for utilities
├── requirements.txt # Python dependencies
└── README.md # This file
- Line Length: Maximum 79 characters (PEP 8)
- Formatting: Use
blackfor code formatting - Linting: Use
flake8for code linting - Documentation: Google-style docstrings for all functions
- Framework: pytest for unit testing
- Coverage: Write tests for success and error scenarios
- Location: All tests in
/tests/directory - Execution: Run
pytestfrom project root
- Separation of Concerns: Business logic separate from UI code
- Modularity: Related functionality grouped in appropriate modules
- Error Handling: Comprehensive exception handling throughout
- Performance: Caching with
@st.cache_datafor data processing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Follow the development guidelines above
- Add tests for new functionality
- Ensure all tests pass (
pytest) - Format code with
blackand check withflake8 - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Data Protection: Patient data files are excluded from version control
- Local Processing: All data processing occurs locally
- No Data Storage: No patient data is stored by the application
- Secure Handling: Temporary files are automatically cleaned up
- File Upload Errors: Ensure Excel files match expected SmartCare Pro format
- Missing Columns: Verify export includes all required data columns
- Performance Issues: Use chunking for very large datasets (>10,000 patients)
For technical issues or feature requests, please open an issue in the repository.
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is designed for healthcare program monitoring and reporting purposes. It should not be used for individual patient care decisions. Always verify calculations and consult with clinical staff for patient management decisions. Ensure compliance with local data protection and privacy regulations.