Assessing Prior Pain Visits and Medical History Risk Factors for Opioid Overdose

How to Cite

Walsh, A. (2018). Assessing Prior Pain Visits and Medical History Risk Factors for Opioid Overdose. Online Journal of Public Health Informatics, 10(1).



Identifying text features of emergency department visits associated with risk of future drug overdose.


Opioid overdoses are a growing cause of mortality in the United States.1 Medical prescriptions for opioids are a risk factor for overdose2. This observation raises concerns that patients may seek multiple opioid prescriptions, possibly increasing their overdose risk. One route for obtaining those prescriptions is visiting the emergency department (ED) for pain-related complaints. Here, two hypotheses related to prescription seeking and overdoses are tested. (1) Overdose patients have a larger number of prior ED visits than matched controls. (2) Overdose patients have distinct patterns of pain-related complaints compared to matched controls.


ED registrations were collected via the EpiCenter syndromic surveillance system. Regular expression searches on chief complaints identified overdose visits. Overdose visits were matched with control visits from the same facility with maximal similarity of gender, age, home location and arrival time.
A year of prior ED visits for cases and controls were matched using facility-specific patient identifiers or birthdate, gender and home location.
Patient history chief complaints were sanitized to standardize spelling, expand abbreviations and consolidate phrases. Word frequency comparisons between groups identified candidate terms for modeling.
Odds ratios of patient history terms were calculated with univariate logistic regression. Multivariate lasso logistic regression selected covariates for prediction. These models were fit to data from one quarter and cutoffs for covariate inclusion were validated on the following quarter’s data. Model predictions were validated on a 1% sample of ED registrations from the next quarter.


Quarter three of 2016 yielded 23,769 overdose ED visits and matching controls; quarter four yielded 21,957 pairs; and 15,824 ED visits were sampled from the first quarter of 2017 including 130 overdose visits.
Contrary to expectations, patients in the control group averaged 0.7 additional ED visits in the prior year relative to controls; this pattern was consistent across quarters and regardless of how prior visits were matched (Fig 1).
Prior visits for various pain categories were also more common among control patients than overdose patients (e.g. odds ratio for “back pain”: 0.78). Terms associated with drug use (e.g. “detox” odds ratio: 2.66) and mental health concerns (e.g. “psychological” odds ratio: 4.28) were most consistently overrepresented in the history of overdose patients (Table 1). Terms associated with chronic disease were most overrepresented in the history of control patients (Table 2).
The best predictive model achieved a sensitivity of 57% and a specificity of 86% on test data (Fig 2).


While a history of more overall ED visits and more ED visits related to pain were not associated with overdose ED visits, vocabulary of prior ED visits did predict future overdose ED visits. Performance of predictive models exceeded expectations, given the relative scarcity of overdoses among ED visits and the simplicity of chief complaints used for prediction. The correlation between past and future overdose visits highlights the need for targeted intervention to break addiction cycles.
Authors own copyright of their articles appearing in the Online Journal of Public Health Informatics. Readers may copy articles without permission of the copyright owner(s), as long as the author and OJPHI are acknowledged in the copy and the copy is used for educational, not-for-profit purposes. Share-alike: when posting copies or adaptations of the work, release the work under the same license as the original. For any other use of articles, please contact the copyright owner. The journal/publisher is not responsible for subsequent uses of the work, including uses infringing the above license. It is the author's responsibility to bring an infringement action if so desired by the author.