key: cord-0257103-35qpvlue authors: MacKenna, B.; Kennedy, N. A.; Mehkar, A.; Rowan, A.; Galloway, J.; Mansfield, K. E.; Bechman, K.; Matthewman, J.; Yates, M.; Brown, J.; Schultze, A.; Norton, S.; Walker, A. J.; Morton, C. E.; Harrison, D.; Bhaskaran, K.; Rentsch, C. T.; Williamson, E.; Croker, R.; Bacon, S.; Hickman, G.; Ward, T.; Davy, S.; Green, A.; Fisher, L.; Hulme, W.; Bates, C.; Curtis, H. J.; Tazare, J.; Eggo, R. M.; Evans, D.; Inglesby, P.; Cockburn, J.; McDonald, H. I.; Tomlinson, L. A.; Mathur, R.; Wong, A. Y.; Forbes, H.; Parry, J.; Hester, F.; Harper, S.; Douglas, I. J.; Smeeth, L.; Lees, C. W.; Evans, S. J.; Golda, title: Risk of severe COVID-19 outcomes associated with immune-mediated inflammatory diseases and immune modifying therapies: a nationwide cohort study in the OpenSAFELY platform date: 2021-09-10 journal: nan DOI: 10.1101/2021.09.03.21262888 sha: 104f028537605c9097f734c0743fe97a14854d8b doc_id: 257103 cord_uid: 35qpvlue Background It is unclear if people with immune-mediated inflammatory diseases (IMIDs) (joint, bowel and skin) and on immune modifying therapy have increased risk of serious COVID-19 outcomes. Methods With the approval of NHS England we conducted a cohort study, using OpenSAFELY, analysing routinely-collected primary care data linked to hospital admission, death and previously unavailable hospital prescription data. We used Cox regression (adjusting for confounders) to estimate hazard ratios (HR) comparing risk of COVID-19-death, death/critical care admission, and hospitalisation (March to September 2020) in: 1) people with IMIDs compared to the general population; and 2) people with IMIDs on targeted immune modifying drugs (e.g., biologics) compared to standard systemic treatment (e.g., methotrexate). Findings We identified 17,672,065 adults; of 1,163,438 (7%) with IMIDs, 19,119 people received targeted immune modifying drugs, and 200,813 received standard systemics. We saw evidence of increased COVID-19-death (HR 1.23, 95%CI 1.20, 1.27), and COVID-19 hospitalisation (HR 1.32, 95%CI 1.29, 1.35) in individuals with IMIDs overall compared to individuals without IMIDs of the same age, sex, deprivation and smoking status. We saw no evidence of increased COVID-19 deaths with targeted compared to standard systemic treatments (HR 1.03, 95%CI 0.80, 1.33). There was no evidence of increased COVID-19-related death in those prescribed TNF inhibitors, IL-12/23, IL7, IL-6 or JAK inhibitors compared to standard systemics. Rituximab was associated with increased COVID-19 death (HR 1.68, 95%CI 1.11, 2.56); however, this finding may relate to confounding. Interpretation COVID-19 death and hospitalisation was higher in people with IMIDs. We saw no increased risk of adverse COVID-19 outcomes in those on most targeted immune modifying drugs for IMIDs compared to standard systemics. Although most people with coronavirus disease 2019 (COVID-19) experience mild symptoms, 15% develop pneumonia requiring hospitalisation, and 5% progress to severe disease (systemic hyperinflammation, major coagulation problems and acute respiratory distress, with risk of multiorgan failure and death) (of unvaccinated individuals). 1 It is unclear to what extent having immune-mediated inflammatory diseases (IMIDs) -including inflammatory joint (rheumatoid arthritis [RA] , psoriatic arthritis [PsA], ankylosing spondylitis [AS]), bowel (Crohn's disease, ulcerative colitis [UC]), and skin (psoriasis, hidradenitis suppurativa [HS]) diseases -or being on targeted immune modifying therapies for IMID treatment, increases severe COVID-19 outcomes. 2 Different strategies have been implemented worldwide to limit infection spread. Policies were initially informed by expert opinion and subsequently by risk estimates for COVID-19 death. 3 Early in the pandemic, the UK government issued guidance through the National Health Service (NHS), known as "shielding", advising individuals considered at high risk of severe COVID-19 to stay at home, minimising face-to-face contacts. Shielding advice targeted individuals identified using health records as having specific immunosuppressive diseases or prescriptions for immune modifying drugs. 4 Many people with IMIDs taking immune modifying therapies were considered "high risk", based on prior evidence in other infections. 5, 6 Disease-specific registries have been used to evaluate COVID-19 risks in individuals with IMIDs and those prescribed immune modifying therapies; results have largely been reassuring. 7-9 However, disease-specific registries are limited by small sample sizes, inherent selection bias, and lack of denominators. OpenSAFELY-TPP is a new secure analytics platform for electronic health records (EHRs) to deliver pandemic-related research. We aimed to investigate risks of severe COVID-19 outcomes in people with IMIDs and those on targeted immune modifying therapies using English population-based EHR data linked to a new unique national dataset containing information on targeted immune modifying therapies. We conducted a cohort study using electronic health record (EHR) data. We compared risks of COVID-19-related death, critical care admission or death, and hospital admission in: 1) people with IMIDs compared to the general population; and 2) in people with IMIDs prescribed targeted immune modifying drugs compared to those with IMIDs taking standard systemic immune modifying drugs. We used primary care records managed by the GP software provider TPP linked to: Office for National Statistics (ONS) death data, COVID-19 testing data, and a unique national hospital medications dataset (including "high-cost drugs", typically newer, more expensive medications [e.g., adalimumab] supplied by hospitals for ongoing disease management, Supplementary Text S1). We accessed all data through OpenSAFELY, a data analytics platform created by our team for NHS England (https://opensafely.org). OpenSAFELY provides a secure software interface allowing analysis of pseudonymized primary care records in near real-time within the EHR vendor's highly secure data centre, avoiding the need for data transfer off-site (minimising re-identification risk). Similarly, pseudonymized datasets from other data providers are securely provided by the EHR vendor and linked to primary care data. The dataset analysed within OpenSAFELY was based on 24 million people currently registered with GP surgeries. Our overall study population included adults aged 18 -110 years (March 2020), registered with TPP practices with at least 12 months of primary care records prior to March 2020 (Figure 1) . We followed individuals from March 1 st , 2020 (UK SARS-Cov-2 outbreak start) until 30 th September 2020 (study end), or until the specific outcome under analysis (i.e., COVID-19related: death, critical care admission or death, or hospitalisation). We compiled diagnostic and therapeutic code lists (in machine readable languages, e.g., SNOMED-CT, NHS dictionary of medicines and devices) for all study variables (exposures, outcomes, covariates). Detailed information on compilation and sources of code lists are freely available for inspection and re-use (https://codelists.opensafely.org/). Exposures were: 1) IMIDs: inflammatory joint disease (RA, PsA, AS), inflammatory bowel disease (IBD) (Crohn's disease, UC, IBD unclassified), and inflammatory skin disease (psoriasis, HS); and 2) prescription of systemic immune modifying medication by general practitioners or supplied by hospitals through high-cost drugs procedures. We identified people with IMIDs using diagnostic morbidity codes in primary care during the three years prior to March 1 st , 2020. People with IMID diagnoses in multiple categories (e.g., inflammatory joint and skin disease) contributed to comparisons with the general population for all IMID categories they had records for (e.g., individuals with PsA and psoriasis, contributed to both joint and skin disease). Immune modifying medications were categorised as standard systemic therapy and targeted therapy. Standard systemic therapies included leflunomide, methotrexate, mycophenolate mofetil or mycophenolic acid, ciclosporin, sulphasalazine, mercaptopurine, thioguanine, and azathioprine. Targeted therapies included biologic therapies: TNF inhibitors (etanercept, adalimumab, golimumab, certolizumab, infliximab, and biosimilar versions of these medications), IL-17 inhibitors (secukinumab, ixekizumab, brodalumab), IL-12/23 inhibitors (ustekinumab, guselkumab, risankizumab, tildrakizumab), IL-6 inhibitors (tocilizumab, sarilumab), B-cell depletion therapy (rituximab), and novel small molecules: Janus Kinase (JAK) inhibitors (baricitinib, tofacitinib). 10-15 Individuals treated with both systemic therapy and targeted therapies were considered exposed to targeted therapies. We identified standard systemic therapies using primary care prescribing data. We identified targeted immune modifying medications using high-cost drugs invoicing (Supplementary Text S1). Drug exposure was defined by at least one prescription, or delivery of medication to an individual before March 1 st , 2020 (date chosen as some of medications were either specifically used, or stopped, due to the pandemic). For each individual, we defined drug exposure based on the closest drug recorded prior to the study start (March 1 st 2020) allowing for a maximum of 6 months before the start of the study for all agents apart from rituximab, where we permitted a 12-month exposure window (to allow for the frequency of treatment and the longer duration of response of rituximab, including known prolonged effects on vaccine responses). 16 , 17 We could not evaluate medication switching or adherence during the follow-up period, as data were only available up to March 2020. Outcomes were COVID-19-related death, critical care admission or death, and hospitalisation. We identified COVID-19-related deaths based on records of COVID-related ICD-10 codes (U071, U072) anywhere on death certificates. We used COVID-19-related critical care admission (Intensive Care National Audit & Research Centre 18 ) or death as a combined endpoint to reflect individuals with severe COVID-19 who died without being admitted to a critical care unit for critical care admission. We identified COVID-19-related hospitalisation as a positive polymerase chain reaction (PCR) test less than 28 days before admission and, up to 5 days post admission to exclude nosocomial infection. We selected potential confounders and mediators a priori based on clinical knowledge and prior evidence. 2 In the relationship between IMIDs and severe COVID-19 outcomes, we considered age (categorical variable), sex, deprivation (using quintiles of Index of Multiple Deprivation), 19, 20 and smoking status to be potential confounders; we considered BMI, cardiovascular disease, diabetes and current glucocorticoid use to be potential mediators. In the relationship between (choice of) immune modifying therapy and severe COVID-19 outcomes we considered age, sex, deprivation, smoking status, BMI, specific IMID (inflammatory joint, bowel and skin disease), cardiovascular disease, cancer (excluding non-melanoma skin cancer), stroke, end stage renal failure, chronic liver disease, chronic respiratory disease and diabetes mellitus as potential confounders; we considered current glucocorticoid use as a potential mediator. Details of covariate definitions are included in Supplementary Text S2. Figures representing assumed relationships between covariates, primary exposures and outcomes are in Supplementary Figures S1 and S2. We initially described characteristics of the general population, people with IMIDs, and those with IMIDs prescribed immune modifying therapy. We used Cox regression to estimate hazard ratios (HR) (95%CI), comparing people with IMIDs to the general population, and people with IMIDs on standard systemic drugs to those on targeted therapies. We adjusted models for confounding based on assumptions inherent in our conceptual frameworks (Supplementary Figures S1, S2) . For comparisons between those with IMIDs to the general population, we adjusted for age, sex, deprivation, and smoking. For comparisons between those on targeted therapies to those on standard systemic drugs, we adjusted for age, sex, deprivation, obesity (BMI>=30), smoking, IMIDs (bowel, joint, skin), and comorbidities (cardiovascular disease, diabetes mellitus, cancer, stroke, end stage renal failure, chronic liver disease, chronic respiratory disease). We also fitted models adjusted for additional covariates considered to be mediators. We tested Cox model assumptions using Schoenfeld residuals. We repeated our main analyses in sensitivity analyses assessing robustness of our findings (Supplementary Table S1 , Text S3). We considered immune-mediated inflammatory disease severity and degree of shielding to be potential unmeasured confounders of associations between specific immune-modifying therapy and COVID-19 outcomes. We therefore conducted quantitative bias analysis using E-values to assess how strongly associated unmeasured confounders would need to be with exposure and outcome to potentially fully explain observed non-null associations (i.e., association adjusted for both measured covariates and the unmeasured confounder would be null). 21 We used Python for data management, and Stata 16/Python for analyses. All code used for data management and analyses is available online (https://github.com/opensafely/immunosuppressant-meds-research) including all iterations of the pre-specified study protocol archived with version control. Patients were not formally involved in developing this study design, which was developed rapidly during a pandemic. We invite patients or members of the public to contact us through our website https://opensafely.org/ regarding this study or the broader OpenSAFELY project. Our protocol and paper preprint have been sent to Crohn's and Colitis UK, Psoriasis Association, National Rheumatoid Arthritis Society, and Versus Arthritis for review from an expert-patient perspective. The study was approved by the Health Research Authority (Research Ethics Committee reference 20/LO/0651) and the London School of Hygiene and Tropical Medicine's Ethics Board (Reference 21863). All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. Of 17,672,065 people in the overall study population (Supplementary Figure S3) , 1,163,438 (7%) had an IMID diagnosis ( Table 1) . Of those with IMIDs: 1) 23% (n=272,452) had inflammatory joint disease (RA 16% n=183,485, PsA 5% n=54,593, AS 3% n=35,138); 2) 17% (n=199,037) had IBD (Crohn's 35% n=69,788, UC 51% n=100,617, unclassified IBD 16% n=32,093); and 3) 66% (n=769,816) had inflammatory skin disease (psoriasis 90% n=693,178, HS 10% n=76,746). Compared to the general population, people with IMIDs were older (>=70 years: 25% versus 17% in the general population), more likely to be female (55% versus 50%), of white ethnicity (71% versus 64%), obese (BMI>=30, 30% versus 22%), and with more comorbidities (e.g., cardiovascular disease: 11% versus 7%: diabetes mellitus: 16% versus 11%) ( Table 1) . There were differences between individuals with inflammatory joint, skin and bowel diseases, for example, individuals with inflammatory joint disease were older compared to those with IBD or inflammatory skin disease (>=70 years: 35.3% joint, 23.4% IBD, 21.1% skin). After adjusting for potential confounders (age, sex, deprivation, BMI, IMIDs [bowel, joint, skin], cardiovascular disease, cancer, stroke, diabetes mellitus), we saw no evidence of differences in COVID-19-related death in individuals on targeted therapy overall compared to individuals on standard systemic therapy (HR 1.03, 95%CI 0.80,1.33) (Figure 3 , Supplementary Table S6 ). Compared to individuals on standard systemic therapy, there was no observed increased risk of COVID-19 related death in individuals on TNF inhibitors, IL-12/23 inhibitors, IL7 inhibitors, JAK inhibitors or IL-6 inhibitors (although confidence intervals were wide). Compared to individuals on standard systemic therapy, people receiving rituximab had an increased risk of COVID-19related death (HR 1.68, 95%CI 1.11, 2.56), based on 24 deaths in the rituximab group. After adjusting for confounders, compared to individuals on standard systemic therapy, there was no increase in COVID-19-related critical care admission or death in individuals on TNF inhibitors, IL-12/23 inhibitors, IL-17 inhibitors, JAK inhibitors or IL-6 inhibitors. People receiving rituximab had increased risk of critical care admission or death (HR 1.92, 95%CI 1.31, 2.81), based on 29 events in the rituximab group. After adjusting for confounders, compared to individuals on standard systemic therapy, there was no difference in risk of COVID-19-related hospitalisations in individuals on TNF inhibitors, All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. Excluding people with haematological cancers and organ transplants attenuated the effect estimate for rituximab (HR 1.54, 95%CI 0.95, 2.49; 18 events). Otherwise, results from sensitivity analyses were similar to the main analysis (Supplementary Tables S7-S11). In quantitative bias analysis comparing individuals with IMIDs taking rituximab or JAK inhibitors to standard systemics we note an unmeasured confounder moderately associated with both exposure and outcome could potentially explain associations of rituximab (by at least a risk ratio of 1.68) and JAK inhibitors (by at least a risk ratio of 1.81) with adverse COVID-19 outcomes. All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. In this large population-based study using data fromOpenSAFELY, we found that people with IMIDs experience higher rates of COVID-19-related death, critical care admission and death, and hospitalisation than people without IMIDs of the same age, sex, deprivation and smoking status. We demonstrated that compared to standard systemic immune modifying therapies for IMIDs, there was no increased risk of COVID-19-related death in those prescribed TNF, IL-12/23, IL7, IL-6 or JAK inhibitors. However, rituximab was associated with an increased risk of death (HR 1.64, 95%CI 1.08, 2.49) and critical care admission,which may relate to confounding. Our findings -suggesting that people with IMIDs were at increased risk of COVID-19-related death compared to people without IMIDs of the same age, sex, deprivation, and smoking status -have not previously been reported. This study provides granular data on a range of IMIDs but is consistent with previous less detailed analyses. 22 Our finding that those with IMIDs were more likely to be hospitalised for COVID-19 compared to the general population is consistent with Canadian and Danish cohort studies 232423 and reports of adverse COVID-19 outcomes for people with specific IMIDs. 25 However, factors leading to adverse COVID-19 outcomes are likely multifactorial, with possible explanations including more severe symptoms following COVID-19, unmeasured confounders, better access to care, or a lower physician threshold for admission in those on immune modifying drugs. There are no comparable population-based data sources including information on COVID-19 outcomes in those on targeted therapies for IMIDs. Our observation that those on targeted therapies do not have an increased risk of COVID-19 related death is consistent with data from international registries. 7-9 Compared to our findings, a recent meta-analysis using data from registries included 2,766 individuals with autoimmune diseases and COVID-19 diagnoses, reported higher rates of hospitalisation and death in people prescribed combination standard systemic therapy and biologics or JAK inhibitors, but lower rates in those prescribed TNF inhibitor monotherapy. 26 The Global Rheumatology Alliance reported no increase in COVID-19related death with biologic therapies or JAK inhibitors compared to methotrexate monotherapy, but an increase in COVID-19-related death with rituximab. 8 The Surveillance Epidemiology of Coronavirus Under Research Exclusion for Inflammatory Bowel Disease (SECURE-IBD) reported no association in COVID-19-related death, critical care or hospitalisation in people on TNF inhibitors compared to those not prescribed TNF inhibitor therapy. 7 Our observed increased risk of critical care admission or death in people treated with rituximab is consistent with previous reports of increased mortality in people treated with B cell depleting agents (e.g., rituximab for oncology indications). 27 Explanations could include mechanistic roles of B cells in COVID-19 immune responses, unmeasured characteristics of the RA population treated with rituximab or confounding by severity (i.e., rituximab is preferentially prescribed for seropositive disease, with extra-articular manifestations including pulmonary fibrosis) or by cancer. 16 We were underpowered to assess effects of regular tocilizumab on COVID-19 outcomes, although trial data has shown benefit in hospitalised and critically ill patients. 28,29 The key strengths of this study are the scale and completeness of underlying raw EHR data. The OpenSAFELY platform accesses an unprecedented scale of data; the full dataset of all raw, single-event-level clinical events for all individuals at 40% of all GP practices in England, including all tests, treatments, diagnoses, and clinical and demographic information linked to various sources of hospital data including, for the first time, a comprehensive dataset of medications supplied by hospitals. We recognise some limitations. Although English primary care records are longitudinal and comprehensive, certain confounders were not captured. Shielding, as recommended for groups of clinically vulnerable people by the Chief Medical Officer, 30 may have reduced the risk of infection, thus likely biasing results towards the null. In mediator adjusted models, we adjusted for concomitant use of oral glucocorticoids, however this adjustment is likely to be imperfect, leading to residual confounding. We also considered cardiovascular disease and diabetes mellitus to be mediators in the relationship between IMIDs and severe COVID-19 outcomes, however the timing of mediator assessment at index means they could have predated the IMID diagnosis, and hence not be true mediators. Assessment of glucocorticoid doses and usage is challenging due to absent precise dose information, prescribing of reducing dose regimens, low-cost medication administered in hospital alongside high-cost drugs, pandemic stockpiling and patient-led discontinuation due to COVID-19-related concerns (may also apply to immune modifying medication). Finally, as with any large study using routinely-collected data, there is a possibility of misclassification of exposure status. Misclassification of high cost drug exposure is unlikely, as high cost drug information is critical for billing. However, it is possible that we may have systematically excluded some individuals taking standard systemic drugs from analyses comparing targeted to standard systemic therapies. These exclusions may result in underestimation of risks in the standard systemic group due to differential exclusion of "new starters", where the first prescription was in hospital. In practice, we expect the effects of this misclassification to be minimal due to the short time window. We have used one of the largest population-based datasets globally with linked data on immune modifying drugs to describe COVID-19 risks for people with IMIDs. We found that COVID-19 death and hospitalisation were higher in people with IMIDs; however, we saw no increased risk of adverse COVID-19 outcomes in those on most targeted immune modifying drugs for IMIDs compared to standard systemics. The availability of the "high-cost" novel data fills an important gap in available UK EHR data, and routine availability of these data is essential for future research. Our findings provide an evidence-base to inform policy on booster vaccination prioritisation and risk mitigating behaviour advice, but must be interpreted in the context of UK public health policy on shielding. Findings will support health care professionals engaging in shared decision making and communication of risk. All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. The copyright holder for this this version posted September 10, 2021. ; https://doi.org/10.1101/2021.09.03.21262888 doi: medRxiv preprint People with diagnoses across subcategories contributed to multiple categories (e.g., someone with psoriasis and PsA, contributed to both skin and joint categories of IMID), therefore individuals may be included in more than one IMID category. *Glucocorticoid use refers to individuals with one or more prescriptions for any dose of oral glucocorticoid in the last 3 months prior to study start. ** Ethnicity data are included for interest. However, ethnicity was not adjusted for in the main analysis due to the high proportion of missing data, although we did adjust for ethnicity in a sensitivity analysis (Supplementary Table S3) . Abbreviations: IMID, immune mediated inflammatory disease; BMI, Body mass index; Hba1c: glycosylated haemoglobin. All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. †Cells with counts less than 5 are redacted to protect anonymity. People with diagnoses across subcategories contributed to multiple categories (e.g., someone with psoriasis and PsA, contributed to both skin and joint categories of IMID), therefore individuals may be included in more than one targeted immune modifying treatment category. Individuals treated with both systemic therapy and targeted therapy were included in the targeted therapy cohort. *Standard systemic therapies included leflunomide, methotrexate, mycophenolate mofetil or mycophenolic acid, ciclosporin, sulphasalazine, mercaptopurine, thioguanine, and azathioprine. ** Glucocorticoid use refers to individuals with 1 or more prescription for any dose of oral glucocorticoid in the 3 months prior to study start. *** Ethnicity data are included for interest. However, ethnicity was not adjusted for in the main analysis due to the high proportion of missing data, although we did adjust for ethnicity in a sensitivity analysis (Supplementary Table S7) . Abbreviations: IMID, immune mediated inflammatory disease; BMI, Body mass index; Hba1c, glycosylated haemoglobin; TNFi, TNF inhibitors; IL-17i, IL-17 inhibitors; IL-12/23i, IL-12/23 inhibitors; IL-6i, IL-6 inhibitors; JAKi, JAK inhibitors. Figure 1 . Study design All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. The copyright holder for this this version posted September 10, 2021. ; https://doi.org/10.1101/2021.09.03.21262888 doi: medRxiv preprint Figure 2 . Forest plot of hazard ratios (HRs) for COVID-19-related death, critical care admission/death and hospitalisation for IMID vs general population Planned comparisons were made between people with IMIDs, and IMID types (joint, bowel, skin), using the general population as the reference group. Minimally adjusted: age and sex Confounder adjusted (IMID): age, sex, deprivation, smoking status All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. The copyright holder for this this version posted September 10, 2021. ; https://doi.org/10.1101/2021.09.03.21262888 doi: medRxiv preprint Mediator adjusted (IMID): age, sex, deprivation, smoking status, BMI, cardiovascular disease, diabetes, current glucocorticoid use Abbreviations: HR, hazard ratio; CI, confidence interval; PY, person years; IMID, immune mediated inflammatory disease; BMI, body mass index; ICU: intensive care unit (critical care admission). NB: There was a small variation in the event counts for the IMID subtype analyses (inflammatory joint, bowel and skin disease). The general population event counts shown in this figure are for the all-IMID compared to general population analyses. All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. Planned comparisons were made between people with IMIDs on any targeted immune modifying therapy (and for each group on specific targeted therapies) compared to people with IMIDs on standard systemic therapy as the reference group. # Cells with counts less than 5 are redacted to protect anonymity. Minimally adjusted: age and sex Confounder adjusted: age, sex, deprivation, smoking status, BMI, specific IMID (inflammatory joint, bowel and skin disease), cardiovascular disease, cancer (excluding non-melanoma skin cancer), stroke, end stage renal failure, chronic liver disease, chronic respiratory disease and diabetes mellitus All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. The copyright holder for this this version posted September 10, 2021. ; https://doi.org/10.1101/2021.09.03.21262888 doi: medRxiv preprint Mediator adjusted: age, sex, deprivation, smoking status, BMI, specific IMID (inflammatory joint, bowel and skin disease), cardiovascular disease, cancer (excluding non-melanoma skin cancer), stroke, end stage renal failure, chronic liver disease, chronic respiratory disease, diabetes mellitus and current glucocorticoid use Abbreviations: HR, hazard ratio; CI, confidence interval; PY, person years; IMID, immune mediated inflammatory disease; BMI, body mass index; ICU, intensive care unit (critical care admission). NB: There was a small variation in the event counts for the IMID subtype analyses (inflammatory joint, bowel and skin). The general population event counts shown in this figure are for the all-IMID compared to general population analyses. All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. We are very grateful for all the support received from the TPP Technical Operations team throughout this work, and for generous assistance from the information governance and database teams at NHS England / NHSX. Additionally the North East Commissioning Support Unit provided support on behalf of all Commissioning Support Unit to aggregate the high cost drugs data. This study uses electronic health records, data are provided by patients and collected by the National Health Service as part of their care and support. We are very grateful to Professor Joe West from the University of Nottingham and Professor Daniel Prieto-Alhmabra for comments on an early version of the protocol. All authors have completed the ICMJE uniform disclosure form at www.icmje.org/coi_disclosure.pdf and declare the following: BG has received research funding from Health Data Research UK (HDRUK), the Laura and John Arnold Foundation, the Wellcome Trust, the NIHR Oxford Biomedical Research Centre, the NHS National Institute for Health Research School of Primary Care Research, the Mohn-Westlake Foundation, the Good Thinking Foundation, the Health Foundation, and the World Health Organisation; he also receives personal income from speaking and writing for lay audiences on the misuse of science. IJD has received unrestricted research grants and holds shares in GlaxoSmithKline (GSK). CS received departmental research funding from AbbVie, Boehringer Ingelheim, Glaxo SmithKline, Leo, Pfizer, Novartis, Regeneron, SwedishOrphan Biovitrum AB, and Roche and is an investigator within consortia that have industry partners (see biomap.eu and psort.org.uk). JG has received honoraria from Abbvie, Amgen, Celgene, Chugai, Galapagos, Gilead, Janssen, Lilly, Novartis, Pfizer, Roche, Sobi, and UCB, and has research funding from Amgen, Aztra-Zeneca, Gilead, Janssen, Medicago, Novovax and Pfizer. MY has received honoraria from AbbVie and UCB. CWL has received honoraria from Abbvie, Celltrion, Ferring, Galapagos, Gilead, GSK, Iterative Scopes, Janssen, Pfizer and Takeda. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. Funders had no role in the study design, collection, analysis, and interpretation of data; in the writing of the report; and in the decision, submit the article for publication. This research was funded in whole or in part by the Wellcome Trust [G205039/Z/16/Z]. For the purpose of Open Access, the author has applied a CC BY public copyright licence to any Author Accepted Manuscript (AAM) version arising from this submission NHS England is the data controller; TPP is the data processor; and the key researchers on OpenSAFELY are acting on behalf of NHS England. This implementation of OpenSAFELY is hosted within the TPP environment which is accredited, the ISO 27001 information security standard and is NHS IG Toolkit compliant; 31,32 patient data has been pseudonymised for analysis and linkage using industry standard cryptographic hashing techniques; all pseudonymised datasets transmitted for linkage onto OpenSAFELY are encrypted; access, the platform is via a virtual private network (VPN) connection, restricted, a small group of researchers; the researchers hold contracts with NHS England and only access the platform, initiate database queries and statistical models; all database activity is logged; only aggregate statistical outputs leave the platform environment following best practice for anonymisation of results such as statistical disclosure control for low cell counts. 33 The OpenSAFELY research platform adheres, the obligations of the UK General Data Protection Regulation (GDPR) and the Data Protection Act 2018. In March 2020, the Secretary of State for Health and Social Care used powers under the UK Health Service (Control of Patient Information) Regulations 2002 (COPI), require organisations, process confidential patient information for the purposes of protecting public health, providing healthcare services, the public and monitoring and managing the COVID-19 outbreak and incidents of exposure; this sets aside the requirement for patient All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. The copyright holder for this this version posted September 10, 2021. ; https://doi.org/10.1101/2021.09.03.21262888 doi: medRxiv preprint consent. 34 Taken together, these provide the legal bases, link patient datasets on the OpenSAFELY platform. GP practices, from which the primary care data are obtained, are required, share relevant health information, support the public health response, the pandemic, and have been informed of the OpenSAFELY analytics platform. This study was approved by the Health Research Authority (REC Reference 20/LO/0651) and by the LSHTM Ethics Board (Reference 21863). All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. The copyright holder for this this version posted September 10, 2021. ; https://doi.org/10.1101/2021.09.03.21262888 doi: medRxiv preprint SUPPLEMENTARY MATERIAL Text S1. High-cost drugs dataset To achieve a comprehensive national medicines dataset, we arranged for the unique collation of a single national hospital medication dataset for "high-cost drugs". High-cost drugs are typically newer and more expensive medications (e.g., adalimumab) that are supplied by hospitals in England for ongoing disease management. High-cost drugs are paid for by commissioners (in England, National Health Service Clinical Commission Groups commission most secondary care services and play a part in the commissioning of GP services) and as part of this process, unique patient identifiers are supplied by hospitals, the responsible commissioner (there are approximately 200 commissioners). The North East Commissioning Support Unit collected highcost drug data from commissioners and compiled it into a single national dataset (including medication name, date of medication supply and a unique patient identifier -NHS numberallowing linkage with other healthcare data). To our knowledge this is the first time in England that a comprehensive national medicines dataset including high-cost drug data has been available at individual patient level. More information is available in our accompanying short data report.[link will be provided in published paper] Drug exposure was defined by at least one prescription, or delivery of medication to an individual before March 1 st , 2020 (date chosen as some of medications were either specifically used, or stopped, due to the pandemic). For each individual, we defined drug exposure based on the closest drug recorded prior to the study start (March 1 st 2020) allowing for a maximum of 6 months before the start of the study for all agents apart from rituximab, where we permitted a 12-month exposure window (to allow for the frequency of treatment and the longer duration of response of rituximab, including known prolonged effects on vaccine responses). 16,17 We could not evaluate medication switching or adherence during the follow-up period, as data was only available up to March 2020. All analytical code for all covariates definitions are openly available online for inspection and reuse. Some brief descriptions are provided below. Age was defined by the age reached by the 1 st March 2020 (study start date). We categorised age groups as: 18-39, 40-49, 50-59, 60-69, 70-79 and 80+ years. We categorised smoking status as current-, former-or never-smokers, based on primary care morbidity coding recorded prior to March 1 st , 2020. People with missing smoking status were categorised as never smokers. Body mass index (BMI) was calculated from height and weight measures recorded in primary care, based on weight measurements within the last 10 years (before March 1 st , 2020), and restricted to records from after age 16 years. BMI was categorised according to World Health Organisation (WHO) BMI classification: no evidence of obesity (BMI < 30); obese class I (BMI 30-34.9); obese class II (BMI 35-39.9); and obese class III (BMI 40+). Individuals with missing BMI data were categorised as having no evidence of obesity (i.e., BMI < 30). We undertook a sensitivity analysis without re-categorising missing BMI and smoking status data (i.e., complete-case analysis of only those with complete smoking and BMI data). Our approach reflects an awareness that BMI and smoking data are likely to be not missing at random, and has precedent in previous OpenSAFELY analyses. 1, 2 We defined current glucocorticoid use based on a primary care prescription of oral prednisolone at any dose in the three months before study start. We defined diabetes mellitus based on the most recent glycosylated haemoglobin (Hba1c) measurement recorded in primary care at any time before study start (March 1 st , 2020): controlled diabetes Hba1c<58mmol/mol; uncontrolled diabetes Hba1c≥58mmol/mol; or diabetes (based on morbidity coded diabetes) with no recorded Hba1c measure. We defined end stage renal failure based on estimated glomerular filtration rate calculated from the most recent serum creatinine result recorded 15 months before study start (March 1 st , 2020) in primary care data. We only adjusted for end stage renal failure in sensitivity analyses. We defined ethnicity based on coding in primary care. We classified ethnicity as: White, Black, South Asian, and mixed or other. We only adjusted for ethnicity in sensitivity analyses due to the large proportion of missing data (Tables 1 and 2) . We defined cardiovascular disease (chronic heart failure, ischaemic heart disease, and severe valve or congenital heart disease likely to require lifelong follow-up), cancer (excluding nonmelanoma skin cancer), and stroke based on any morbidity coding in primary care recorded prior to March 1 st , 2020 (study start date). We also adjusted for chronic respiratory disease (chronic obstructive pulmonary disease, fibrosing lung disease, bronchiectasis or cystic fibrosis) and chronic liver disease in a sensitivity analysis, again defined based on any morbidity coding in primary care recorded prior to study start. The conceptual framework represents the assumed associations between covariates and primary exposure and outcome. Pink circles represent ancestors of the exposure and outcome, blue circles represent ancestors of the outcome, pink lines represent biasing paths (i.e. confounding) and green lines represent causal paths.. The minimally sufficient adjustment set (i.e. the covariates adjusted for in confounder adjusted models) represents covariates such that the adjustment for this set of variables will minimize confounding bias when estimating the association between the exposure and the outcome. All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. The copyright holder for this this version posted September 10, 2021. ; https://doi.org/10.1101/2021.09.03.21262888 doi: medRxiv preprint The conceptual framework A directed acyclic graph represents the assumed associations between covariates and primary exposure and outcome. Pink circles represent ancestors of the exposure and outcome, blue circles represent ancestors of the outcome, pink lines represent biasing paths (i.e. confounding) and green lines represent causal paths. The minimally sufficient adjustment set (i.e. the covariates adjusted for in confounder adjusted models) represents covariates such that the adjustment for this set of variables will minimize confounding bias when estimating the association between the exposure and the outcome. Comparing risk of COVID-19-related death in: 1) people with IMIDs to general population; and 2) people with IMIDs on targeted compared to standard systemic immune modifying therapies. Additionally adjusting our confounder-adjusted models for ethnicity We did not adjust for ethnicity in our main analysis due to a large proportion of missing ethnicity data. In this sensitivity analysis, we therefore additionally adjusted confounder adjusted models for ethnicity and restricted our analysis to people with known ethnicity (i.e., complete case analysis). This was done for both of the main study objectives (IMIDs and severe COVID-19 outcomes; and immunosuppressants and severe COVID-19 outcomes). Additionally adjusting our confounder-adjusted model for chronic respiratory disease, end stage renal failure and chronic liver disease We additionally adjusted for further potential confounders (chronic respiratory disease, end stage renal failure and chronic liver disease) to explore: how robust our effect estimates were; and the assumptions underlying the causal diagrams informing our main analyses (i.e., we additionally adjusted for wider sets of confounders, identified in causal diagrams drawn under less restrictive assumptions regarding potential confounding factors).This was done for the objective concerning IMIDs and severe COVID-19 outcomes only, as the confounder adjusted model for the objective concerning immunosuppressants and severe COVID-19 outcomes already included the comorbidities in question. Repeating the main analysis and adjusting for smoking/BMI without missing data reclassification In our main analyses, individuals with missing BMI measures were categorised as having 'no evidence of obesity (BMI < 30)', and those with missing smoking status were categorised as or never-smokers. We therefore undertook a sensitivity analysis restricting to those with known BMI and smoking status (complete case analysis).This was done for both of the main study objectives (IMIDs and severe COVID-19 outcomes; and immunosuppressants and severe COVID-19 outcomes). While only a small number are likely to have haematological malignancy or organ transplant, there is an established very high risk of COVID-19-reated death and adverse outcomes. 1, 2 Adjusting for age using a four-knot cubic spline In our main analyses we included age as a categorical variable. In a sensitivity analysis, we used four-knot cubic splines to adjust for age in our age and sex adjusted models, and confounder adjusted models, in order to more granularly account for the effect of age. Alternative end point of COVID-19-related critical care admission For our main analysis we combined COVID-19-related critical admission and death as one outcome, as not all individuals with severe COVID-19 are admitted to critical care. Combining the outcomes allowed us to capture all individuals with severe COVID-19. However, we explored COVID-19-related critical care admission only as a sensitivity analysis. In our main analyses we assessed exposure to standard and targeted immune modifying drugs within six months of the study start (March 1 st , 2020) . In a prior to study start compared standard systemic sensitivity analysis for TNF inhibition only, as the most frequently used targeted therapy, we restricted this period to within three months before March 1 st , 2020. TNFi exposure as TNFi monotherapy, compared to TNFi combination therapy with standard systemic In our main analysis, we defined TNFi exposure to include TNFi monotherapy and TNFi combination therapy with standard systemic agents. In a sensitivity analysis we compared the risk of COVID-19-related death in individuals prescribed TNFi monotherapy against TNFi combination therapy, as differences in infection outcomes have been described in individuals prescribed TNFi monotherapy compared to combination therapy. 3 TNFi exposure defined as infliximab only In our main analysis, we defined TNFi exposure including all TNF inhibitor medications. However, with the TNFi class, individuals prescribed infliximab were considered systematically different in terms of disease severity and frailty (confounders that are difficult to capture) and we hypothesised that exposure may be associated with an increased risk of severe COVID-19 outcomes. Therefore, we repeated our main analysis including those on infliximab only. We considered severity of immune-mediated inflammatory disease and degree of shielding to be potential confounders that are not available in the data. We therefore conducted quantitative bias analysis using E-values to assess how strongly associated these unmeasured confounders would need to be with exposure and outcome to potentially fully explain observed non-null associations (i.e., the association adjusted for both measured covariates and the unmeasured confounder would be null). In order to apply these methods to the hazard ratio to rather than the risk ratio, we made the assumption that the outcomes were rare. Planned comparisons were made between people with IMIDs, and IMID subcategories (joint, bowel, skin), using the general population as the reference group. Confounder adjsuted: age, sex, deprivation, smoking status.Abbreviations: HR, hazard ratio; CI, confidence interval; PY, person years; IMID, immune mediated inflammatory disease; BMI, body mass index. * Events counts are different for these analyses due to exclusion of those with missing data on the additionally included variables (complete case analysis). All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. .85) Planned comparisons were made between people with IMIDs on any targeted immune modifying therapy (and for each group on specific targeted therapies) compared to people with IMIDs on standard systemic therapy as the reference group. † Cells with counts less than 5 are redacted to protect anonymity. Confounder adjusted: age, sex, deprivation, smoking status, BMI, specific IMID (inflammatory joint, bowel and skin disease), cardiovascular disease, cancer (excluding non-melanoma skin cancer), stroke, end stage renal failure, chronic liver disease, chronic respiratory disease and diabetes mellitus. Abbreviations: HR, hazard ratio; CI, confidence interval; PY, person years; IMID, immune mediated inflammatory disease; BMI, body mass index. All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. Planned comparisons were made between people with IMIDs, and IMID types (joint, bowel, skin), using the general population as the reference group. Confounder adjusted: age, sex, deprivation,and smoking status Abbreviations: HR, hazard ratio; CI, confidence interval; PY, person years; IMID, immune mediated inflammatory disease; deprivation, index of multiple deprivation. All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. The copyright holder for this this version posted September 10, 2021. ; Analysis adjusting for age using a four-knot cubic spline: Hazard Ratios (HRs) and 95% confidence intervals (CI) for COVID-19-related death, death/critical care admission or hospitalisation, in people with IMIDs on targeted immune modifying therapies compared to those with IMIDs on standard systemic immune modifying therapies. Planned comparisons were made between people with IMIDs on any targeted immune modifying therapy (and for each group on specific targeted therapies) compared to people with IMIDs on standard systemic therapy as the reference group. †Cells with counts less than 5 are redacted to protect anonymity. Confounder adjusted: age, sex, deprivation, smoking status, BMI, specific IMID (inflammatory joint, bowel and skin disease), cardiovascular disease, cancer (excluding non-melanoma skin cancer), stroke, end stage renal failure, chronic liver disease, chronic respiratory disease and diabetes mellitus.age, sex, deprivation, smoking status, BMI, specific IMID, chronic cardiovascular disease, cancer (excluding non-melanoma skin cancer), stroke, and diabetes mellitus. Abbreviations: HR, hazard ratio; CI, confidence interval; PY, person years; IMID, immune mediated inflammatory disease; BMI, body mass index. All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. The copyright holder for this this version posted September 10, 2021. ; https://doi.org/10.1101/2021.09.03.21262888 doi: medRxiv preprint Figure S4 . Minimum associations with unmeasured confounder required to potentially explain observed confounder-adjusted association between rituximab and COVID-19 death Figure S5 . Minimum associations with unmeasured confounder required to potentially explain observed confounder-adjusted association between rituximab and COVID-19 critical care admission/death Figure S6 . Minimum associations with unmeasured confounder required to potentially explain observed confounder-adjusted association between rituximab and COVID-19 hospitalisation All rights reserved. No reuse allowed without permission. preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. The copyright holder for this this version posted September 10, 2021. ; https://doi.org/10.1101/2021.09.03.21262888 doi: medRxiv preprint Figure S7 . Minimum associations with unmeasured confounder required to potentially explain observed confounder-adjusted association between JAK inhibitors and COVID-19 hospitalisation Characteristics of and important lessons from the coronavirus disease 2019 (COVID-19) outbreak in China: summary of a report of 72 314 cases from the Chinese Center for Disease Control and Prevention Factors associated with COVID-19-related death using OpenSAFELY PATIENTS WITH IMMUNE MEDIATED INFLAMMATORY DISEASES (IMID) -A POPULATION-BASED STUDY Factors associated with deaths due to COVID-19 versus other causes: populationbased cohort analysis of UK primary care data and linked national death registrations within the OpenSAFELY platform HIV infection and COVID-19 death: a population-based cohort analysis of UK primary care data and linked national death registrations within the OpenSAFELY platform Factors associated with COVID-19-related death using OpenSAFELY Prevalence and clinical outcomes of COVID-19 in patients with autoimmune diseases: a systematic review and meta-analysis Abbreviations: TNFi Body mass index; Hba1c: glycosylated haemoglobin preprint (which was not certified by peer review) is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. We considered severity of immune-mediated inflammatory disease and degree of shielding to be potential confounders which are not available in the data. As such we conducted quantitative bias analysis using E-values to assess how strongly associated these unmeasured confounders would need to be with exposure and outcome to potentially fully explain observed non-null associations (i.e., the association adjusted for both measured covariates and the unmeasured confounder would be null). 21 In order to apply these methods to the hazard ratio, rather than the risk ratio, we make the assumption that the outcomes are rare. A non-null association was observed between rituximab and COVID-19 death, critical care admission/death, and hospitalisation. For an unmeasured confounder to potentially fully explain the point estimate for the observed confounder-adjusted association the unmeasured confounder would need to be associated with one of exposure or outcome, conditional on measured covariates, by at least risk ratios 2.75, 3.25 and 2.56 for COVID-19 death, critical care admission/death, and hospitalisation respectively (1.46, 1.95, and 1.59 to potentially explain the lower bound of the 95% CI) (Figures S4-S6 , Tables S14-S17).Furthermore, to potentially fully explain the point estimate the unmeasured confounder would need to be associated with both exposure and outcome, conditional on measured covariates, by at least risk ratio 1.68, 1.92 and 1.59 for COVID-19 death, critical care admission/death and hospitalisation (1.11, 1.31, and 1.16 to potentially explain the lower bound of the 95% CI).Additionally, a non-null association was observed between JAK-inhibitors and COVID-19 hospitalisation. To potentially fully explain the confounder-adjusted point estimate (lower bound of 95% CI) the unmeasured confounder would need to be associated with one of exposure or outcome, conditional on measured covariates, by at least risk ratio 3.02 (1.40) and both of exposure and outcome by 1.81 (1.09) ( Figure S7, Table S17 ). An unmeasured confounder moderately associated with both exposure and outcome could potentially explain the associations of rituximab and JAK inhibitors with COVID-19 outcomes. However, whether this is the case in this study and the extent of true residual confounding depends on both the prevalence of and strength of associations with exposure and outcome of the unmeasured confounders, shielding and severity of IMID, which are not known.