Exploring Prior Antibiotic Exposure Characteristics for COVID-19 Hospital Admission Patients: OpenSAFELY

Previous studies have demonstrated the association between antibiotic use and severe COVID-19 outcomes. This study aimed to explore detailed antibiotic exposure characteristics among COVID-19 patients. Using the OpenSAFELY platform, which integrates extensive health data and covers 40% of the population in England, the study analysed 3.16 million COVID-19 patients with at least two prior antibiotic prescriptions. These patients were compared to up to six matched controls without hospitalisation records. A machine learning model categorised patients into ten groups based on their antibiotic exposure history over the three years before their COVID-19 diagnosis. The study found that for COVID-19 patients, the total number of prior antibiotic prescriptions, diversity of antibiotic types, broad-spectrum antibiotic prescriptions, time between first and last antibiotics, and recent antibiotic use were associated with an increased risk of severe COVID-19 outcomes. Patients in the highest decile of antibiotic exposure had an adjusted odds ratio of 4.8 for severe outcomes compared to those in the lowest decile. These findings suggest a potential link between extensive antibiotic use and the risk of severe COVID-19. This highlights the need for more judicious antibiotic prescribing in primary care, primarily for patients with higher risks of infection-related complications, which may better offset the potential adverse effects of repeated antibiotic use.


Introduction
The COVID-19 pandemic has had an overwhelming impact worldwide.A metaanalysis reported that the global pooled case fatality rate was 1% among the general population in 2020 [1].However, it is estimated that COVID-19 still caused 18.2 million excess deaths during the period from 2020 to 2021 [2].
According to Trougakos's (2021) review, COVID-19 is a two-phase disease associated with mild or severe outcomes [3].The first phase involves the virus spreading within the respiratory and gastrointestinal tracts, and the second phase may trigger a significant immune response in the hosts, where individual diversity (e.g., age and sex) drives the severity of the immune reaction.However, some potential factors related to severe outcomes may still be unknown.
To date, several studies have observed altered gut microbiota accompanied by dysfunctional immune or metabolic responses related to severe COVID-19 infections in hospitalised patients [4][5][6].Although there was no significant change in the gut microbiota for mild COVID-19 patients, virulence factors and antimicrobial resistance genes (ARGs) were found to have higher expression levels [7], which may lead to gut dysbiosis in these populations.
Antibiotics are one of the major factors that can cause perturbation of the gut microbiome.A systematic review indicated that long-term dysbiosis may result from a combination of antibiotic types [8].The administered antibiotic spectrum, route, and duration also influence the resilience of the gut microbiome [9].Both our previous findings and research from Spain have shown frequent antibiotics might be correlated to COVID-19 severity [10], suggesting that antibiotic-associated alterations in the gut microbiota make the host susceptible to new infections.Although previous research analysed the volume and recent exposure timing of antibiotics, detailed prescribing patterns were not evaluated, which may help to understand how antibiotics impact the gut microbiota.This observed relationship may, in part, be confounded by a patient's overall ill health, leading to a higher antibiotic prescribing history (e.g., in those who are immunosuppressed).
Therefore, the aim of this study was to build upon our previous research, which evaluated the effects of prior antibiotics on the severity of COVID-19 infection outcomes [11], to explore the relationship between COVID-19 infection severity and exposure to two or more prior antibiotic prescriptions.The primary goal was to more accurately describe the characteristics of antibiotic prescribing and its association with severe COVID-19 outcomes, taking into account various risk factors such as increased comorbidities in this population, age, sex, and ethnicity.

