Long-term opioid use has negative health care consequences. Patients who undergo surgery are at risk for prolonged opioid use after surgery (POUS). While risk factors have been previously identified, no methods currently exist to determine higher-risk patients. We assessed the ability of a variety of machine-learning algorithms to predict adolescents at risk of POUS and to identify factors associated with this risk.
A retrospective cohort study was conducted using a national insurance claims database of adolescents aged 12–21 years who underwent 1 of 1297 surgeries, with general anesthesia, from January 1, 2011 to December 30, 2017. Logistic regression with an L2 penalty and with a logistic regression with an L1 lasso (Lasso) penalty, random forests, gradient boosting machines, and extreme gradient boosted models were trained using patient and provider characteristics to predict POUS (≥1 opioid prescription fill within 90–180 days after surgery) risk. Predictive capabilities were assessed using the area under the receiver-operating characteristic curve (AUC)/C-statistic, mean average precision (MAP); individual decision thresholds were compared using sensitivity, specificity, Youden Index, F1 score, and number needed to evaluate. The variables most strongly associated with POUS risk were identified using permutation importance.
Of 186,493 eligible patient surgical visits, 8410 (4.51%) had POUS. The top-performing algorithm achieved an overall AUC of 0.711 (95% confidence interval [CI], 0.699-0.723) and significantly higher AUCs for certain surgeries (eg, 0.823 for spinal fusion surgery and 0.812 for dental surgery). The variables with the strongest association with POUS were the days’ supply of opioids and oral morphine milligram equivalents of opioids in the year before surgery.
Machine-learning models to predict POUS risk among adolescents show modest to strong results for different surgeries and reveal variables associated with higher risk. These results may inform health care system–specific identification of patients at higher risk for POUS and drive development of preventative measures.