Ethnicity

PH3416 / 8443

OpenSAFELY

Jan 26, 2026

REGISTERING DOI...

OpenCodelists Phenotype
  1. Overview

    Codelist ID
    opensafely/ethnicity
    Version ID
    746e4c98
    Version Tag
    2020-04-27
    Coding System
    Read codes v3
    Collections
    OpenCodelistPhenotype Library
    Tags
    No data
  2. Definition

    This codelist was taken from OpenCodelists, created by OpenSAFELY. We recommend viewing this Phenotype on the OpenCodelist website to view the most recent version.

    A list of ethnicity codes in use in UK general practice including aggregate grouping at two levels.

    5+1 category labels are:

    • 1 - White
    • 2 - Mixed
    • 3 - South Asian
    • 4 - Black
    • 5 - Other
    • 6 - Not stated

    16+1 category labels are:

    • 1 - White British
    • 2 - White Irish
    • 3 - Other White
    • 4 - White and Caribbean
    • 5 - White and African
    • 6 - White and Asian
    • 7 - Other mixed
    • 8 - Indian
    • 9 - Pakistani
    • 10 - Bangladeshi
    • 11 - Other South Asian
    • 12 - Caribbean
    • 13 - African
    • 14 - Other Black
    • 15 - Chinese
    • 16 - All other ethnic groups
    • 17 - Not stated

    © University of Oxford for the Bennett Institute for Applied Data Science 2025. This work may be copied freely for non-commercial research and study.

  3. Methodology

    An initial long list of ethnicity codes was provided from a paper on the Completeness and Usability of Ethnicity Data in UK-based Primary Care and Hospital Databases. This list was further iterated by aggregating ethnicity to parent ethnicity at two levels based on a list provided by Rohini Mathur, the first author on the above paper. This task was completed independently by Ieva Lipsa, Alex J Walker and Brian MacKenna. Any divergence was resolved through discussion between AJW and BMK.

    We are aware that some of the individual codes contained in this codelist may be offensive and upsetting. Although these terms are outdated and no longer in routine use, it is necessary to include them in codelists due to the historic nature of the data that is being analysed.

  4. References

  5. Clinical Codelist

  6. API

    To Export Phenotype Details:

    FormatAPI
    JSON site_root/api/v1/phenotypes/PH3416/version/8443/detail/?format=json
    R Package

    # Download here

    library(ConceptLibraryClient)


    # Connect to API

    client = ConceptLibraryClient::Connection$new(public=TRUE)


    # Get details of Phenotype

    phenotype_details = client$phenotypes$get_detail(
     'PH3416',
     version_id=8443
    )

    Py Package

    # Download here

    from pyconceptlibraryclient import Client


    # Connect to API

    client = Client(public=True)


    # Get details of Phenotype

    phenotype_detail = client.phenotypes.get_detail(
     'PH3416',
     version_id=8443
    )

    To Export Phenotype Code List:

    FormatAPI
    JSON site_root/api/v1/phenotypes/PH3416/version/8443/export/codes/?format=json
    R Package

    # Download here

    library(ConceptLibraryClient)


    # Connect to API

    client = ConceptLibraryClient::Connection$new(public=TRUE)


    # Get codelist of Phenotype

    phenotype_codelist = client$phenotypes$get_codelist(
     'PH3416',
     version_id=8443
    )

    Py Package

    # Download here

    from pyconceptlibraryclient import Client


    # Connect to API

    client = Client(public=True)


    # Get codelist of Phenotype

    phenotype_codelist = client.phenotypes.get_codelist(
     'PH3416',
     version_id=8443
    )

  7. Version History

    Version IDNameOwnerPublish date
    Ethnicity ieuan.scanlon2026-01-26 23:16