Study Participants
From 1 February 2020 to 31 December 2022, 3.2 million patients were identified as incident COVID-19 patients, and 889,850 (28.2%) patients had more than two antibiotic prescriptions in the 3-year exposure period.After matching, a balanced distribution in age, sex, region, and index date between case and control was achieved, resulting in 67,515 cases and 375,330 controls in the analysis (Supplementary Table S3).Table 1 shows that controls consisted of a healthier population at baseline.Cases had a higher proportion of unhealthy weight, presence of comorbidity, smoking history, and deprivation than controls.  . Smoking status and care home residents identified from the most recent clinical records. 5. IMD (Index of Multiple Deprivation) quintile measured from patient-level postcode. 6. COVID-19 vaccine has been identified since the vaccination programme started. 7. Influenza vaccine identified in the previous 2 years.
Supplementary Table S4 shows that cases had more antibiotic prescriptions (mean counts, 9.7 vs. 6.9), a longer antibiotic exposure period (mean days, 614.7 vs. 542.7),and more recent antibiotics received (mean days, 275.0 vs. 325.9).Over half of the control group received the lowest level of antibiotic types compared to cases (level 1, control 57.5% vs. case 49.5%), and most of the controls were not prescribed broad-spectrum antibiotics (level 1, control 73.9% vs. case 68.4%).Cases experienced shorter intervals between prescriptions, and controls showed less variability in prescribing intervals.

Antibiotic Exposure and Severe COVID-19 Outcome
The prescribing interval average, recent antibiotic exposure, prescribing interval deviation, and exposure period were the most important variables in the random forest (RF) model (Figure 1).The RF model utilised antibiotic exposure data to stratify COVID-19 patients into decile groups based on their risk of hospitalisation.Higher decile groups, sharing similar antibiotic histories, have an increased risk of severe COVID-19 (Table 2).The adjusted conditional logistic regression (CLR) model revealed that those in the highest risk decile were approximately five times more likely to experience severe COVID-19 compared to those in the lowest risk decile.(adjusted model 4.8 [4.6-5.0]).

