BackgroundCOVID-19 outcomes, in the context of immune-mediated inflammatory diseases (IMIDs), are incompletely understood. Reported outcomes vary considerably depending on the patient population studied. It is essential to analyse data for a large population, while considering the effects of the pandemic time period, comorbidities, long term use of immunomodulatory medications (IMMs), and vaccination status.MethodsIn this retrospective case-control study, patients of all ages with IMIDs were identified from a large U.S. healthcare system. COVID-19 infections were identified based on SARS-CoV-2 NAAT test results. Controls without IMIDs were selected from the same database. Severe outcomes were hospitalisation, mechanical ventilation (MV), and death. We analysed data from 1 March 2020 to 30 August 2022, looking separately at both pre-Omicron and Omicron predominant periods. Factors including IMID diagnoses, comorbidities, long term use of IMMs, and vaccination and booster status were analysed using multivariable logistic regression (LR) and extreme gradient boosting (XGB).FindingsOut of 2 167 656 patients tested for SARS-CoV-2, there were 290 855 with confirmed COVID-19 infection: 15 397 patients with IMIDs and 275 458 controls (patients without IMIDs). Age and most chronic comorbidities were risk factors for worse outcomes, whereas vaccination and boosters were protective. Patients with IMIDs had higher rates of hospitalisation and mortality compared with controls. However, in multivariable analyses, few IMIDs were rarely risk factors for worse outcomes. Further, asthma, psoriasis and spondyloarthritis were associated with reduced risk. Most IMMs had no significant association, but less frequently used IMM drugs were limited by sample size. XGB outperformed LR, with the AUROCs for models across different time periods and outcomes ranging from 0·77 to 0·92.InterpretationFor patients with IMIDs, as for controls, age and comorbidities were risk factors for worse COVID-19 outcomes, whereas vaccinations were protective. Most IMIDs and immunomodulatory therapies were not associated with more severe outcomes. Interestingly, asthma, psoriasis and spondyloarthritis were associated with less severe COVID-19 outcomes than those expected for the population overall. These results can help inform clinical, policy and research decisions.FundingPfizer, Novartis, Janssen, NIH