inst/QueryLibrary/Aggregate/person/PE03.md

PE03: Number of patients grouped by gender

Description

This query lists all available genders (male, female, unknown, ambiguous, other) across all person records.

Query

SELECT
  person.gender_concept_id,
  concept.concept_name    AS gender_name,
  COUNT(person.person_id)::integer AS num_persons
FROM @cdm.person
  JOIN @vocab.concept ON person.gender_concept_id = concept.concept_id
GROUP BY person.gender_concept_id, concept.concept_name
;

Input

None

Output

| Field | Description | | --- | --- | | gender_concept_id | Gender concept ID as defined in CDM vocabulary | | gender_name | Gender name as defined in CDM vocabulary | | num_persons | Count of patients with specific gender ID |

Example output record

| Field | Value | | --- | --- | | gender_concept_id | 8507 | | gender_name | Male | | num_persons | 1607473 |

Documentation

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



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