Antibiotic Exposure and Severe COVID-19 Outcome
The prescribing interval average, recent antibiotic exposure, prescribing interval deviation, and exposure period were the most important variables in the random forest (RF) model (Figure 1).The RF model utilised antibiotic exposure data to stratify COVID-19 patients into decile groups based on their risk of hospitalisation.Higher decile groups, sharing similar antibiotic histories, have an increased risk of severe COVID-19 (Table 2).The adjusted conditional logistic regression (CLR) model revealed that those in the highest risk decile were approximately five times more likely to experience severe COVID-19 compared to those in the lowest risk decile.(adjusted model 4.8 [4.6-5.0]).were excluded from the study design.Antibiotic-related variables included: 1.The prescribing interval was estimated for each individual by collecting the number of days between each antibiotic prescription.The average of prescribing intervals was shown as the mean. 2. time from the last antibiotic prescription until COVID-19 onset. 3. The prescribing interval was estimated for each individual by collecting the number of days between each antibiotic prescription.The deviation of prescribing intervals was shown as the standard deviation. 4. time between the first prescription and the last antibiotic prescription. 5. count of the total number of antibiotic prescriptions. 6. count of unique types of prior antibiotic prescriptions. 7. count of prior broad-spectrum antibiotic prescriptions.
Total antibiotics, antibiotic types, broad-spectrum antibiotics, and exposure period were found to increase with risk decile (Figure 2a-d), while recent antibiotics decreased (Figure 2e).Both the prescribing interval average and deviation presented rising and falling trends.However, the result shows that there was still a large amount of variability within each decile group.were excluded from the study design.Antibiotic-related variables included: 1.The prescribing interval was estimated for each individual by collecting the number of days between each antibiotic prescription.The average of prescribing intervals was shown as the mean. 2. time from the last antibiotic prescription until COVID-19 onset. 3. The prescribing interval was estimated for each individual by collecting the number of days between each antibiotic prescription.The deviation of prescribing intervals was shown as the standard deviation. 4. time between the first prescription and the last antibiotic prescription. 5. count of the total number of antibiotic prescriptions. 6. count of unique types of prior antibiotic prescriptions. 7. count of prior broad-spectrum antibiotic prescriptions.Total antibiotics, antibiotic types, broad-spectrum antibiotics, and exposure period were found to increase with risk decile (Figure 2a-d), while recent antibiotics decreased (Figure 2e).Both the prescribing interval average and deviation presented rising and falling trends.However, the result shows that there was still a large amount of variability within each decile group.Table 3 summarises the combination of antibiotic characteristics by risk decile groups.Most patients in the lowest risk decile received the lowest level of total antibiotic prescriptions (73.1%), antibiotic types (91.9%), and broad-spectrum antibiotics (91.1%), and around 60% of patients had a shorter exposure period.On the other hand, patients in the highest risk decile received the most antibiotic prescriptions (92.8%), antibiotic types (66.5%), broad-spectrum antibiotics (41.9%), longest exposure period (79.5%), and most recent antibiotics (82.8%).
Figure 3 lists the 10 most common antibiotics: amoxicillin, nitrofurantoin, doxycycline, flucloxacillin, trimethoprim, clarithromycin, azithromycin, co-amoxiclav, phenoxymethylpenicillin, and cefalexin.The proportion of each type prescribed in each decile was measured.The consumption of different antibiotic types was closer in the highest decile group than in other deciles.Approximately 32.9% of the prescriptions prescribed in decile 1 were for Amoxicillin.Nitrofurantoin (13.8% to 16.4%) and Doxycycline (12.9% to 15.4%) were highly used and remained stable across the decile.It was noticeable that Azithromycin remained the lowest percentage from decile 1 to decile 9 (0.2% to 2.9%) but surged to 14.3% in decile 10.Trimethoprim presented an upward trend from 5.2% to 13.5% when decile increased.  . continuous variables: mean (SD); and grouped by levels as categorical variables: patient number and percentage.
2. The values of each decile were shown as the median and Q1 (25th percentile) and Q3 (75th percentile) numbers; the values of each antibiotic exposure level 1-4 show the median value in brackets. 3. The counts of patients were rounded to the nearest five numbers in line with disclosure controls. 4. count of total antibiotic prescriptions grouped by quartile; level 1 is the lowest (1st quartile), and level 4 is the highest quartile (4th quartile). 5. count of unique antibiotic types grouped by quartile; level 1 is the lowest (combined 1st and 2nd quartile for the same value); level 3 is the highest quartile (4th quartile). 6. count of broad-spectrum antibiotic prescriptions grouped by quartile; level 1 is the lowest (combined 1st and 2nd quartile for the same value); level 3 is the highest quartile (4th quartile). 7. The time between the first prescription and the last antibiotic prescription was estimated and grouped by quartile; level 1 is the lowest (1st quartile), and level 4 is the highest quartile (4th quartile). 8. From the last antibiotic prescription until COVID-19 onset, days were estimated and grouped by quartile; level 1 is the lowest (1st quartile), and level 4 is the highest quartile (4th quartile). 9.The prescribing interval was measured by collecting the number of days between each antibiotic prescription by individuals, and then the mean and standard deviation were estimated.The values were grouped by quartile; level 1 is the lowest (1st quartile), and level 4 is the highest quartile (4th quartile).
Antibiotics 2024, 13, x FOR PEER REVIEW 8 of 16 quartile; level 1 is the lowest (combined 1st and 2nd quartile for the same value); level 3 is the highest quartile (4th quartile). 6. count of broad-spectrum antibiotic prescriptions grouped by quartile; level 1 is the lowest (combined 1st and 2nd quartile for the same value); level 3 is the highest quartile (4th quartile). 7. The time between the first prescription and the last antibiotic prescription was estimated and grouped by quartile; level 1 is the lowest (1st quartile), and level 4 is the highest quartile (4th quartile). 8. From the last antibiotic prescription until COVID-19 onset, days were estimated and grouped by quartile; level 1 is the lowest (1st quartile), and level 4 is the highest quartile (4th quartile). 9.The prescribing interval was measured by collecting the number of days between each antibiotic prescription by individuals, and then the mean and standard deviation were estimated.The values were grouped by quartile; level 1 is the lowest (1st quartile), and level 4 is the highest quartile (4th quartile).
Figure 3 lists the 10 most common antibiotics: amoxicillin, nitrofurantoin, doxycycline, flucloxacillin, trimethoprim, clarithromycin, azithromycin, co-amoxiclav, phenoxymethylpenicillin, and cefalexin.The proportion of each type prescribed in each decile was measured.The consumption of different antibiotic types was closer in the highest decile group than in other deciles.Approximately 32.9% of the prescriptions prescribed in decile 1 were for Amoxicillin.Nitrofurantoin (13.8% to 16.4%) and Doxycycline (12.9% to 15.4%) were highly used and remained stable across the decile.It was noticeable that Azithromycin remained the lowest percentage from decile 1 to decile 9 (0.2% to 2.9%) but surged to 14.3% in decile 10.Trimethoprim presented an upward trend from 5.2% to 13.5% when decile increased.

