BACKGROUND: It is unclear if human immunodeficiency virus (HIV) affects the prognosis for community-acquired pneumonia (CAP) in the current era of effective antiretroviral therapy. In this multicenter retrospective cohort study of patients admitted for CAP, we compared the in-hospital mortality rate between people with HIV (PWH) and those without. METHODS: The study included consecutive patients admitted with a diagnosis of CAP across 31 hospitals in Ontario, Canada, from 2015 to 2022. HIV infection was based on discharge diagnoses and antiretroviral prescription. The primary outcome was in-hospital mortality. Competing risk models were used to describe time to death in hospital or discharge. Potential confounders were balanced using overlap weighting of propensity scores. RESULTS: Of 82 822 patients admitted with CAP, 1518 (1.8%) had a diagnosis of HIV. PWH were more likely to be younger, male, and have fewer comorbidities. In the hospital, 67 (4.4%) PWH and 6873 (8.5%) people without HIV died. HIV status had an adjusted subdistribution hazard ratio of 1.02 (95% confidence interval, .80-1.31
P = .8440) for dying in the hospital. Of 1518 PWH, 440 (29.0%) patients had a diagnosis of AIDS. AIDS diagnosis had an adjusted subdistribution hazard ratio of 3.04 (95% CI, 1.69-5.45
P = .0002) for dying in the hospital compared to HIV without AIDS. CONCLUSIONS: People with and without HIV admitted for CAP had a similar in-hospital mortality rate. For PWH, AIDS significantly increased the mortality risk. HIV infection by itself without AIDS should not be considered a poor prognostic factor for CAP.