OpenSAFELY codelists

Type 1 diabetes (secondary care) ICD-10

Codes explicity indicating Type 1 Diabetes (secondary care)

Type 2 Diabetes CTV3

Codes explicitly indicating Type 2 Diabetes

Ulcerative colitis CTV3
VTE classified codes CTV3

VTE codes classified into cvt, dvt, pe, hepatic, smv, unspecified and other.

Valvular atrial fibrillation CTV3

Codes indicating incident/ history of valvular atrial fibrillation (codes indicating artificial valves and mitral stenosis).

Venous Thromboembolic Disease CTV3

DEFINITION: A history of venous thromboembolic disease

Variables: (1) a binary variable denoting the presence of one of the codes at any point in the patient record. (2) the earliest date of such a code.

Venous thromboembolism (current) by type - secondary care and mortality data ICD-10

ICD-10 codelist for any history of venous thromboembolism.

This differs from the existing OpenSAFELY codelist incident VTE by including codes that specify the event occured during pregnancy or post partum, and post thrombotic syndrome, and by further clarifying type (site) of VTE.

Vitamin D Prescription BNF

Codelist created by Liang-Yu Lin using the SNOMED - BNF mapping tool provided by NHS for publication '"The Association between Vitamin D and Incident Herpes Zoster: A UK Biobank Study"

Warfarin dm+d

This is a codelist to identify all warfarin preparations in the NHS dictionary of medicines and devices.


Returns body weight measurements.

Worms CTV3

CTV3 (READ V3) codelist for Worms

chronic inflammatory demyelinating polyneuropathy (CIDP) CTV3

CTV3 codelist for chronic inflammatory demyelinating polyneuropathy (no corresponding ICD-10 codes found)

diabetes-exeter-group CTV3

Codes for type 1 and type 2 diabetes.

ethnicity (SNOMED) SNOMED CT

A SNOMED UK ethnicity category codelist

6 categories*, labels are:

  • 1 - White
  • 2 - Mixed
  • 3 - Asian or Asian British
  • 4 - Black or Black British
  • 5 - Chinese or Other Ethnic Groups

16 categories, labels are:

  • 1 - White - British
  • 2 - White - Irish
  • 3 - White - Any other White background
  • 4 - Mixed - White and Black Caribbean
  • 5 - Mixed - White and Black African
  • 6 - Mixed - White and Asian
  • 7 - Mixed - Any other mixed background
  • 8 - Asian or Asian British - Indian
  • 9 - Asian or Asian British - Pakistani
  • 10 - Asian or Asian British - Bangladeshi
  • 11 - Asian or Asian British - Any other Asian background
  • 12 - Black or Black British - Caribbean
  • 13 - Black or Black British - African
  • 14 - Black or Black British - Any other Black background
  • 15 - Other Ethnic Groups - Chinese
  • 16 - Other Ethnic Groups - Any other ethnic group

*The full 6 Group Categories includes "6 - Not stated" which was not included in our codelist

hazardous alcohol drinking CTV3

Codes that indicate hazardous alcohol drinking behavior. Future studies that require to specify ex-drinker and current-drinker need to revisit and review this codelist.