Sensitivity Analysis for Antibiotic Exposure Interaction
In this sensitivity analysis, the interaction relationships between total antibiotic prescriptions and the other six antibiotic exposure variables were analysed (Supplementary Figure S2A-F).Generally, ORs increased with total antibiotic frequency subgroups from very low to very high users, but the trend varied within each subgroup.When compared to the lowest-level reference group, the ORs of each antibiotic type level were almost identical within subgroups.In contrast, the ORs increased with the levels of broad-spectrum antibiotics and exposure period and decreased with the levels of recent antibiotics within each subgroup.For average and deviation of prescribing intervals, ORs increased slightly

Sensitivity Analysis for Antibiotic Exposure Interaction
In this sensitivity analysis, the interaction relationships between total antibiotic prescriptions and the other six antibiotic exposure variables were analysed (Supplementary Figure S2A-F).Generally, ORs increased with total antibiotic frequency subgroups from very low to very high users, but the trend varied within each subgroup.When compared to the lowest-level reference group, the ORs of each antibiotic type level were almost identical within subgroups.In contrast, the ORs increased with the levels of broad-spectrum antibiotics and exposure period and decreased with the levels of recent antibiotics within each subgroup.For average and deviation of prescribing intervals, ORs increased slightly in very low to high groups, while the highest ORs both appeared at level 1 in the very high subgroup and then went down with the levels.This suggested that for the most frequent antibiotic users, shorter days between repeated prescriptions were at higher risk.

