This query is used to count the number of different distinct conditions (condition_concept_id) of all persons. The input to the query is a value for a concept identifier.
SELECT
COUNT(c.condition_concept_id)::integer conditions_count,
c.person_id
FROM @cdm.condition_occurrence c
WHERE condition_concept_id = $1
GROUP BY c.person_id
ORDER BY 1 DESC;
| Parameter | Example | Mandatory | Notes | | --- | --- | --- | --- | | condition_concept_id | 201820 | Yes | Condition concept identifier for 'Diabetes mellitus' |
| Field | Description | | --- | --- | | conditions_count | Number of conditions recorded for the person | | person_id | Person identifier |
| Field | Description | | --- | --- | | conditions_count | 39 | | person_id | 20017834818 |
https://github.com/OHDSI/CommonDataModel/wiki/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.