But because pathogens and outcomes tend to be similar in patients in similar settings and with similar risk factors, it is clinically useful to categorize pneumonias as Community-acquired Hospital-acquired (excluding ventilator-associated) Ventilator-associated Occurring in immunocompromised patients, including patients with human immunodeficiency virus (HIV) infection (see Pneumocystis jirovecii Pneumonia) Aspiration pneumonia, which occurs when large volumes of upper airway or gastric secretions enter into the lungs These categorizations allow treatment to be selected empirically.