Clinical coding of long COVID in English primary care: a federated analysis of 58 million patient records in situ using OpenSAFELY

Background Long COVID describes new or persistent symptoms at least 4 weeks after onset of acute COVID-19. Clinical codes to describe this phenomenon were recently created. Aim To describe the use of long-COVID codes, and variation of use by general practice, demographic variables, and over time. Design and setting Population-based cohort study in English primary care. Method Working on behalf of NHS England, OpenSAFELY data were used encompassing 96% of the English population between 1 February 2020 and 25 May 2021. The proportion of people with a recorded code for long COVID was measured overall and by demographic factors, electronic health record software system (EMIS or TPP), and week. Results Long COVID was recorded for 23 273 people. Coding was unevenly distributed among practices, with 26.7% of practices having never used the codes. Regional variation ranged between 20.3 per 100 000 people for East of England (95% confidence interval [CI] = 19.3 to 21.4) and 55.6 per 100 000 people in London (95% CI = 54.1 to 57.1). Coding was higher among females (52.1, 95% CI = 51.3 to 52.9) than males (28.1, 95% CI = 27.5 to 28.7), and higher among practices using EMIS (53.7, 95% CI = 52.9 to 54.4) than those using TPP (20.9, 95% CI = 20.3 to 21.4). Conclusion Current recording of long COVID in primary care is very low, and variable between practices. This may reflect patients not presenting; clinicians and patients holding different diagnostic thresholds; or challenges with the design and communication of diagnostic codes. Increased awareness of diagnostic codes is recommended to facilitate research and planning of services, and also surveys with qualitative work to better evaluate clinicians’ understanding of the diagnosis.


INTRODUCTION
Long COVID has been broadly defined as new or persistent symptoms of COVID-19 beyond the acute phase of SARS-CoV-2 infection. 1 The National Institute for Health and Care Excellence (NICE) have produced guidance on managing the long-term effects of COVID-19 as these symptoms can have a significant effect on a person's quality of life. 1 NICE recognise that as long COVID is such a new condition the exact clinical definition and treatments are evolving.
A recent systematic review found a very high prevalence of persisting COVID symptoms after COVID diagnosis. 2 For symptoms lasting 4-12 weeks 83% of people reported at least one persisting symptom, whereas for symptoms lasting beyond 12 weeks, the proportion was 56%. The reported associated symptoms are numerous, but include fatigue, shortness of breath, cough, smell or taste dysfunction, cognitive impairment, and muscle pain.
NICE developed their definitions and clinical guidelines using a 'living' approach based on early data. This means that the guidelines will be continuously reviewed and updated and it is therefore critical to continue studying the long-term effects of COVID-19 as data accrue, and refine the guidelines appropriately. To support this need, long-COVID SNOMED-CT codes ('diagnostic codes' listed in Box 1) were developed and released in the UK in November 2020. To support clinical care and implementation of NICE guidance, distinct SNOMED-CT codes were made available by NHS Digital, which distinguish between the length of ongoing symptoms. SNOMED-CT is an international structured clinical coding system for use in electronic health records. Symptoms between 4 and 12 weeks are defined as 'ongoing symptomatic disease Abstract Background Long COVID describes new or persistent symptoms at least 4 weeks after onset of acute COVID- 19. Clinical codes to describe this phenomenon were recently created.

Aim
To describe the use of long-COVID codes, and variation of use by general practice, demographic variables, and over time.

Design and setting
Population-based cohort study in English primary care.

Method
Working on behalf of NHS England, OpenSAFELY data were used encompassing 96% of the English population between 1 February 2020 and 25 May 2021. The proportion of people with a recorded code for long COVID was measured overall and by demographic factors, electronic health record software system (EMIS or TPP), and week.

Conclusion
Current recording of long COVID in primary care is very low, and variable between practices. This may reflect patients not presenting; clinicians and patients holding different diagnostic thresholds; or challenges with the design and communication of diagnostic codes. Increased awareness of diagnostic codes is recommended to facilitate research and planning of services, and also surveys with qualitative work to better evaluate clinicians' understanding of the diagnosis.

