Inclusion Criteria:  Immunocompromised (including but not limited to HIV, solid organ transplant, solid tumors, hematological stem cell transplant and malignancies, systemic diseases, chemotherapy, long term corticosteroid use, and immunosuppressive therapies, as well as primary immunodeficiencies Presentation to a day hospital, emergency department, or admitted to hospital Proven or probable diagnosis of PJP using an adapted version of the 2021 EORTC/MSGERC criteria.  Exclusion Criteria:  Previous severe adverse reaction to TMP-SMX, any sulfa drug, or any component of formulation Compliant with PJP prophylaxis for ≥4 weeks with TMP-SMX at enrollment More than 72 hours of any therapy for PJP Hepatic impairment marked by alanine aminotransferase levels ≥5 times the upper limit of normal Known G6PD deficiency Known diagnosis of porphyria Known pregnancy or breastfeeding (as per Health Canada) Unable to provide informed consent and no available healthcare proxy (with ethics approval for deferred consent in cases of critical illness); refusal of consent; no reliable means of outpatient contact (telephone/email/text); Previously enrolled