Take the medical documentation you have establishing that you get migraine headaches, the prescribed medication, the warning documents that you are not to operate a MV or equipment while taking the medication, and any notes from the Dr, and present them to the prosecutor. Many times a prosecutor will agree to a reduced disposition based on these types of issues, although an outright dismissal is not common. A Judge cannot typically dismiss a ticket without the prosecutor recommending it, and to make a cogent legal argument to support a dismissal request you would most likely need the assistance of one of the experienced TX criminal defense lawyers who answer this question.
I am licensed to practice law in the State of NJ, and any response I make in regards to a question here on AVVO is meant for informational purposes only, and is NOT legal advice. No attorney-client relationship is established by this response, and you are strongly advised to consult with a lawyer licensed in your State with whom you will have an attorney-client relationship before making any decisions in regards to your legal issue. This response is not intended as an advertisement of my services as a lawyer.
You will generally start with the prosecutor, and then move to the judge. That is how it works in Bexar County, at least. Explain the situation, have documentation ready, and you may be able to fight this thing. Of course, I would always recommend an attorney who may be able to help you and file formal pre-trial motions to help you get the charge dismissed.
You are not supposed to drive if you have a medical condition which could impair your driving. Be careful with this. Speak to an attorney.
ANDREW ROBERTS CRIMINAL AND TRAFFIC TICKET DEFENSE ATTORNEY