inst/QueryLibrary/Aggregate/condition_occurrence/CO11.md

CO11: Counts of persons with conditions

Description

This query is used to count the persons with any number of occurrences of a certain condition (condition_concept_id). The input to the query is a value of a condition_concept_id.

Query

SELECT
  COUNT(DISTINCT person_id)::integer AS persons_with_condition_count
FROM @cdm.condition_occurrence
WHERE condition_concept_id = $1
      AND person_id IS NOT NULL;

Input

| Parameter | Example | Mandatory | Notes| | --- | --- | --- | --- | | condition_concept_id | 31967 | Yes | Condition concept identifier for 'Nausea' |

Output

| Field | Description | | --- | --- | | persons_with_condition_count | Number of persons who had at least one occurrence of a certain condition. |

Example output record

| Field | Description | | --- | --- | | persons_with_condition_count | 2142100 |

Documentation

https://github.com/OHDSI/CommonDataModel/wiki/



sib-swiss/dsQueryLibraryServer documentation built on Feb. 13, 2025, 8:07 p.m.