Unifying ICD-10 editions for OpenSAFELY in OpenCodelists
- Posted:
- Written by:
- Categories:
As of this week, we have implemented an updated release of ICD-10 on OpenCodelists, designed to work specifically with OpenSAFELY data for increased coverage across multiple datasets at once. This release combines the ICD-10 editions used in both ONS mortality data and NHS hospital admissions data, meaning that a single ICD-10 codelist now has increased coverage across multiple datasets in OpenSAFELY.
Context
ICD-10 is used in two key places in OpenSAFELY data: in the ONS deaths records and in NHS Admitted Patient Care Statistics (APCS) records. However, these two data sources use different editions of ICD-10 for their clinical coding; ONS currently uses the 2019 edition from the World Health Organisation (WHO), and APCS data uses the 2016 edition with NHS-specific alterations.
These two editions are largely compatible, but there are some key discrepancies that can affect studies carried out in OpenSAFELY. In particular, some COVID-related codes differ between the 2019 edition and the 2016 edition used by the NHS. For example ‘Post COVID-19 condition’ is code U09/U099 in the 2019 edition, but UO74 in the 2016 edition.
In addition to the above, we identified an opportunity to improve coverage of the 2019 edition in OpenCodelists by incorporating dagger and asterisk relationships, and 4th- and 5th- character modified codes, which were previously not present in OpenCodelists.
To address all these nuances, whilst making the process of building codelists as seamless as possible, the Bennett Institute has compiled a combined release of ICD-10 which incorporates both the 2016 NHS-extended and 2019 editions, complete with dagger/asterisk relationships and 4th- and 5th-character modified codes. This new release is denoted on OpenCodelists as ‘combined_[…]’, and is now the default release of ICD-10 that will be used when you create a new ICD-10 codelist.
This means that codelists created using this release of ICD-10 will be able to correctly match codes found in ONS deaths data and APCS data at the same time.
What we’ve done
In order to create the combined OpenSAFELY release of ICD-10, we used two data sources:
- The NHS usage of ICD-10, according to the National Clinical Coding Standards, was extracted from the NHS ICD-10 browser using a custom-built web scraper and transformed into a standard format for representing ICD-10.
- The official editions of ICD-10 for 2016 and 2019 were downloaded from the WHO website.
We then wrote some code to extract the ICD-10 structures from these data sources and work with them programmatically, which allowed us to investigate and reconcile discrepancies between the two editions (such as the differing codes denoting COVID-related conditions, and a few other known changes).
Why this matters
We can illustrate why this was important with an example:
Previously, a researcher searching for “pneumocystosis” might miss codes depending on which ICD-10 edition was represented. The new release returns both relevant codes, helping users build more complete codelists across datasets.
Why is that? One of the differences between the NHS 2016 edition, and the WHO 2019 edition, is that Pneumocystosis moved from B59 (2016) to B48.5 (2019, see Figure 1). If you included code B59 it would find clinical events in the APCS records, but not the ONS deaths records, and if you included code B48.5 it would find clinical events in the ONS deaths records but not the APCS records, as they both use slightly different editions of ICD-10. Now it’s easy to include both B48.5 and B59 across both datasets at once (see Figure 2).
Fig. 1. In the old release of ICD-10 on OpenCodelists, searching ‘Pneumocystosis’ only showed the WHO 2019 edition code B48.5.
Fig. 2. When searching for ‘Pneumocystosis’ in the new combined release, you’ll now see results for both B59 (from the NHS 2016 edition) and B48.5 (WHO 2019 edition).
In cases where the meaning of a code differs between editions, or there is otherwise some nuance around how the codes are used in practice, these codes will be highlighted on OpenCodelists in any codelist in which they appear (see Fig. 3).
Fig. 3. If you are looking at codes where there is nuance between the two editions, you’ll be shown information directly in OpenCodelists.
How to use it
When you create a new ICD-10 codelist, OpenCodelist will default to using the new combined release. You’ll now experience better code coverage, and lots more helpful information directly in OpenCodelists where we’ve identified any nuanced usage in UK health data, with links to further documentation and context provided.
The new release doesn’t affect any existing codelists that have already been built using the non-combined release of ICD-10. You can choose to update older codelists to use the new combined release, for increased coverage across multiple datasets.
Find out more
We hope this update makes working with ICD-10 in OpenSAFELY simpler and more flexible. If you’d like to know more, you can have a look at our Documentation.
If you have any questions, feedback, or suggestions, we’d love to hear from you. Please get in touch with us at team@opensafely.org.