# Codelists and NHS England data
>Last modified: 19 Mar 2026
<div style="background-color: rgba(0, 178, 169, 0.3); padding: 5px; border-radius: 5px;"><strong>When requesting access to certain NHS England datasets, researchers must submit a codelist to ensure data minimisation.</strong></div>
<br>

Data minimisation in this context is referred to as **‘subsetting’**, where only health records that relate directly to the research question are made available to researchers. Subsetting entails matching a list of clinical codes (a 'codelist') with linked health datasets. The researcher is only given access to records that appear in both the codelist and the linked health dataset(s). This reduces disclosure risk and ensures the project's scope remains as approved by UK LLC's application process.

## Which NHS England datasets require a codelist?
**Six NHS England datasets** in the UK LLC TRE require a clinical code list:
* [**HES Outpatients (HESOP)**](../hes_datasets/op/hesop.ipynb)
* [**HES Admitted Patient Care (HESAPC)**](../hes_datasets/apc/hesapc.ipynb)
* [**HES Accident & Emergency (HESAE)**](../hes_datasets/ae/hesae.ipynb)
* [**General Practice Extraction Service (GPES) Data for Pandemic Planning and Research (GDPPR)**](../primary_care_datasets/gdppr/gdppr.ipynb)
* [**Medicines Dispensed in Primary Care (NHSBSA data) (PCM)**](../primary_care_datasets/pcm/pcm.ipynb)
* [**Cancer Registrations (CANCER)**](../registration_datasets/cancer/cancer.ipynb)

## How do I create a codelist?
We recommend that researchers draw on **pre-defined codelists** and **existing resources** rather than define their own. There are online repositories of codelists generated by researchers who have used electronic health records. The following resources may be of particular use:
* <strong><a href="https://phenotypes.healthdatagateway.org/" target="_blank" rel="noopener noreferrer">HDR UK Phenotype Library</a></strong>
* <strong><a href="https://www.opencodelists.org/" target="_blank" rel="noopener noreferrer">OpenCodelists</a></strong>

UK LLC is committed to supporting reproducible and transparent research practices. As such, we maintain a library of all codelists researchers provide which can be shared with other researchers on request.

## What should a codelist look like?
UK LLC provides a codelist template as a <strong><a href="https://apply.ukllc.ac.uk/apply/view_document/codelist_template/" target="_blank" rel="noopener noreferrer">downloadable MS Excel file</a></strong>. The template contains information on which coding systems should be used for each of the NHS England datasets. The coding systems used by each dataset are outlined on the [**Coded variables**](../coding/coding_intro.md) page.


## What happens if I need to update my codelist during my project?
If you need to add more clinical codes without changing the scope of your project, you can email a new codelist to [**support@ukllc.ac.uk**](mailto:support@ukllc.ac.uk), explaining why the codelist has changed. If you need to add clinical codes that are outside the original project scope, you should submit an [**amendment**](../../../user_guide/requestinganamendment.md) via <strong><a href="https://apply.ukllc.ac.uk/" target="_blank" rel="noopener noreferrer">UK LLC Apply</a></strong>.
