A comprehensive tool for validating and analyzing CLIF 2.1 data tables using clifpy with Table One generation.
All 18 CLIF 2.1 tables are supported:
- Core: Patient, Hospitalization, ADT
- Clinical: Code Status, Labs, Vitals, Patient Assessments, Patient Procedures, Hospital Diagnosis
- Respiratory: Respiratory Support, Position
- Medications: Medication Admin (Continuous & Intermittent)
- Microbiology: Culture, Non-culture, Susceptibility
- Devices: CRRT Therapy, ECMO_MCS
Prerequisites:
- Python 3.8+
- UV package manager (install instructions)
- CLIF 2.1 data in parquet format
Setup:
cd CLIF-TableOne
uv syncCreate or update config/config.json:
{
"site_name": "Your Hospital Name",
"tables_path": "/path/to/clif/data",
"filetype": "parquet",
"timezone": "America/Chicago"
}Run the complete analysis pipeline with sampling (recommended for first run):
uv run python run_project.py --sample --no-summary --get-ecdfThis command:
- Validates all 18 CLIF tables using a 1k ICU sample
- Collects MCIDE data
- Generates Table One analysis
- Computes ECDF bins for visualizations
- Automatically launches the Streamlit app
Time: ~10-15 minutes with sampling, 45-90 minutes without
Windows users should use the provided scripts that handle UTF-8 encoding:
Using Batch files:
run_project_windows.bat --sample --no-summary --get-ecdfUsing PowerShell:
.\run_project_windows.ps1 --sample --no-summary --get-ecdfIf you encounter Unicode/emoji display issues, see the Windows Troubleshooting section below.
To launch the Streamlit app independently:
uv run streamlit run app.pyThe app will open at http://localhost:8501
output/final/
├── reports/ # Validation PDF reports
│ ├── patient_validation_report.pdf
│ ├── combined_validation_report.pdf
│ └── ...
├── results/ # Validation CSV summaries
│ ├── patient_summary.csv
│ └── ...
├── tableone/ # Table One outputs
│ ├── table_one_overall.csv
│ ├── table_one_by_year.csv
│ ├── consort_flow_diagram.png
│ ├── execution_report.txt
│ ├── mcide/ # MCIDE value counts
│ ├── summary_stats/ # MCIDE numerical summaries
│ └── plots/ # Medication analysis plots
├── ecdf/ # ECDF distributions
│ ├── labs/
│ ├── vitals/
│ └── respiratory_support/
├── bins/ # Quantile bins for visualization
│ ├── labs/
│ ├── vitals/
│ └── respiratory_support/
└── configs/ # ECDF configuration files
- Install prerequisites and dependencies using
uv sync - Configure
config/config.jsonwith your site information - Ensure CLIF data files are in the specified
tables_path
- Verify paths and settings in config file
- Choose whether to use sampling for faster initial runs
- Run
run_project.pywith appropriate flags:uv run python run_project.py --sample --no-summary --get-ecdf - Monitor progress in the terminal
- Wait for automatic app launch or launch manually
- Validation Tab: Review validation results for each table
- mCIDE Tab: View mCIDE and summary stats if generated.
- Table One Results: Access comprehensive cohort analysis (appears after generation)
The feedback system allows classification of validation errors:
- Review Errors: Enable "📋 Review Status-Affecting Errors" in the Validation tab. Scroll to the bottom of the page.
- Classify Each Error:
- Accepted: Legitimate issue requiring attention
- Rejected: Site-specific variation (provide justification)
- Pending: Not yet reviewed
- Save Feedback: Click "💾 Save Feedback" to persist decisions
- Status Updates: Table status automatically adjusts based on feedback
- Status becomes "complete" only when ALL errors are rejected
- Accepted or pending errors maintain original status
Feedback is saved to output/final/results/{table}_validation_response.json.
To recompile the combined report after providing feedback, click the Regenerate reports button on the Home page.
After Table One generation completes:
- Click "📊 Table One Results" in the sidebar
- Explore analysis across tabs:
- Cohort: CONSORT diagram and cohort flow
- Demographics: Patient characteristics
- Medications: Medication usage analysis with visualizations
- IMV: Invasive mechanical ventilation metrics
- SOFA & CCI: Severity and comorbidity scores
- Hospice & Outcomes: End-of-life care and outcomes
See TABLEONE_VIEWER_GUIDE.md for detailed viewer documentation.
If you see encoding errors with emojis/Unicode characters:
# Command Prompt
set PYTHONIOENCODING=utf-8
python run_project.py
# PowerShell
$env:PYTHONIOENCODING="utf-8"
python run_project.py- Go to Settings → Time & Language → Language → Administrative language settings
- Click "Change system locale"
- Check "Beta: Use Unicode UTF-8 for worldwide language support"
- Restart your computer
python -X utf8 run_project.pyFor detailed command-line options, additional workflows, and advanced configurations, see advanced_usage.md.
For issues or questions, please create an issue in the project repository.