From 3aa7054b82d107483eb8c5f60d5dec05ecf220ea Mon Sep 17 00:00:00 2001 From: Calum Macdonald Date: Tue, 18 Aug 2026 10:45:19 +0100 Subject: [PATCH 1/2] enabling death support --- website/pages/bunny/config.mdx | 1 + .../pages/bunny/deployment/requirements.mdx | 3 ++ website/pages/concepts/availability.mdx | 49 +++++++++++++++++++ 3 files changed, 53 insertions(+) diff --git a/website/pages/bunny/config.mdx b/website/pages/bunny/config.mdx index 04b8bf8..192b97d 100644 --- a/website/pages/bunny/config.mdx +++ b/website/pages/bunny/config.mdx @@ -70,6 +70,7 @@ The database connection is configured by the variables prefixed with `DATASOURCE | `DATASOURCE_DB_DRIVERNAME` | `"postgresql,mssql,duckdb,snowflake-connector-python"` | Database dialect | `postgresql` | | `OMOP_SPECIMEN_ENABLED` | 'boolean' | Specifies whether to enable searching on the Specimen table. Available from 1.7 | `false` | | `OMOP_LOCATION_ENABLED` | 'boolean' | Enable support for filtering by geo-radius against the OMOP Location table. Available from v1.8 | `false` | +| `OMOP_DEATH_ENABLED` | 'boolean' | Enable support for querying the OMOP Death table. Available from v1.9 | `false` | ### Managed Identity diff --git a/website/pages/bunny/deployment/requirements.mdx b/website/pages/bunny/deployment/requirements.mdx index e6e84f4..188947b 100644 --- a/website/pages/bunny/deployment/requirements.mdx +++ b/website/pages/bunny/deployment/requirements.mdx @@ -50,6 +50,7 @@ Optional tables set by configuration: |------------|------------------------------------------------------------|----------------| | Specimen | specimen_id, person_id, specimen_concept_id, specimen_date | v1.7 onwards | | Location | location_id, latitude†, longitude† | v1.8 onwards | +| Death | person_id, death_date, cause_concept_id‡ | v1.9 onwards | Location is joined via `person.location_id` → `location.location_id`. @@ -57,6 +58,8 @@ _*Not included in the HDR Gateway minimum data model._ _†`latitude` and `longitude` were added to the Location table in OMOP CDM v5.4 — a v5.3 database cannot use the geo-radius filter._ +_‡`cause_concept_id` is nullable — only required if you want to filter by a specific cause of death rather than death alone._ + The following indexes are also recommended from the CDM to ensure queries are processed quickly. | OMOP Table | Recommended Indexes | diff --git a/website/pages/concepts/availability.mdx b/website/pages/concepts/availability.mdx index 95a6eca..0d5de00 100644 --- a/website/pages/concepts/availability.mdx +++ b/website/pages/concepts/availability.mdx @@ -147,6 +147,55 @@ recorded latitude/longitude are never matched. This example matches patients within 5km of central London. Set `"oper": "!="` to exclude patients within the radius instead. +## Death filtering + +`varcat: "Death"` filters patients by whether, and how, they died, using the OMOP `death` table. It +must be enabled with `OMOP_DEATH_ENABLED` (see [Configuration](/bunny/config#database)). + +`type: "TEXT"` is used for all Death rules. The `value` field is optional — leave it empty to match +on the presence of a death record at all, or set it to an OMOP concept ID to match a specific cause +of death (`death.cause_concept_id`). + +**Deceased patients (any cause):** + +```json +{ + "varname": "OMOP", + "varcat": "Death", + "type": "TEXT", + "oper": "=", + "value": "" +} +``` + +**Living patients** — set `"oper": "!="` with an empty `value` to match patients with *no* death record: + +```json +{ + "varname": "OMOP", + "varcat": "Death", + "type": "TEXT", + "oper": "!=", + "value": "" +} +``` + +**Specific cause of death** — set `value` to a concept ID to match patients whose recorded cause of +death is that concept: + +```json +{ + "varname": "OMOP", + "varcat": "Death", + "type": "TEXT", + "oper": "=", + "value": "4329847" +} +``` + +Combine a Death rule with rules from other varcats in the same group (`rules_oper: "AND"`) to find, +for example, deceased patients who also have a specific condition recorded. + ## Response Schema Bunny returns a structured JSON response upon completing an Availability Query. From 0be7404eafa60110d3f32907bf7e4305526a9fb7 Mon Sep 17 00:00:00 2001 From: Calum Macdonald Date: Tue, 18 Aug 2026 10:47:35 +0100 Subject: [PATCH 2/2] fix comment --- website/pages/bunny/deployment/requirements.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/pages/bunny/deployment/requirements.mdx b/website/pages/bunny/deployment/requirements.mdx index 188947b..d0aa2f3 100644 --- a/website/pages/bunny/deployment/requirements.mdx +++ b/website/pages/bunny/deployment/requirements.mdx @@ -58,7 +58,7 @@ _*Not included in the HDR Gateway minimum data model._ _†`latitude` and `longitude` were added to the Location table in OMOP CDM v5.4 — a v5.3 database cannot use the geo-radius filter._ -_‡`cause_concept_id` is nullable — only required if you want to filter by a specific cause of death rather than death alone._ +_‡`cause_concept_id` is nullable — only required to allow filtering by specific causes of death, without this, Bunny is still able to query on any death record._ The following indexes are also recommended from the CDM to ensure queries are processed quickly.