Serialisation utilities for OMOP CDM cohorts and CQI builder
Project description
OA Cohorts – Reporting & Cohort Execution Engine
This package provides the core machinery for defining, executing, and inspecting cohort-based reports over OMOP-style clinical data. It’s designed to support building real-world evidence reports from composable clinical rules, measures, cohorts, and indicators, with both programmatic APIs and lightweight HTML rendering for debugging and exploration.
The framework implemented here supports configuration-driven clinical quality indicators over OMOP-harmonised data, with explicit support for disease and treatment episodes, temporality, and combinatorial logic. Measures can be defined in terms of diagnoses, treatments, procedures, observations, measurements, and demographics, and composed into clinically interpretable cohorts and indicators.
This enables the same indicator definitions to support bulk benchmarking, trend analysis over time, and patient-level drill-down, without rewriting query logic for each use case. In practice, this provides a bridge between formal indicator specifications and the operational reality of multidisciplinary care.
At a high level, the system lets you:
- Define query rules (exact, hierarchical, scalar thresholds, phenotypes, etc.)
- Combine rules into subqueries
- Build measures from subqueries (including composite measures with AND/OR/EXCEPT logic)
- Group measures into dash cohorts and cohort definitions
- Define indicators (numerator/denominator pairs)
- Assemble everything into a report
- Execute the report against a database session and materialise results as in-memory member sets
- Inspect SQL, executability, and structure via HTML renderers (handy in notebooks)
This is intentionally object-centric: once a report is executed, all downstream payloads (cohort pivots, indicator pivots, demographics, etc.) are assembled from the object graph rather than re-querying the database.
What’s here (roughly)
Report / ReportCohortMap: Top-level report definition, linking cohorts and indicators.DashCohort / DashCohortDef: User-facing cohort groupings backed by executable measures.Measure / MeasureSQLCompiler / MeasureExecutor: The core executable units. Measures compile to SQL, execute against a session, and materialise member sets with dating and episode context.Indicator: Numerator/denominator semantics over measures, with temporal constraints.QueryRule (+ subclasses): The rule DSL: exact matches, hierarchies, exclusions, scalar thresholds, phenotypes, substring matches, etc.HTMLRenderable mixins: Lightweight visualisation of structure, SQL previews, and executability for debugging and exploration.
Execution model
report.execute(session)
report.assert_executed()
rows = report.members # all cohort members
indicators = report.indicators # now have numerator_members / denominator_members
Status
This is a working internal engine under active development. APIs may shift.
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 Distribution
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 oa_cohorts-0.3.0.tar.gz.
File metadata
- Download URL: oa_cohorts-0.3.0.tar.gz
- Upload date:
- Size: 30.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8691b8211d66e24d26045fb5f46008f058a5313c51a9f2a43ce264dfb7736d48
|
|
| MD5 |
dbbbda8372cee63162d836ea252e9a93
|
|
| BLAKE2b-256 |
2e829740c5dd3026fec13bc2ec01354ff573821ebf599bfffdb70791b2c1a78b
|
Provenance
The following attestation bundles were made for oa_cohorts-0.3.0.tar.gz:
Publisher:
pypi.yml on AustralianCancerDataNetwork/oa_cohort
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oa_cohorts-0.3.0.tar.gz -
Subject digest:
8691b8211d66e24d26045fb5f46008f058a5313c51a9f2a43ce264dfb7736d48 - Sigstore transparency entry: 1022474567
- Sigstore integration time:
-
Permalink:
AustralianCancerDataNetwork/oa_cohort@d2dd834f399c51eb1df4caa667c3dbed7e73900c -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/AustralianCancerDataNetwork
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@d2dd834f399c51eb1df4caa667c3dbed7e73900c -
Trigger Event:
release
-
Statement type:
File details
Details for the file oa_cohorts-0.3.0-py3-none-any.whl.
File metadata
- Download URL: oa_cohorts-0.3.0-py3-none-any.whl
- Upload date:
- Size: 42.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79688fca8fc743e3f78a6ddb1e4b16bbf0a39fde0d2cf4034ee80d329f2267f5
|
|
| MD5 |
738ee4af32d9b67a2a1af686f49dea2d
|
|
| BLAKE2b-256 |
ed4fd60415ab40360a2fce1b98cab555cec8f1adbd1e2c5e65b731e3aa2d6c61
|
Provenance
The following attestation bundles were made for oa_cohorts-0.3.0-py3-none-any.whl:
Publisher:
pypi.yml on AustralianCancerDataNetwork/oa_cohort
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oa_cohorts-0.3.0-py3-none-any.whl -
Subject digest:
79688fca8fc743e3f78a6ddb1e4b16bbf0a39fde0d2cf4034ee80d329f2267f5 - Sigstore transparency entry: 1022474644
- Sigstore integration time:
-
Permalink:
AustralianCancerDataNetwork/oa_cohort@d2dd834f399c51eb1df4caa667c3dbed7e73900c -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/AustralianCancerDataNetwork
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@d2dd834f399c51eb1df4caa667c3dbed7e73900c -
Trigger Event:
release
-
Statement type: