Data quality and characterization metrics for Cumulus
Project description
Data Metrics
A Cumulus-based implementation of the qualifier metrics.
Implemented Metrics
The following qualifier metrics are implemented (per December 2025 qualifier definitions).
- c_attachment_count
- c_content_type_use
- c_pt_count
- c_pt_deceased_count
- c_resource_count
- c_resources_per_pt
- c_system_use
- c_us_core_v6_count *
- q_date_recent
- q_ref_target_pop
- q_ref_target_valid
- q_system_use
- q_valid_us_core_v6 *
* These are US Core profile-based metrics, and the following profiles are not yet implemented:
- Implantable Device (due to the difficulty in identify implantable records)
- Some Observation profiles and also its various Vital Signs sub-profiles like Blood Pressure (just haven't gotten around to them yet)
Installing
pip install cumulus-library-data-metrics
Running the Metrics
These metrics are designed as a
Cumulus Library
study and are run using the cumulus-library command.
Local Ndjson
Let's say you have a collection of FHIR-formatted NDJSON files. They can all be in one folder or in organized subfolders.
Here's a sample command to run against that pile of NDJSON data:
cumulus-library build \
--db-type duckdb \
--database output-tables.db \
--load-ndjson-dir path/to/ndjson/root \
--target data_metrics
And then you can load output-tables.db in a DuckDB session and see the results.
Or read below to export the counts tables.
Visualization
The metrics can also be reviewed in an interactive web interface by installing and running the open source Cumulus Data Metrics Reporting Tool. When generating a metrics file for this view, the output-mode:aggregate flag should be used. E.g.,
cumulus-library build \
--option output-mode:aggregate \
--option min-bucket-size:0 \
--db-type duckdb \
--database src/data/metrics.duckdb \
--target data_metrics \
--load-ndjson-dir {path/to/ndjson/root}
Athena
Here's a sample command to run against your Cumulus data in Athena:
cumulus-library build \
--database your-glue-database \
--workgroup your-athena-workgroup \
--profile your-aws-credentials-profile \
--target data_metrics
And then you can see the resulting tables in Athena. Or read below to export the counts tables.
Exporting Counts
For the metrics that have exportable counts (the characterization metrics mostly),
you can easily export those using Cumulus Library,
by replacing build in the above commands with export ./output-folder.
Like so:
cumulus-library export \
./output-folder \
--db-type duckdb \
--database output-tables.db \
--target data_metrics
Aggregate counts
This study generates CUBE output by default.
If it's easier to work with simple aggregate counts of every value combination
(that is, without the partial value combinations that CUBE() generates),
run the build step with --option output-mode:aggregate.
That is, run it like:
cumulus-library build --option output-mode:aggregate ...
Bucket sizes
To help preserve privacy, this study ignores any count results of less than ten.
For example, if there are only two male patients that died at age 55,
that combination of male & 55 will be dropped from the c_pt_deceased_count table.
This makes it easier to share the count results with other institutions.
But if that's not a concern and you want the fine-grained details,
you can run the build step with --option min-bucket-size:0 to turn this feature off.
Or use another value to change the bucket threshold (the default value is 10).
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 cumulus_library_data_metrics-10.0.0.tar.gz.
File metadata
- Download URL: cumulus_library_data_metrics-10.0.0.tar.gz
- Upload date:
- Size: 87.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a94ce7a5875c90a33aea9b34b0a68b23ddbdd4ef264549d11b27b1198bececc2
|
|
| MD5 |
6724589a8bfaadb5e3621e0cae3a4647
|
|
| BLAKE2b-256 |
30484760a3d1891f79087ba3080de960d275a6e3a954f456cc948996601df97c
|
Provenance
The following attestation bundles were made for cumulus_library_data_metrics-10.0.0.tar.gz:
Publisher:
pypi.yaml on smart-on-fhir/cumulus-library-data-metrics
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cumulus_library_data_metrics-10.0.0.tar.gz -
Subject digest:
a94ce7a5875c90a33aea9b34b0a68b23ddbdd4ef264549d11b27b1198bececc2 - Sigstore transparency entry: 1084145651
- Sigstore integration time:
-
Permalink:
smart-on-fhir/cumulus-library-data-metrics@a9131ed6ae98b871e0335a4f8433ab0a70d72bf9 -
Branch / Tag:
refs/tags/v10.0.0 - Owner: https://github.com/smart-on-fhir
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@a9131ed6ae98b871e0335a4f8433ab0a70d72bf9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cumulus_library_data_metrics-10.0.0-py3-none-any.whl.
File metadata
- Download URL: cumulus_library_data_metrics-10.0.0-py3-none-any.whl
- Upload date:
- Size: 100.9 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 |
a79a53f3a3ea0e002fb2b01430e518b072c9dbb50e0e2ff46edce492eeae530d
|
|
| MD5 |
f62eb957cc65ec7f492458bf2afa1632
|
|
| BLAKE2b-256 |
fbfcaf000e6a0e60c42c5aa5a4f8b6989ea615887aa32266d1cdfd41bcbfe107
|
Provenance
The following attestation bundles were made for cumulus_library_data_metrics-10.0.0-py3-none-any.whl:
Publisher:
pypi.yaml on smart-on-fhir/cumulus-library-data-metrics
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cumulus_library_data_metrics-10.0.0-py3-none-any.whl -
Subject digest:
a79a53f3a3ea0e002fb2b01430e518b072c9dbb50e0e2ff46edce492eeae530d - Sigstore transparency entry: 1084145741
- Sigstore integration time:
-
Permalink:
smart-on-fhir/cumulus-library-data-metrics@a9131ed6ae98b871e0335a4f8433ab0a70d72bf9 -
Branch / Tag:
refs/tags/v10.0.0 - Owner: https://github.com/smart-on-fhir
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@a9131ed6ae98b871e0335a4f8433ab0a70d72bf9 -
Trigger Event:
release
-
Statement type: