Several opioids have pharmacogenomic associations impacting analgesic efficacy. However, germline pharmacogenomic testing is not routinely incorporated into supportive oncology. We hypothesized that CYP2D6 profiling would correlate with opioid prescribing and hospitalizations. We analyzed 61,572 adult oncology patients from 2012 to 2018 for opioid exposures. CYP2D6 metabolizer phenotype (ultra-rapid [UM], normal metabolizer [NM], intermediate [IM], or poor [PM]), the latter two of which may cause inefficacy of codeine, tramadol, and standard-dose hydrocodone, was determined for patients genotyped for reasons unrelated to pain. The primary endpoint was number of opioid medications received during longitudinal care (IM/PMs vs. NMs). Secondary endpoint was likelihood of pain-related hospital encounters. Most patients with cancer (n= 34,675, 56%) received multiple opioids (average 2.8± 1.6/patient). Hydrocodone was most commonly prescribed (62%), followed by tramadol, oxycodone, and codeine. In the CYP2D6 genotyped cohort (n= 105), IM/PMs received a similar number of opioids (3.4± 1.4) as NMs (3.3± 1.9). However, IM/PMs were significantly more likely to experience pain-related hospital encounters compared with NMs, independent of other variables (odds ratio [OR]= 5.4; 95% confidence interval [CI], 1.2-23.6; p=.03). IM/PMs were also more likely to be treated with later-line opioids that do not require CYP2D6 metabolism, such as morphine and hydromorphone (OR=3.3; 95% CI, 1.1-9.8; p=.03). CYP2D6 genotype may identify patients with cancer at increased risk for inadequate analgesia when treated with typical first-line opioids like codeine, tramadol, or standard-dose hydrocodone. Palliative care considerations are an integral part of optimal oncology care, and these findings justify prospective evaluation of preemptive genotyping as a strategy to improve oncology pain management. Genomic variation in metabolic enzymes can predispose individuals to inefficacy when receiving opioid pain medications. Patients with intermediate and/or poor CYP2D6 metabolizer status do not adequately convert codeine, tramadol, and hydrocodone into active compounds, with resulting increased risk of inadequate analgesia. This study showed that patients with cancer frequently receive CYP2D6-dependent opioids. However, patients with CYP2D6 intermediate and poor metabolizer status had increased numbers of pain-related hospitalizations and more frequently required the potent non-CYP2D6 opioids morphine and hydromorphone. This may reflect inadequate initial analgesia with the common "first-line" CYP2D6-metabolized opioids. Preemptive genotyping to guide opioid prescribing during cancer care may improve pain-related patient outcomes.