inst/QueryLibrary/Aggregate/observation_period/OP04.md

OP04: Number of people who have gap in observation (two or more observations)

Description

Count number of people who have two or more observations.

Query

SELECT COUNT(person_id)::integer AS num_persons
FROM 
  (SELECT
    person_id
   FROM @cdm.observation_period
   GROUP BY person_id
   HAVING COUNT( person_id ) > 1
  ) AS t;

Input

None

Output

| Field | Description | | --- | --- | | num_persons | Number of patients who have two or more observations |

Example output record

| Field | Value | | --- | --- | | num_persons | 18650793 |

Documentation

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



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