To our knowledge, this is the first real-world cohort study with the largest sample size to evaluate the efficacy and safety of anti-PD-(L)1 treatment in patients with coexisting malignancy and tuberculosis, as well as the efficacy of anti-tuberculosis treatment in those with active tuberculosis. The gene discussed is CD274; the disease is cancer.