inst/shinyApps/QueryLibrary/queries/person/PE09.md

PE09: Number of patients by gender, stratified by year of birth

Description

Count the genders (gender_concept_id) across all person records, arrange into groups by year of birth. All possible values for gender concepts stratified by year of birth are summarized.

Query

SELECT
  gender_concept_id,
  concept_name     AS gender_name,
  year_of_birth    AS year_of_birth,
  COUNT(*)         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, person.year_of_birth
ORDER BY concept.concept_name, person.year_of_birth;

Input

None

Output

| Field | Description | | --- | --- | | gender_concept_id | CDM vocabulary concept identifier | | gender_name | Gender name as defined in CDM vocabulary | | year_of_birth | Stratification by year of birth | | num_persons | Number of patients in the dataset of specific gender / year of birth |

Example output record

| Field | Value | | --- | --- | | gender_concept_id | 8507 | | gender_name | MALE | | year_of_birth | 1950 | | num_persons | 169002 |

Documentation

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



OHDSI/QueryLibrary documentation built on Aug. 1, 2023, 5:42 a.m.