Abstract
BACKGROUND: Changes in opioid prescribing practices have evolved, including perioperative settings. However, computerized clinical decision support systems to guide opioid prescribing remain limited. This study aimed to develop and validate prediction models for perioperative opioid needs among patients undergoing laparoscopic cholecystectomy (LC) and to create a risk-scoring tool. METHODS: This was a retrospective cohort study. Using electronic medical records (EMR), we identified patients aged 18-64 years who underwent LC for benign conditions between October 2015 and December 2018. Demographic, clinical, and surgical data were collected. Perioperative opioid needs were classified as none/low (0-3 days), medium (4-6 days), or high (≥7 days), based on self-reported pain scores and prescription duration. The cohort was split into training (70%) and testing (30%) datasets. Prediction models were developed using random forest, Least Absolute Shrinkage and Selection Operator (LASSO), and subject-matter expertise, with performance evaluated by discrimination, calibration, accuracy, precision, recall, and F1 score. RESULTS: A total of 1136 patients were identified. In the training dataset (n = 803), 36.1% of patients were in the none/low group, 22.1% in the medium group, and 41.8% in the high group. In testing dataset (n = 333), LASSO outperformed random forest with better calibration. The revised LASSO model, incorporating subject-matter knowledge, improved interpretability, achieving an AUC of 0.64 and Brier score of 0.20. Key predictors included gender, pre-operative medication, emergency surgery, anesthesia type, and surgical indications. A nomogram was developed for visual prediction. CONCLUSIONS: Prediction of perioperative opioid needs using EMR and machine-learning is feasible and may support individualized pain management, though further refinement of model performance is warranted.