Legally, only doctor’s offices, and pharmacies are allowed to sell drugs of any class. The establishment needs to have a pharmacy license in order to order the drugs, and sell them to the patient. Entities without a pharmacy license selling drugs will be doing so illegally. It is not illegal to have a drug that was sold to you, but it is illegal to sell without a license. Therefore, someone possessing fentanyl will not be committing a crime, but someone selling fentanyl will be committing a crime. The higher the class drug, the more severe the consequences are, and therefore the longer the likely sentence will be.
The law will be written this way as most people possessing drugs they are not prescribed for is likely having a drug addiction problem. You are not thrown in jail because you are an alcoholic, so why should you be thrown in jail because you are drug addict? Instead this is a health crisis, and intervention and treatment is more likely to do more good than criminalizing an addict. Instead, the drug dealer is the one committing a crime, and full penalties should be applied to them.
All prescriptions must be sent electronically. Also, if there are 2 prescriptions of the same drug, a red flag will be raised, and a possible investigation buy the FDA will have to be performed. This is done to prevent doctor shopping which is when the patient gains multiple drugs to self treat their issues. This is likely to get 2 opioid prescriptions when the patient is addicted to opioids.