34.03 Development and validation of a machine learning model to predict opioid needs at surgical discharge

C. Varghese1  1University Of Auckland, Auckland, New Zealand

Introduction: The ‘Opioid PrEscRiptions and usage After Surgery’ study found opioids are significantly overprescribed after surgery. Inappropriate prescribing contributes to opioid-related harm including excess circulation of unused opioids within our communities. This study aims to use novel methods to predict if patients require opioids after surgery.

Methods: An international, multi-centre, prospective cohort study of general surgical, urological, gynaecological, and orthopaedic surgery was performed by the Trials and Audits in Surgery by Medical Students in Australia and New Zealand (TASMAN) collaborative. Random forest machine learning algorithms were used to predict the need for opioid at discharge, and a 80:20 training/testing split was used for validation.

Results: Of 4268 patients recruited across 24 countries (mean age 50; 51.9% female), 1308 (30.6%) were prescribed opioids, but only 1014 (23.8%) consumed them. Our model ranked the total amount of opioids consumed in the day prior to discharge, alcohol consumption, surgery-type, smoking status, and age as the most important factors. Area under the curve for the random forest model was 0.84 (95% CI 0.83-0.84; compared to 0.76 (95% 0.76 – 0.77) in a logistic regression model). Model sensitivity was 92%, specificity 49%, and overall accuracy was 82% (95% CI 79 – 84%).

Conclusions: The need for an opioid prescription could be accurately predicted using 11 routinely available preoperative variables (age, gender, alcohol intake, smoking status, BMI, surgery-type, ASA score, indication for surgery, urgency, total amount of opioids consumed the day before discharge, and pre-admission opioid use). Future work could enable clinical translation of this decision support aid to rationalise opioid overprescribing after surgery.