It was legal to get opioids like oxy legally, fentanyl was always pretty tightly controlled. I believe it was mostly used in surgeries alongside anesthesia.
Bro, there was a movie made about how wrong you are on this topic. It's called pain hustlers, it stars captain america and emily blunt. In the movie they renamed the drug to Lonafen, but the actual drug is called Subsys. The drug contains Fentanyl.