A library for validating clinical data quality
Project description
🏥 Clinical Data Validator
Professional-grade clinical trial data validation and quality assurance toolkit
A comprehensive Python package and web application for validating clinical datasets with 10 specialized validators. Detect data quality issues, ensure compliance with clinical standards, and generate detailed validation reports.
🌟 Features
✅ 10 Specialized Clinical Validators
- Missing Critical Fields - Validates presence of required fields (patient_id, lab_value, visit_date)
- Invalid Data Types - Checks numeric fields contain numbers, dates are valid
- Future Dates Detection - Identifies dates in the future (configurable reference date)
- Out of Range Values - Validates clinical values against acceptable ranges
- Duplicate Records - Detects duplicate patient records
- Invalid Patient IDs - Ensures patient IDs follow correct format
- Missing Visit Data - Validates lab results have corresponding visit records
- Age Consistency - Verifies age matches birth date
- Gender-Based Validation - Checks gender-specific test validity
- Data Completeness - Ensures required fields for specific tests
🌐 Professional Web Dashboard
- Modern, intuitive interface with step-by-step workflow
- Drag-and-drop CSV upload
- Customizable validation - select only the validators you need
- Real-time results with color-coded pass/fail indicators
- Downloadable reports in CSV format
- Mobile-responsive design - works on any device
- No data leaves your server - 100% secure, runs locally
📦 Installation
Install from PyPI
\\ash pip install clinical-data-validators \\
For Web Dashboard
\\ash pip install clinical-data-validators flask \\
🚀 Quick Start
Using the Python Package
\\python import pandas as pd from clinical_validators import ( validate_missing_critical_fields, validate_invalid_data_types, validate_future_dates, validate_duplicate_records )
Load your clinical data
df = pd.read_csv('your_clinical_data.csv')
Run validators
result = validate_missing_critical_fields(df) print(result) \\
Using the Web Dashboard
-
Start the Flask application: \\ash python app.py \\
-
Open your browser: Navigate to \http://localhost:5000\
-
Upload your CSV file and select validators to run
-
View results and download the validation report
📸 Dashboard Screenshots
Upload Interface
Validation Results
Mobile Responsive
📊 Sample Validation Output
\\json { "filename": "clinical_data.csv", "total_records": 111, "validation_summary": { "missing_fields": { "status": "FAIL", "failed_records": 4 }, "invalid_data_types": { "status": "PASS", "failed_records": 0 } }, "detailed_results": { "missing_fields": { "status": "FAIL", "failed_records": 4, "failure_count": 6, "failures": [ { "row_index": 45, "field": "patient_id", "invalid_value": null, "error": "Missing required field" } ] } } } \\
📋 Requirements
- Python 3.7+
- pandas >= 1.3.0
- numpy >= 1.21.0
- Flask (for web dashboard)
🔧 Configuration
Custom Reference Date
For future dates validation, you can specify a custom reference date instead of using today's date. This is useful for validating historical data.
Validator Selection
The web dashboard allows you to select specific validators to run, saving time when you only need to check certain aspects of your data.
📚 API Reference
Core Functions
\\python
validate_missing_critical_fields(df, critical_fields=None)
\
Validates that critical fields are present and not null.
\\python
validate_invalid_data_types(df, date_fields=None)
\
Checks that numeric and date fields contain valid data types.
\\python
validate_future_dates(df, date_fields=None, reference_date=None)
\
Detects dates in the future based on reference date.
(And 7 more validators - see full documentation)
🧪 Testing
\\ash pytest tests/ -v \\
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
👨 Author
Navin Kumar
🙏 Acknowledgments
Built for clinical research data quality assurance.
📞 Support
For issues, questions, or feature requests, please open an issue on GitHub.
Version: 0.4.0
Last Updated: June 2026
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clinical_data_validators-1.0.0-py3-none-any.whl.
File metadata
- Download URL: clinical_data_validators-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aac32b0eadfd449b4a02a514eeb04ac3a7c6c7e50b75fa7e7df4698f7762ea46
|
|
| MD5 |
7520af22aef3340d510f3c6eeda65887
|
|
| BLAKE2b-256 |
3218794e21440020a054f61fad2a6f81329638c01fd9d67946ffa18503905756
|