One in three: what machine learning reveals about opioids after hip fracture

Before you read anything about the algorithm in this paper, consider the number it was built around: 31.1%.

That is the proportion of elderly patients who were completely opioid-naïve before their hip fracture and were still collecting opioid prescriptions a year later. Nearly one in three. In a cohort of more than 26,000 patients drawn from Danish nationwide registries — consecutive hip fracture admissions over a decade, not a referral centre outlier.

Long-term opioid therapy after hip fracture does not feature prominently in the fracture clinic conversation, the operative consent, or the discharge summary. Based on 31% of opioid-naïve patients developing it, it should.


The paper

A study published in the European Journal of Pain in May 2026 trained four machine learning algorithms on this Danish cohort to predict long-term opioid therapy (LTOT), defined as two or more opioid prescriptions between 31 and 365 days post-surgery. The input was 29 candidate predictors spanning demographics, comorbidities, pain medication history, socioeconomic indicators, and surgical variables.

Backward elimination logistic regression performed best. It selected 8 of the 29 predictors and achieved an area under the curve of 0.68 at internal validation.

An AUC of 0.68 is better than chance. It is not good enough to tell an individual patient whether they will or will not develop long-term opioid dependence. The authors know this — they state explicitly that external validation is required before clinical implementation, and they have made the model available as a web calculator alongside the paper rather than instead of one. That is the right call, and it is worth saying so clearly because not every published ML tool is presented with the same intellectual honesty.


What the model identifies

The eight predictors that survived backward elimination are: age, marital status, pre-operative non-opioid pain medication use, anticoagulant use, fracture type, surgery delay, length of hospital stay, and post-operative ambulation score at discharge.

None of these require specialist investigation. All of them are available at the point of discharge. The model gives you a structured reason to look at these variables systematically — even if its discriminative ability is imperfect, the variable list itself is informative.

The strongest individual predictors are not surprising in retrospect. Pre-operative non-opioid pain medication use signals pre-existing chronic pain. Surgery delay and prolonged hospital stay suggest a more complicated perioperative course. Poor ambulation at discharge reflects inadequate recovery. These are patients whose pain trajectory was never straightforward. The ML model formalises a clinical instinct that probably already exists but rarely gets turned into an explicit discharge plan.


The more important number

The 31.1% statistic is doing more work in this paper than the algorithm.

Chronic opioid use in elderly patients carries serious risk: falls, cognitive decline, and dependency in a population that is already frail. For patients who sustained their original fracture partly through mechanisms related to falls, adding opioid dependency to the burden of recovery is a harm that rarely appears on the discharge checklist. It should be there.

If a third of your opioid-naïve hip fracture patients are still on opioids at twelve months, the question is not primarily which algorithm identifies them — it is whether the discharge conversation is happening at all. Does the patient know this is a risk? Does the discharge prescription specify a review date? Is there a weaning plan? A model at AUC 0.68 cannot reliably answer those questions for any individual patient. A 31% baseline rate suggests the questions should be asked for all of them.


What to do with it

At your next hip fracture discharge, run through the eight predictors in this model. Not to generate a score — to prompt a structured conversation. Was surgery delayed? Did the patient ambulate poorly post-operatively? Are they already on gabapentinoids or strong non-opioids that signal a chronic pain history? These are the patients in whom a proactive opioid discharge plan, with a clear review date and an explicit weaning intention, is most warranted.

The web calculator exists and is free. Use it as a checklist rather than a prediction engine.

Long-term opioid use after hip fracture is under-recognised and almost certainly under-prevented. AUC 0.68 is not the solution. But 31.1% is the reason to start looking for one.


References

  1. Tudorache YM, et al. Development and internal validation of a machine learning model for predicting long-term opioid therapy after hip fracture surgery in older, opioid-naïve adults. Eur J Pain. 2026;30(5):e70280. PMID 42036957. https://doi.org/10.1002/ejp.70280

Leave a comment