Keywords
COVID-19; general practice; electronic health records; long COVID; primary health care. caused by severe acute respiratory syndrome coronavirus 2', and symptoms continuing beyond 12 weeks as 'post-COVID-19 syndrome'. 3 There are also three assessment codes and 10 referral codes relating to long COVID; however, none of these codes explicitly contain the term 'long COVID'.
Appropriate coding of long COVID is critical for ongoing patient care, research into the condition, policymaking, and public health resource planning. This study set out to describe the use of long-COVID codes in English primary care since their introduction, in a cohort covering approximately 96% of the English population -those covered by the two largest electronic health record providers, EMIS and TPP (SystmOne). A further aim was to describe the variation of use among general practices, demographic variables, and over time.

METHOD Study design and data sources
A population-based cohort study was conducted that calculated the period prevalence of long COVID recording in electronic health record (EHR) data. Primary care records managed by the GP software providers EMIS and TPP were accessed through OpenSAFELY, an open-source data analytics platform created by the authors on behalf of NHS England to address urgent COVID-19 research questions (https:// opensafely.org). OpenSAFELY provides a secure software interface allowing a federated analysis of pseudonymised primary care patient records from England in near real-time within the EMIS and TPP highly secure data environments. Nondisclosive, aggregated results are exported to GitHub (an online code repository) where further data processing and analysis takes place. This avoids the need for large volumes of potentially disclosive pseudonymised patient data to be transferred off-site. This, in addition to other technical and organisational controls, minimises any risk of re-identification.
The dataset available to the platform includes pseudonymised data such as coded diagnoses, medications, and physiological parameters. No free-text data were included. All activity on the platform is publicly logged and all analytic code and supporting clinical coding lists are automatically published. In addition, the framework provides assurance that the analysis is reproducible and reusable. Further details on the information governance and platform can be found in Supplementary Appendix S1.

Population
All people registered with a general practice on the 1 November 2020 were included.

Outcome
The outcome was any record of long COVID in the primary care record. This was defined using a list of 15 UK SNOMED-CT codes (Box 1) and categorised as diagnostic (two codes), referral (three codes), and assessment (10 codes). 4 The outcome was measured between the study start date (1 February 2020) and the end date (25 April 2021). Although the start date is before the codes were created, it is possible for a GP to backdate diagnostic codes in a GP system when they are entered. Timing of outcomes was determined by the first record of a SNOMED-CT code for each person, as determined by the date recorded by the clinician.

How this fits in
Early case definitions and clinical guidelines have been published to describe long COVID, and clinical codes based on these guidelines were published in late 2020. This study found wide variation in the early use of these codes, by practice, geographic region, and practice electronic health record software. Promotion of the clinical guidance and codes is important for future research and ongoing patient care.

Stratifiers
Demographic variables were extracted including age (in categories), sex, geographic region, Index of Multiple Deprivation (IMD, divided into quintiles), and ethnicity. IMD is a widely used geographical-based measure of relative deprivation based on factors such as income, employment, and education. Counts and rates of recorded events were stratified by each demographic variable.
Recording of each SNOMED-CT code was assessed individually, in this case, counting every recorded code including repeated codes, rather than one per patient.

Statistical methods
Proportions of patients with long-COVID codes over the whole study period per 100 000 patients, 95% confidence intervals (CIs) of those proportions, and the distribution of codes by each stratification variable were calculated. All long-COVIDrelated codes, as listed in Box 1, were included.

Software and reproducibility
Data management and analysis was performed using the OpenSAFELY software libraries and Jupyter notebooks, both implemented using Python 3. More details are available in Supplementary Appendix S1. This is an analysis delivered using federated analysis through the OpenSAFELY platform. A federated analysis involves carrying out patient-level analysis in multiple secure datasets, then later combining them: codelists and code for data management and data analysis were specified once using the OpenSAFELY tools; then transmitted securely from the OpenSAFELY jobs server to the OpenSAFELY-TPP platform within TPP's secure environment, and separately to the OpenSAFELY-EMIS platform within EMIS's secure environment, where they were each executed separately against local patient data; summary results were then reviewed for disclosiveness, released, and combined for the final outputs. All code for the OpenSAFELY platform for data management, analysis, and secure code execution is shared for review and reuse under open licenses at GitHub. com/OpenSAFELY. All code for data management and analysis for this article is shared for scientific review and reuse under open licenses on GitHub (https://github. com/opensafely/long-covid).

Cohort characteristics and overall rate of recording
There were 58.0 million people in the combined cohort in total; 24.0 million in the TPP cohort and 34.0 million in the EMIS cohort. Demographics of the cohort are described in Table 1.
Up to 25 April 2021, there were 23 273 (0.04%) patients with a recorded code indicative of a long-COVID diagnosis ( Table 2). A higher proportion of these recorded diagnoses were in EMIS, with 18 262 (0.05%), compared with 5011 (0.02%) in TPP. Taking into account the larger total number of patients in EMIS practices, the rate over the whole study period was 53.7 per 100 000 people (95% CI = 52.9 to 54.4) in EMIS and 20.9 (95% CI = 20.3 to 21.4) in TPP.  Table 2. Also reported in Table 2 are counts broken down by EHR software provider. Here some similarities and differences in the rates were observed; the proportions of events for age and sex are fairly comparable whereas region, IMD, and ethnicity show some differences.

Geographic and practice distribution of coding
The rate of coding varied substantially between regions (  to the EHR software provider. For example, EMIS covers a high proportion of the London population, whereas TPP covers a high proportion of the East of England (Table 1). Over one-quarter (26.7%) of practices have not used the codes at all (data not shown). This proportion is much higher in practices using TPP (44.2%) than those using EMIS (15.1%) (Figure 1). The distribution is described more fully in Figure 1. The highest number of codes in a single practice was 150 (data not shown).

Rate of coding over time
The number of recorded events was relatively low until the end of January 2021, after which there was an increase in coding ( Figure 2). This increase was more marked in EMIS practices, which before that time had recorded fewer long-COVID codes overall than TPP practices. It was very infrequent to find records that had been backdated to before November 2020 when the codes were created, with <0.1% of codes coded as occurring before November 2020 (data not shown).

Coding of individual SNOMED-CT codes
The diagnostic codes were the most commonly used codes, particularly the 'Post-COVID-19 syndrome' code, which accounted for 64.3% of all recorded codes (Table 3). There were differences in the distribution of codes, however, between TPP and EMIS practices. Codes relating to assessment of long COVID accounted for just 2.4% of long-COVID codes used to date.

DISCUSSION Summary
As of late April 2021, 23 273 people had a record of at least one long-COVID code in their primary care record. Use between different general practices varied greatly, and a large proportion (26.7%) have never used any long-COVID codes. Substantially higher recording in practices that use EMIS compared with those that use TPP was found. Among those people who did have a recorded long-COVID code, rates were highest in the workingage population and were more common in females.

Strengths and limitations
The key strength of this study is its unprecedented scale; >58 million people were included, 96% of the population in England. In contrast with many studies that use EHR data, in this study it was possible to compare long-COVID diagnostic codes between practices that use different software systems. A striking disparity was found: this has important implications for understanding whether clinicians are using the codes appropriately. A key weakness of this data for estimating true prevalence of long COVID in primary care, and factors associated with the condition, is that it relies on clinicians formally entering a diagnostic or referral code into the patient's record: this is a limitation of all EHR research for all clinical conditions and activity, however, the emergence of a new diagnosis and the recent launch of a new set of diagnostic codes may present challenges in this regard. As a result of these current limitations, this study did not aim to estimate the prevalence of long COVID, or aim to make causal inferences about the observed variation.

Comparison with existing literature
To the authors' knowledge, there are no other studies on prevalence of long COVID using clinicians' diagnoses or EHRs data. There are numerous studies using self-reported data from patients on the prevalence of continued symptoms following COVID-19, with estimates varying between 4.5% and 89%, largely because of highly variable case definitions; 5 individual symptoms characterising long COVID have been reported as fatigue, headache, dyspnoea, and anosmia. 6 The Office for National Statistics COVID Infection Survey estimates prevalence of self-diagnosed long COVID at 13.7%. 7 Separately,  10 Other studies have examined variation in clinical coding, with some finding that 'poor' coding can lead to altered incidence estimates, 11 whereas others implicate the design of clinical software systems in influencing variation. [12][13][14] Implications for research and practice The prevalence of long-COVID codes in primary care that are reported in this study is extremely low when compared with current survey data on long-COVID prevalence. 15,16 This conflict may be attributable to a range of different possible causes related to information bias including: patients not yet presenting to primary care with long COVID; different clinicians and patients holding different diagnostic thresholds or criteria for long COVID; and issues around coding activity including clinicians not yet knowing about the long-COVID diagnostic codes, the design and text of the long-COVID diagnostic codes, and the design of EHR systems in which the codes can be selected for entry onto a patient record. The large variation in the apparent rate of long COVID between different geographic regions, practices, and EHR systems strongly suggests that clinicians' coding practice is inconsistent at present. This suggests variation in awareness of the new diagnostic codes that were only launched in November 2020, and only available in EMIS at the end of January 2021. In addition, the codes for long COVID and associated synonyms do not currently contain the term 'long COVID': this was an active choice by NHS Digital who manage SNOMED-CT UK codes. 1 The October 2020 NICE consultation on management of the longterm effects of COVID-19 does mention the term 'long COVID', although the term was not incorporated into the clinical definitions that were translated into diagnostic codes by NHS Digital. 1 These decisions were carefully thought through at the time they were made; however, as a result of broader contextual shifts in language over time there is now a clear mismatch between formal clinical terminology and popular parlance among clinicians and patients. The view of the authors of this study is that those managing SNOMED-CT terminology for England should either update the long-COVID codes to include the phrase 'long COVID', ideally in advance of the upcoming new SNOMED-CT international release; or energetically disseminate their preferred new phrasing to all frontline clinicians, to ensure more appropriate use of these codes. Similarly NICE and other authoritative bodies giving guidance on long COVID should energetically communicate to clinicians the importance of correctly coding long COVID in patient records. It is a high national priority to estimate the prevalence of long COVID, identify its causes and consequences, and plan services appropriately.
The variation in the rate of diagnostic code usage between users of different EHR software is also striking. This difference could plausibly be responsible for some of the other variation described. For example, as noted in the results, some regions have a high percentage of coverage from one software provider. After speaking with clinicians and both software vendors, the reasons for the difference remain unclear, but are likely attributable to differences in user interface, which has previously been shown to influence clinicians' treatment choices. 13,14 This should be addressed by interviewing GPs about their experiences with diagnosing and treating people with long COVID in each system.
Despite these issues around correct recording of clinicians' diagnoses, there also remains a strong possibility that clinicians are not currently diagnosing their patients as having long COVID. This may be because patients are not presenting with long COVID to services, for a range of reasons during a pandemic; or their clinicians are not diagnosing them with long COVID when they are seen. The view of the authors is that this can only be resolved by conducting prospective surveys with clinicians themselves, evaluating how many patients they have seen with a condition they would understand to be diagnosable as long COVID, alongside qualitative research on the topic.
The issues with recording of long COVID described here also have implications for future research. It is likely that recording will improve over time, as disease definitions are improved, guidelines are iterated on, and clinicians become more aware of the condition. It is likely also worth considering additional approaches to identifying long COVID in routine medical data. This might include identifying and measuring broad groups of symptoms that are associated with long COVID. 17

Funding
This study was jointly funded by UK Research and Innovation (UKRI), National Institute for Health Research (NIHR), and Asthma UK-BLF (reference numbers: COV0076; MR/ V015737/), and the Longitudinal Health and Wellbeing strand of the National Core Studies programme. EMIS and TPP provided technical expertise and infrastructure within their data environments pro bono in the context of a national emergency. The OpenSAFELY software platform is supported by a Wellcome Discretionary Award. Ben Goldacre's work on clinical informatics is supported by the NIHR Oxford Biomedical Research Centre and the NIHR Applied Research Collaboration Oxford and Thames Valley. Funders had no role in the study design, collection, analysis, and interpretation of data; in the writing of the report; and in the decision to submit the article for publication. The views expressed are those of the authors and not necessarily those of the NIHR, NHS England, Public Health England, or the Department of Health and Social Care.
Ethical approval NHS England is the data controller; EMIS and TPP are the data processors; and the key researchers on OpenSAFELY are acting on behalf of NHS England. This study was approved by the Health Research Authority (Research Ethics Committee reference: 20/LO/0651) and by the London School of Hygiene and Tropical Medicine Ethics Board (reference: 21863).

Provenance
Freely submitted; externally peer reviewed.
If it is accepted that the different rates of long COVID usage in each subgroup reflects the true comparative risk for each demographic then there are two key findings. First, the lower rate in older patients, despite their higher prevalence of severe acute COVID-19 outcomes, 18 which may be affected by the competing risk of death in patients with COVID-19. Second, the higher rate of long COVID in females, despite the higher prevalence of severe acute COVID outcomes in males, 18 which may be explained in part by differences in routine consultation rates between males and females. 19 In conclusion, current recording of long COVID in primary care is very low, and variable between practices. This may reflect patients not presenting; clinicians and patients holding different diagnostic thresholds; or challenges with the design and communication of diagnostic codes. This analysis will be updated regularly with extended follow-up time.