JEFFERSON CITY – State senators on Thursday passed legislation to make Missouri the final state to adopt a prescription drug tracking database, a program meant to help address the growing opioid epidemic.

The bill would create a database doctors and pharmacists could check to see if patients have recently filled or been prescribed addictive medications. It passed the Senate 22-9, but because of Senate changes will head back to the House for review.

The goal is to help physicians prevent addiction or identify signs of misuse in order to treat patients. Programs in other states have also been used to cut back on doctor shopping, when people go from doctor to doctor in search of more painkillers and other drugs.

"People are going to avoid those addictions because doctors are going to have information that may catch them before they get too far down the road that they can't go back," said Sullivan Republican Sen. Dave Schatz, who is handling the House bill in the Senate.

Missouri has long been the only holdout in creating such a program in the face of fierce criticism by some state lawmakers who have privacy concerns about keeping medical information in a database.

While Republican Sen. Rob Schaaf – who had been the staunchest opponent – last week announced he'd no longer stand in the way of the measure's passage, it still faced pushback during Thursday debate.

Lee's Summit Republican Sen. Will Kraus, who also cited privacy concerns, added a provision requiring the database be purged every 180 days. Republican sponsor Rep. Holly Rehder, whose daughter became addicted after she cut her finger and received a prescription for painkillers, called that "very concerning."

Both Rehder and Schatz said that could mean people in recovery and at risk of relapsing are overlooked.

"Having the ability to look back at a person's history is very critical," Schatz said. "It weakens the ability to really see a true picture of an individual," he said of the 180-day purge.

Senate changes also would require that doctors check the database before writing prescriptions for certain drugs. Schaaf's decision to allow a vote on the bill hinged on that change, which is welcomed by advocates who argue mandatory use would make the program more effective.

"I'm not trying to kill this bill over anything except that I want the doctors to use it to the full measure that would help the people," Schaaf told colleagues on the Senate floor.

Other amendments include a six-year sunset, training for database users and limits on what drugs doctors and pharmacists would need to enter into the system. The House bill would have required all prescription drugs classified as schedule II, III and IV controlled substances be entered. In the Senate version, only opioids and benzodiazepines, such as Xanax, would need to be reported.