Wow I guess that's what you get for free
You mean you're getting a lot more valuable information than one should expect to get for free.
The facts are as follows - we really don't know many facts and you're leaving us to assume them. As sympathetic as I am to being terminated - as well as everyone here - it doesn't change the honest opinions given to you. Unless you have some type of employment contract, the majority of states are "at will" employment states. They can terminate you without even providing a reason. It sucks, yes, but that's the law. They can not like the medication you've been given and terminate you because they don't feel that things are working out with you, even apart from any issue concerning the medication. Unfortunately that is how fragile your employment agreement is, absent some agreement. There is no "right to work" any more than there is a right to have your lease renewed in a house you've been renting for 10 straight years unless there is a special provision in the lease or an unusual exception to the law.
You want to continue focusing on the fact that you were terminated because of a drug / medication for which your doctor prescribed. But as per the above, that's probably not going to protect you from the fragile "at will" employment status that you have. Taking an example above, let's say your job is to serve as a truck driver and your position requires a lot of "on call" work. You've been given a medical marijuana prescription to deal with your constant elbow pain which means smoking regularly to combat the pain. You may be legally entitled to smoke marijuana and you do but the company feels very concerned about additional safety and liability concerns it presents, especially after a positive drug test showing higher levels than they expected. Whether or not you want to argue that you'll be fine to drive, the law still prescribes limits for DUI levels. This could make you unfit to be able to serve as a substitute driver last minute when you are on call. I'm not saying I'm for or against smoking marijuana, just giving you an idea of what could happen should you be on a prescription for regular use. It may be even more alarming with oxycodone.
Here everyone is making assumptions and educated guessing. You'd need a full and proper review of your case along with the details that you're apparently not fully wiling to share - such as the drug we are discussing. But as has been pointed out, just because your doctor prescribed it does not mean that a company is required to keep you on the job if it significantly impairs your ability to perform the essence of the job. That's the issue you need to overcome just to make any type of case in a moral court. And then there is the court of law, which states that you need to be in a "protected class" of people in order to make a discrimination case, e.g. based upon your race, gender, religion or other specific special classes such as a disability (which has requirements), etc. And unless you've got some type of employment agreement (which can include those that may involve your union), you're an at-will employee and probably don't have a wrongful termination claim or breach of contract (your employment agreement). If you have a union you may want to speak to your union rep. Good luck.