CORR-Vars Logo

CORR-Variables

Streamlining clinical research with real-world data

🚀 What is CORR-Vars?

CORR-Variables is a Python package for building clinical study cohorts from ICU and hospital data sources, developed by the Charité Outcomes Research Repository (CORR) team.

It functions as a high-level connector on top of a data source, preprocessing raw clinical data into clinically meaningful, quality-checked variables whose definitions are served and versioned by the CORR Concepts API, to streamline research with real-world data.

🏥 Clinical Focus

Pre-defined clinical variables validated by medical experts

⚡ High Performance

Built on Polars for fast processing of large datasets

🔗 Easy Integration

Simple API that works with existing analysis workflows

Quick Start#

uv add corr-vars

Requires Python ≥ 3.10.

Variable definitions are served by the CORR Concepts API. A cohort needs a project and a key:

export CORR_CONCEPTS_API_KEY="corr_..."

The project is passed per cohort: Cohort(project="my_project").

Your First CORR Cohort#

Get started in under 5 minutes:

# Import the main class
from corr_vars import Cohort

# Create your first cohort
cohort = Cohort(
    obs_level="icu_stay",
    sources={"reprodicu": {"path": "/path/to/reprodICU_files"}},
    project="my_project",
)

# Add clinical variables
cohort.add_variable("age_on_admission")
cohort.add_variable("blood_sodium")

# View your data
print(f"Cohort: {len(cohort.obs)} patients")
print(cohort.obs.head())

🧪 Try it with the demo dataset

No data access yet? The Tutorial: a first study on the Charité demo dataset tutorial runs a complete study on a public, fully synthetic ICU dataset (20’000 ICU stays) with the public demo Concepts API, no account needed. To run it yourself, download the quickstart notebook.

🎯 Next Steps

Documentation Structure#

📚 Learning Resources
  • Getting Started Tutorial - Your first analysis in 30 minutes

  • Custom Variables Guide - Create your own clinical variables

  • Contributing Guide - Add variables to the community catalog

  • Troubleshooting - Solutions for common issues

Tutorials and Getting Started
🔧 API Documentation
  • Cohort Class - Main interface for building cohorts

  • Variable Types - Native, derived, and aggregation variables

  • Data Sources - ReprodICU, the local source skeleton, and the source plugin system

  • Legacy Interface - Pandas compatibility layer

Cohort
📖 Complete Table of Contents

Learning Resources

Core Architecture#

🏥 Observation Levels

Choose your analysis unit:

  • Patient - One row per unique patient (patient_id)

  • Hospital Stay - Complete hospitalization periods (case_id)

  • ICU Stay - Individual intensive care episodes (icu_stay_id)

  • Procedure - Specific surgical/medical procedures (procedure_id)

_images/cv_obs_levels.png
📊 Variable Types

Rich clinical data hierarchy:

  • Native - Direct database extractions

  • Derived - Computed from existing variables

  • Static - Single values per observation

  • Dynamic - Time-series measurements

_images/cv_var_hierarchy.png

🔍 Explore Available Variables

Browse our 300+ pre-defined clinical variables in the interactive Concept Browser

Real-World Example#

Here’s how researchers use CORR-Vars for clinical studies:

# Build an ICU sepsis cohort
cohort = Cohort(
    obs_level="icu_stay",
    sources={"reprodicu": {"path": "/path/to/reprodICU_files"}},
    project="my_project",
)


# Add a static variable
cohort.add_variable("sofa_score_imputed")

# Add time-series biomarkers
cohort.add_variable("blood_lactate")
cohort.add_variable("blood_creatinine")

# Apply inclusion criteria
cohort.include_list([
    {"variable": "age_on_admission", "operation": ">= 18", "label": "Adults"},
    {"variable": "sofa_score_imputed", "operation": ">= 2", "label": "Organ dysfunction"}
])

# Generate publication-ready summary
table1 = cohort.tableone(groupby="inhospital_death")
print(f"Study cohort: {len(cohort.obs)} patients")

📈 Publication Ready

CORR-Vars concepts are quality-checked by attending physicians at Charité Berlin before being used for:

  • Critical care outcomes research

  • Machine learning model development

  • Health services research

  • Quality improvement studies

Community & Support#

🐛 Found a Bug?

Report issues or request features on GitHub

https://github.com/CUB-CORR/corr_vars/issues
💬 Need Help?

Check our Troubleshooting Guide guide or contact the team

🤝 Want to Contribute?

Add new variables to help the research community

Contributing New Variables

—

🏥 Developed at Charité Berlin

Advancing clinical research through innovative data science tools

Development Team:

…and the entire CORR team 🙏

📊 Project Stats

  • 🏥 Version: 2.1.1

  • 📅 Active Development: Since September 2024

  • 📈 Publications: 10+ active projects pending publication

  • 👥 Users: Research teams across Charité departments with a focus on critical care outcomes research

  • 🔗 GitHub: CORR-Vars Repository