Discussion
This study evaluated the association between the characteristics of antibiotics and the risk of hospital admission or death among patients with a recent COVID-19 infection who had received at least two antibiotic prescriptions in the prior three years.Variables such as the total number of antibiotic prescriptions, the number of antibiotic types, the number of broad-spectrum antibiotic prescriptions, the time between the first and last antibiotic prescriptions, as well as recent antibiotic use, were associated with becoming a case.The different characteristics of antibiotic exposure were found to be associated with the risk of severe COVID-19 outcomes.
Compared to previous research in COVID-19 populations, the population in this study were patients who had used two or more antibiotics in the past three years.They exhibited a higher prevalence of white ethnicity, comorbidities, deprivation, residency in care homes, and a greater likelihood of receiving COVID-19 and influenza vaccinations.Nevertheless, after adjusting for confounding variables, findings are consistent with previous research, which demonstrated that the quantity and diversity of antibiotic exposure were correlated with severe outcomes of COVID-19 infection [11].This study also observed that patients at high risk of severe COVID-19 had received more recent antibiotics within the antibiotic assessment window.This variable, withdrawing prescriptions within the six weeks before COVID-19 onset, was implemented due to a meta-analysis's conclusion that bacterial co-infections were less common in COVID-19 patients [12] and concerns regarding the overuse of antibiotics during the pandemic [13].Considering that patients at higher risk of COVID-19 also had a longer duration between their first and last prescriptions, one plausible interpretation is that these high-risk patients were frequent and long-term users of antibiotics.However, patients with repeated antibiotic use tend to be more likely to be immunosuppressed and susceptible to infections, which may potentially confound the results.Furthermore, a review indicates that older age, males, and pre-existing comorbidities are linked to weaker immunity, which may contribute to the increased severity of COVID-19 [14].Despite age and sex matching in this study, as well as adjustments made for comorbidities, it is essential to stay alert to potential factors that could influence the interpretation of the results.
A key question is what a possible biological mechanism could be behind an increased risk of viral infections (such as COVID-19) with larger and more diverse prior antibiotic exposures.Antibiotics can disrupt the microbiota in the gut as well as the oral and nasal cavities, resulting in a less diverse microbiota [8].The imbalance of the intestinal microbiome may increase the susceptibility to infections by enabling opportunistic pathogens already present in the microbiota to thrive [15].A systematic review by Elvers (2020) suggested that the acute alterations in the gut microbiome would recover to baseline within 1 month after ceasing commonly prescribed antibiotics in primary care, although other studies indicated a longer restitution time of 2-6 months [16].The impact of repeated antibiotic exposures on the microbiota is less well studied.An animal model in rodents found that the gut microbiome disturbance lasted longer with a longer duration of exposure to amoxicillin [17].Thus, intermittent and longer-duration antibiotic use may lead to frequent perturbations, affecting gut microbiota resilience.Furthermore, the gut microbiota serves as a reservoir for antibiotic resistance genes (ARGs), with prolonged treatment linked to increased antimicrobial resistance (AMR) risks [18,19].The present study found that the level of broad-spectrum antibiotic prescribing was associated with a higher risk of severe COVID-19 outcomes.This is consistent with previous research that observed more multi-drug-resistant bacteria in a broad-spectrum antibiotic treatment group compared with the narrow-spectrum group [20].Broad-spectrum antibiotics can also alter both bac-terial and fungal compositions, which have complex interactions in maintaining the gut microbiome [21].Consistent with our findings, several other observational studies have found associations between prior use of antibiotics and increased risks of infections and infection-related complications [10,11,22].
Another key question for assessing the harm-benefit ratio of repeated antibiotic exposure is whether frequent and diverse antibiotic exposure (with the highest risks in this study of severe COVID-19 outcomes) is actually effective in treating common bacterial infections and in reducing infection-related complications.Despite the widespread use of antibiotics and patients in primary care frequently getting multiple courses of an antibiotic over time [22], there is very limited substantive evidence from clinical trials to support this practice.For instance, about 29.1% of patients receive a repeat antibiotic prescription within 30 days of their initial prescription [23].It has been reported that the bacteria of patients using an antibiotic are more likely to become resistant [24].Despite this, treatment guidelines for common infections, such as those in England, seldom tackle the problems associated with frequent antibiotic prescribing, including diminishing effectiveness due to resistance and potential harm from adverse effects on the microbiota [25,26].
The strengths of this study include the use of OpenSAFELY, which covers over 40% of England's population with comprehensive EHRs linked to COVID-19 data.Based on previous research that showed that patients with increased antibiotic usage were related to severe COVID-19 outcomes compared to patients without antibiotics [11], this study provides a more detailed description of antibiotic patterns related to severe COVID-19 by analysing the subgroups of COVID-19 patients with antibiotic use.Another advantage is the use of RF models, which are ideal for identifying high-risk patient subgroups and understanding exposure patterns.As this study attempts to address the combination of different antibiotic exposures, the complexities of regression models increase when considering interaction terms among all antibiotic-related variables.Instead, using Random Forest to create latent variables for summarisation is a more feasible approach.
This study also points out key limitations, including potential confounding factors and the inability to randomise participants' antibiotic use, which might influence the study's outcomes.First, the generalisation of this study might be limited to frequent antibiotic users rather than the general population (about 70% of the COVID-19 patients had only one or no antibiotic prescription).It was challenging to apply classification by including overall COVID-19 patients because redundant information from zero antibiotics predominated.In addition, antibiotic history is not a leading cause of severe COVID-19 but one of the risk factors that may deteriorate the outcome.Nevertheless, the observed harmful effects of repeated antibiotic use in this study should not be overlooked.Given that antibiotics and COVID-19 are both common in the community, this information will be beneficial for consideration in clinical decisions.Second, possible confounding due to reduced immune function in patients with a frequent history of antibiotic prescribing may have been present.However, the question is, even with the confounding present, whether frequent antibiotic use is actually beneficial in treating bacterial infections, considering it might lead to later adverse outcomes due to AMR or gut dysbiosis.Another consideration is that frequent antibiotic prescribing varies considerably between GPs, even after taking into account their case mix [27].Finally, this study did not analyse the infection types, though the literature indicated that most of the antibiotics were poorly coded indications in primary care [27].Future research could address this by exploring the interaction between infections and antibiotic prescribing, such as variability in antibiotic types or duration between antibiotic treatments.
In conclusion, the study found that in patients with antibiotic histories, a higher number of antibiotic prescriptions, a greater variety of antibiotic types, the use of broadspectrum antibiotics, the duration between the first and last prescriptions, and recent antibiotic use are all factors that contribute to an increased risk of severe COVID-19.This highlights the need for more judicious antibiotic prescribing in primary care, primarily for patients with higher risks of infection-related complications, which may better offset the potential adverse effects of repeated antibiotic use.While the signals in this study of the potential harm of repeated antibiotic use are not proven causally, they do suggest repeated antibiotic use negatively influences one's ability to fight future infections.

