AI helps Stanford researchers show link between first opioid Rx and dependency

The U.S. is being ravaged by an opioid epidemic that costs tens of thousands of lives and billions of dollars each year.


Dr. Tina Hernandez-Boussard, associate professor at the Stanford University School of Medicine, and her fellow researchers said they could not let this continue.

Our goal was to use big data and advanced technologies to identify the causes of opioid addiction and recommend strategies to stem this chronic use,” she stated.

Medicaid covers a vulnerable population with a particularly high risk of opioid misuse. The Stanford team’s problem was that there currently are no large publicly available Medicaid claims data sets that would support this research.

To perform this study, the team needed a large volume of data. And that’s where vendor Gainwell Technologies came in.

“Gainwell is the leader in Medicaid healthcare technology services, and it manages claims data for millions of Medicaid beneficiaries through the company’s state clients,” Hernandez-Boussard said.

“Gainwell enabled this study by providing Stanford with a unique research database of millions of de-identified claims. Select Gainwell Medicaid clients approved using this data, knowing it would be used to help solve a devastating healthcare crisis and save lives.”

“We used a machine learning model to predict the progression from acute to chronic opioid use.”

Dr. Tina Hernandez-Boussard, Stanford University School of Medicine

Stanford reviewed the database using technologies such as machine learning and deep learning to research this question.

“We identified 180,000 Medicaid de-identified enrollees from six states showing evidence of postoperative opioid use disorder,” Hernandez-Boussard explained. “That cohort of enrollees formed the basis for this study.”


Hernandez-Boussard said that Gainwell shared Stanford’s commitment to tackling the opioid crisis – and that it operated with urgency. The company’s main role was to deliver the de-identified claims data to Stanford in a format the researchers could understand and analyze.

“Gainwell created a longitudinal claims database containing six years of de-identified claims data for a geographically varied group of Medicaid states,” Hernandez-Boussard explained. “This database was housed in a secure cloud environment and accessed through a novel user interface.

“Stanford researchers could submit project-specific requests to access the data after completing formal data use agreements,” she added.


Gainwell’s technology is a standalone research platform that is not integrated with other systems. Within this platform, Stanford researchers can use a variety of analytical tools, including R and Python, to parse the data. This work was done under Hernandez-Boussard’s supervision by both graduate students and postdoctoral researchers at the Stanford School of Medicine.

“Using artificial intelligence and machine learning tools, our researchers looked for key indicators leading to chronic opioid use (addiction),” Hernandez-Boussard said. “Some of the information they uncovered was both surprising and instructive.

“For instance, Tramadol, an opioid that has been touted as being safer and less addictive than others, was actually highly predictive of long-term opioid use,” she continued. “Hopefully, this research and our conclusions will provide a road map to stop opioid-naïve patients from turning into opioid-dependent ones.”


The Stanford research team concluded that a patient’s first experience with an opioid prescription is the biggest factor fueling addiction.

“Of the patients who had never taken an opioid, or hadn’t taken an opioid for two months or more, 29.9% developed an opioid dependency following their first prescription,” Hernandez-Boussard revealed. “The study concluded the larger the quantity and longer the duration of patients’ prescriptions, the more prone they were to develop an opioid dependency.

“This research should give doctors pause,” she warned. “We would urge them to consider prescribing non-opioid medications as a primary treatment for pain before prescribing opioids, as recommended by national guidelines.”

The full study, “Prescription quantity and duration predict progression from acute to chronic opioid use in opioid-naïve Medicaid patients and its findings,” can be found on PLOS Digital Health.


“I’d advise others to always get the most complete set of data possible before beginning this type of research,” said Hernandez-Boussard. “And, as you can imagine, this data is difficult to gather. You’ll also need a technology partner to prepare that information for research. Importantly, you’ll need to bring that evidence to the hands of the caretakers.

“We used a machine learning model to predict the progression from acute to chronic opioid use,” she said. “Aside from this, you need a great internal team to perform the research. Fortunately, at Stanford we have no shortage of top researchers and graduate students with a great aptitude for this work.”

Twitter: @SiwickiHealthIT

Email the writer:

Healthcare IT News is a HIMSS Media publication.