Hospitalized patients with cancer who experience cardiopulmonary arrest have historically low survival rates. This retrospective cohort study describes outcomes of patients at a large Canadian cancer centre who had a "code medical emergency" activated, and the use of pragmatic criteria to identify patients with poor survival following resuscitation. We included hospitalized patients with cancer who had a "code blue" activated between January 2007 and December 2018. Our primary outcome was intensive care unit (ICU) mortality. We developed pragmatic criteria to identify patients with "poor prognosis" for survival from cardiopulmonary resuscitation (CPR) based on disease status and candidacy for further cancer treatment. We used descriptive statistics to analyze the outcomes of poor prognosis patients. Two hundred and twenty-five patients had a code blue activated. The median age was 61 yr, 52% were male, and 48% had a solid tumour. Overall, 173/225 (77%) patients survived the code blue; 164 were admitted to the ICU, where 49% (81/164) died; 31% survived to hospital discharge; and 16% (n=27) were alive at one year. One hundred and twenty out of 225 (53%) required chest compressions; spontaneous circulation returned in 61% (73/120), and 12% (14/120) survived to hospital discharge. Patients meeting "poor prognosis" criteria (114, 51%) were more likely to die in the ICU (64% vs 35%; P<0.001) or in hospital (86% vs 59%; P<0.001), and more often had goals-of-care discussions prior to the code blue (46% vs 7%; P<0.001). At one year, only 2% of poor prognosis patients were alive, compared with 24% of patients who did not meet any poor prognosis criteria. Hospitalized patients with cancer requiring CPR have poor hospital and long-term outcomes. The proposed set of pragmatic criteria may be useful to identify patients unlikely to benefit from CPR and life support, to trigger early goals of care discussions, and to avoid potentially goal-discordant interventions.