An overview of the analytic workflow. We considered five exposure time windows and multiple statistical models. We conducted analyses within infected patients, tested subjects, and the whole population, respectively. Effects of prescribed medications/vaccinations on the risk of infection, severity of disease (hospitalization as proxy) and mortality were investigated separately. Missing data were accounted for by multiple imputation. Inverse probability weighting (IPW) of the probability of being tested (Prob(tested)) was employed to reduce testing bias. Multivariable logistic regression was conducted, controlling for main confounders. We primarily focused on drugs with protective effects, as residual confounding tends to bias towards harmful effects. In addition, we performed further subgroup and interaction analysis to identify factors that may modify the drug effects.