Analysis of Health Trajectories Leading to Adverse Opioid-Related Events.