| Most prevalent conditions within a number of days of death
The following is a sample run of the query. The input parameters are highlighted in blue
SELECT concept_name, COUNT(*)::integer as conditions_count
FROM (
SELECT d.person_id, c.concept_name
FROM @cdm.death d
JOIN @cdm.condition_era ce
ON ce.person_id = d.person_id
AND (d.death_date - ce.condition_era_end_date) <= COALESCE(CAST(NULLIF($1, '') AS numeric), 30)
JOIN @vocab.concept c
ON c.concept_id = ce.condition_concept_id
) TMP
GROUP BY concept_name
ORDER BY conditions_count DESC;
| Parameter | Example | Mandatory | Notes | | --- | --- | --- | --- | | Number of days since condition era end | 30 | No | |
| Field | Description | | --- | --- | | concept_name | An unambiguous, meaningful and descriptive name for the concept | | count | | | condition_concept_id | A foreign key that refers to a standard condition concept identifier in the vocabulary. |
https://github.com/OHDSI/CommonDataModel/wiki/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.