inst/QueryLibrary/Aggregate/observation_period/OP01.md

OP01: Count number of people who have at least one observation period in the database that is longer than 365 days.

Description

Query

SELECT COUNT(DISTINCT person_ID)::integer AS NUM_persons
FROM @cdm.observation_period op
WHERE (op.observation_period_END_DATE - op.observation_period_START_DATE) >= 365;

Input

None

Output

| Field | Description | | --- | --- | | Num_Persons | Number of patients who have at least one observation period in the database that is longer than 365 days |

Example output record

| Field | Value | | --- | --- | | Num_Persons | 105119818 |

Documentation

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



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