Data Sources
On behalf of National Health Service (NHS), London, England, we used primary care records from OpenSAFELY-TPP, which comprises nearly 22 million patients' electronic health records (EHRs), covering 40% of the population in England.Patient-level EHRs were linked to the Second Generation Surveillance System (SGSS), the NHS Digital Secondary Use Service (SUS), the COVID-19 Patient Notification System (CPNS), and the Office for National Statistics (ONS, London, UK) to acquire COVID-19 outcomes, including PCR tests, diagnosis of hospitalisation, and cause of death.Data linkage was provided via the OpenSAFELY integrated platform, which is governed by NHS England.

Study Design
This was a matched case-control study.Eligible patients were newly identified as COVID-19 from SGSS positive tests, GP diagnosis records, or SUS hospital admission records from February 2020 to December 2022 (code lists are available in supplementary Table S1).Selection criteria included age from 18 to 110 years old, sex, registration with one GP practice for at least 3 years, and at least two antibiotic prescriptions within 3 years.The study design and the flowchart of patient selection are illustrated in Supplementary Figure S1.Patients who were admitted to the hospital for COVID-19 with a primary diagnosis code of U07.1 or U07.2 (International Classification of Diseases, 10th revision (ICD-10)) were categorised as a case group.Controls were defined as individuals without COVID-19-related hospital admissions (according to SUS data) or death records (from CPNS or ONS) within one month of their COVID-19 diagnosis.

Matching
Each case was matched with replacements for up to six eligible controls using the R package MatchIT v4.2.0 [28].Matching variables included age (within a maximum range of 5 years), sex, region of GP practice, and index date (year and month).Age and sex partially accounted for individual susceptibility to COVID-19 and antibiotic exposure; region and index date accounted for the time and regional variation of COVID-19 infection and antibiotic prescribing.

Antibiotic Exposure
To measure the long-term impact of repeated antibiotic use on COVID-19 outcome severity, the maximum exposure time frame was set at three years, and antibiotic prescriptions in the most recent six weeks were not considered in the analysis because the acute effect of antibiotics was not a major concern in this study.Systemic antibiotics from the British National Formulary (BNF) chapter 5.1 (Antibacterial drugs), excluding both BNF 5.1.9(Antituberculosis drugs) and BNF 5.1.10(Antileprotic drugs), were included in the search strategy.There were 79 antibiotic compounds in the codelist, namely "antibiotic types", and only 55 of them were identified in this study population.The code lists of all antibiotics and broad-spectrum antibiotics are listed in Supplementary Table S1.
Antibiotic exposure was summarised through the following variables: (i) the overall counts of antibiotic prescriptions; (ii) the number of unique types of antibiotics; (iii) the number of broad-spectrum antibiotics; (iv) the number of days between the first and last prescriptions; and (v) the time since the most recent antibiotic, measured as the number of days between the latest prescription and index date.The days between each antibiotic prescription during the exposure period were measured to capture the prescribing frequency, and the (vi) mean and (vii) standard deviation (SD) were calculated to indicate the average and variation of prescribing intervals.These continuous variables were categorised into four levels by quartile in descriptive statistics and sensitivity analysis.A detailed definition was included in Supplementary Table S2.

Confounding
Comorbidities were considered important confounders since they were associated with severe COVID-19 complications and a possibly higher chance of receiving antibiotics.In this study, Charlson comorbidities were measured in the most recent 5 years, and the weighted score was divided into 5 subgroups (no comorbidities, low, medium, high, and very high) in the main analysis [29].Other confounders recorded were ethnicity, body mass index (BMI), smoking status, care home residence, COVID-19, and influenza vaccination.All missing values were grouped as "unknown" as these clinical variables did not meet the "missing at random" assumption for imputation.

