Machine learning for prediction of sustained opioid prescription after anterior cervical discectomy and fusion

Spine J. 2019 Jun;19(6):976-983. doi: 10.1016/j.spinee.2019.01.009. Epub 2019 Jan 30.


Background context: The severity of the opioid epidemic has increased scrutiny of opioid prescribing practices. Spine surgery is a high-risk episode for sustained postoperative opioid prescription.

Purpose: To develop machine learning algorithms for preoperative prediction of sustained opioid prescription after anterior cervical discectomy and fusion (ACDF).

Study design/setting: Retrospective, case-control study at two academic medical centers and three community hospitals.

Patient sample: Electronic health records were queried for adult patients undergoing ACDF for degenerative disorders between January 1, 2000 and March 1, 2018.

Outcome measures: Sustained postoperative opioid prescription was defined as uninterrupted filing of prescription opioid extending to at least 90-180 days after surgery.

Methods: Five machine learning models were developed to predict postoperative opioid prescription and assessed for overall performance.

Results: Of 2,737 patients undergoing ACDF, 270 (9.9%) demonstrated sustained opioid prescription. Variables identified for prediction of sustained opioid prescription were male sex, multilevel surgery, myelopathy, tobacco use, insurance status (Medicaid, Medicare), duration of preoperative opioid use, and medications (antidepressants, benzodiazepines, beta-2-agonist, angiotensin-converting enzyme-inhibitors, gabapentin). The stochastic gradient boosting algorithm achieved the best performance with c-statistic=0.81 and good calibration. Global explanations of the model demonstrated that preoperative opioid duration, antidepressant use, tobacco use, and Medicaid insurance were the most important predictors of sustained postoperative opioid prescription.

Conclusions: One-tenth of patients undergoing ACDF demonstrated sustained opioid prescription following surgery. Machine learning algorithms could be used to preoperatively stratify risk these patients, possibly enabling early intervention to reduce the potential for long-term opioid use in this population.

Keywords: Anterior cervical discectomy and fusion; Cervical spine; Machine learning; Opioid use; Prediction; Predictive analytics; Spine surgery.

MeSH terms

  • Adult
  • Analgesics, Opioid / administration & dosage*
  • Analgesics, Opioid / therapeutic use
  • Cervical Vertebrae / surgery
  • Diskectomy / adverse effects*
  • Drug Prescriptions / statistics & numerical data*
  • Female
  • Humans
  • Machine Learning*
  • Male
  • Middle Aged
  • Pain, Postoperative / drug therapy*
  • Practice Patterns, Physicians' / statistics & numerical data
  • Spinal Fusion / adverse effects*


  • Analgesics, Opioid