Random Forest Model
Random Forest (RF) is a robust machine learning method for classification, relying on an ensemble of decision trees.It enhances accuracy through random sampling (bootstrapping) and feature selection for splits in each tree, making it effective for complex data analysis.Machine learning methods can identify clinical subgroups of patients with regard to outcomes [30] and can be used to classify risk levels of adverse outcomes [31].
Here, RF was applied to generate the probability of being a severe COVID-19 case using antibiotic exposure variables.The dataset was divided, with 80% for training and 20% for validation.After tuning and assessing the model, both sets were combined to refine the final model.The RF model hyperparameters included a 0.6 sample size, 3000 trees, a minimum node size of 800, and a depth of 500.Each split randomly picked 1 variable from a random set of 4 candidate variables by minimising Gini impurity, which enabled the maximisation of tree diversity and the minimisation of correlation between trees [32].The contribution of each variable in the RF model was assessed by the mean decrease Gini score and presented as a variable importance plot.The visualisation ranked variables by their importance relative to the most important one, showcasing their descending order of influence.The RF model then calculated the probability of severe COVID-19 outcomes for individuals.Based on these probabilities, the study population was segmented into ten risk levels using decile cut-offs, with higher levels indicating a greater risk of severe outcomes.This approach allowed for a detailed examination of how antibiotic exposure varies across different risk levels.

Statistical Analysis
Descriptive statistics described differences in baseline characteristics between case and control groups, as well as variations in antibiotic exposure patterns across decile groups.Patients in the same decile group exhibited similar antibiotic exposure, with higher deciles correlating to an increased risk of COVID-19 hospitalisation.The study further assessed the most common antibiotics across deciles.The association between risk deciles and COVID-19 hospitalisation was examined using conditional logistic regression (CLR) to calculate odds ratios (OR), with the first decile as the reference group.The model was adjusted for confounders including ethnicity, BMI, CCI, smoking, IMD, care home, COVID-19, and influenza vaccination.CLR was performed by R package survival v3.2-3, which considered matching strata for both the crude model and the model adjusted for confounders [33].

Sensitivity Analysis
The study analyses the total number of antibiotic prescriptions over three years as a key factor in understanding antibiotic exposure.This variable was crucial as it influenced other variables, such as the exposure period and prescribing interval deviation.To delve deeper, a sensitivity analysis was conducted to understand the interaction relationship between total antibiotics and other antibiotic exposure variables.Total prescriptions were under notices initially issued in February 2020 by the Secretary of State under Regulation 3(4) of the Health Service (Control of Patient Information) Regulations 2002 (COPI Regulations), which required organisations to process confidential patient information for COVID-19 purposes; this set aside the requirement for patient consent [37].As of 1 July 2023, the Secretary of State has requested that NHS England continue to operate the Service under the COVID-19 Directions 2020 [38].In some cases of data sharing, the common law duty of confidence is met using, for example, patient consent or support from the Health Research Authority Confidentiality Advisory Group [39].Taken together, these provide the legal basis for linking patient datasets using the service.GP practices, which provide access to primary care data, are required to share relevant health information to support the public health response to the pandemic, and have been informed of how the service operates.
Data Availability Statement: Access to the underlying identifiable and potentially re-identifiable pseudonymised electronic health record data is tightly governed by various legislative and regulatory frameworks and restricted by best practices.The data in OpenSAFELY is drawn from General Practice data across England, where TPP is the Data Processor.TPP developers (CB, JP, FH, SH, JC) initiate an automated process to create pseudonymised records in the core OpenSAFELY database, which are copies of key structured data tables in the identifiable records.These are linked to key external data resources that have also been pseudonymised via SHA-512 one-way hashing of NHS numbers using a shared salt.DataLab developers and PIs holding contracts with NHS England have access to the OpenSAFELY pseudonymised data tables as needed to develop the OpenSAFELY tools.These tools in turn enable researchers with OpenSAFELY Data Access Agreements to write and execute code for data management and data analysis without direct access to the underlying raw pseudonymised patient data and to review the outputs of this code.All code for the full data management pipelinefrom raw data to completed results for this analysis-and for the OpenSAFELY platform as a whole is available for review at github.com/OpenSAFELY.The data management and analysis code for this paper was led by YY and contributed by JM, VP, XZ, and AF.All data were linked, stored, and analysed securely within the OpenSAFELY platform https://opensafely.org/.Data include pseudonymised data such as coded diagnoses, medications, and physiological parameters.
No free text data is included.All code is shared openly for review and re-use under the MIT open license (https://github.com/opensafely/amr-uom-brit/(accessed on 4 July 2023)).Detailed pseudonymised patient data is potentially re-identifiable and therefore not shared.We rapidly delivered the OpenSAFELY data analysis platform without prior funding to deliver timely analyses on urgent research questions in the context of the global COVID-19 health emergency.Now that the platform is established, we are developing a formal process for external users to request access in collaboration with NHS England; details of this process will be published shortly on OpenSAFELY.org.

Figure 1 .
Figure 1.Variable importance plot based on the RF model.All antibiotic exposure variables were assessed in the prior 3 years, which started with 3 years plus 6 weeks before COVID-19 outcome and completed the whole 3-year observation.Antibiotics in the 6 weeks before the COVID-19 onset were excluded from the study design.Antibiotic-related variables included: 1.The prescribing interval was estimated for each individual by collecting the number of days between each antibiotic prescription.The average of prescribing intervals was shown as the mean. 2. time from the last antibiotic prescription until COVID-19 onset. 3. The prescribing interval was estimated for each individual by collecting the number of days between each antibiotic prescription.The deviation of prescribing intervals was shown as the standard deviation.4.time between the first prescription and the last antibiotic prescription.5.count of the total number of antibiotic prescriptions.6.count of unique types of prior antibiotic prescriptions.7.count of prior broad-spectrum antibiotic prescriptions.

Figure 1 .
Figure 1.Variable importance plot based on the RF model.All antibiotic exposure variables were assessed in the prior 3 years, which started with 3 years plus 6 weeks before COVID-19 outcome and completed the whole 3-year observation.Antibiotics in the 6 weeks before the COVID-19 onset were excluded from the study design.Antibiotic-related variables included: 1.The prescribing interval was estimated for each individual by collecting the number of days between each antibiotic prescription.The average of prescribing intervals was shown as the mean. 2. time from the last antibiotic prescription until COVID-19 onset. 3. The prescribing interval was estimated for each individual by collecting the number of days between each antibiotic prescription.The deviation of prescribing intervals was shown as the standard deviation.4.time between the first prescription and the last antibiotic prescription.5.count of the total number of antibiotic prescriptions.6.count of unique types of prior antibiotic prescriptions.7.count of prior broad-spectrum antibi-

Figure 2 .
Figure 2. Distribution of antibiotic exposure characteristics across risk decile groups.(a) total antibiotics (counts); (b) antibiotic types (counts); (c) broad-spectrum antibiotics (counts); (d) time between (first to last antibiotics) (days); (e) recent antibiotics (days); (f) prescribing intervals average (days); (g) prescribing intervals deviation (days).All antibiotic exposure variables were assessed in the prior 3 years, which started from 3 years plus 6 weeks before the COVID-19 outcome and completed the whole 3-year observation.Antibiotics in the 6 weeks before COVID-19 onset were

Figure 3 .
Figure 3.The proportion of antibiotic types in each decile group.

Figure 3 .
Figure 3.The proportion of antibiotic types in each decile group.

Table 1 .
Baseline characteristics for cases and controls stratified by outcome.
1.The counts of patients were rounded to the nearest five numbers in line with disclosure controls.2.BMI, or body mass index as most recent recorded within the previous 5 years.3.CCI, Charlson Comorbidities Index, measured from 17 weighted conditions, including Myocardial infarction, Congestive heart failure, Peripheral vascular disease, Cerebrovascular disease, Dementia, Chronic pulmonary disease, Connective tissue disease, Ulcer disease, Mild liver disease, Diabetes, Hemiplegia, Moderate or severe renal disease, Diabetes with complications, Any malignancy (including leukaemia and lymphoma), Moderate or severe liver disease, Metastatic solid tumour, and AIDS.

Table 3 .
Antibiotic characteristics by RF decile groups.