Get a lawyer now
Depending on how low the results of the urinalysis were, you may be able to dismiss the certificate. If they're really high, you may still be able to do this, but these things really depend on what instructions your doctor gave you (can you drive or not) and if there are any warnings on the medication, themselves. I've been told that urinalysis and blood tests are more accurate than the breathalyzer, so disputing their findings may not be possible, but you'd have a strong case if you were told you can drive and the medication does not have a warning. Plus, you should be able to testify as to how long ago you took the medication in reference to when you were arrested, but the urinalysis may dispute that if the results were pretty high (though other factors can be an issue, such as an empty stomach and your height/weight and the effects on the medication/absorption and elimination rates). However, if you were told you could drive and you can prove that, they may throw this out. That would mean the only evidence the prosecution has is your behavior according to the cop and others around that night/morning. You mentioned you didn't have any field tests, so it will be a matter of whatever else the cop observed- were you weaving? Did you go through a stop light or red light or make a bad turn? Were you speeding? Why did you get pulled over? (By the way, going through a stop light or red light or speeding is harder to deal with in court). The court looks at your vehicle as a weapon, so if you didn't commit any violations, it's better.
If you haven't done so, get a lawyer immediately. Make sure they specialize in DUI cases and have had other cases similar to yours. Make sure they have at least decent success rate in cases like yours.
You may have to hire an expert witness- your lawyer may suggest this. Hopefully they're someone the lawyer has used before that has a good success rate and is an expert in a few fields such as an MD trained on the machines they use to test urine, who also has some law background and knows the system. Start gathering your medical records. You'll have to physically go in to sign release forms to get copies of your records. If your doctor told you that you can drive while taking the medication, your lawyer should ask to get a statement from them (or come in to testify).
Were you with anyone or did you talk with anyone that can testify as to your state of mind, tiredness, or general behavior just prior to driving? They may be asked to come in to testify for you at the trial, as well.
Based on all this, you may be able to get this knocked down to a reckless driving charge. There are still issues with that- possible suspension/restriction of driving, fines, it's on your record, you may have to file a SR22 or FR44 with your insurance company/DMV, etc., which can be expensive and be required for three years or more. Or maybe your case is strong enough (ie medication is okay to drive with or your urinalysis results were so low and you can effectively dispute the cop's testimony as to your behavior that night/morning) that you can get this dismissed. But definitely start with a lawyer- immediately. Once you contact counsel, you can get a statement from them with their available court dates. You'll still have to go in for your initial court date and you'll go in front of the judge to tell them you obtained counsel and here are their available dates (the lawyer should file a copy of this letter, but take one with you- don't trust that the judge will be provided a copy). They'll reschedule your trial for whatever date the lawyer and prosecuter and cop can make.
And when you go to court, dress professionally and don't act guilty. The judge will be looking at your demeanor and you want him/her to like you. Keep in mind, too, that the judge will tend to take the cop's word about your behavior at the time of arrest as the truth, so you'll have to show that his/her observations were the result of your tiredness/stress and not intoxication.
I just had my trial on Tuesday. I hired a lawyer and he had me hire an expert witness and thank God I did this because I would have been facing a much more serious charge. I was able to get my BAC certificate thrown out (I had a breathalyzer) because of a medical condition that is known to affect the results of the test. My witness was an MD, a lawyer, and certified/trained on the equipment used for testing as well as field sobriety tests. I was still convicted, but of a lesser charge. It was well worth the money and my lawyer let me pay in installments, which helps because not everyone has that kind of money sitting around.
Good luck to you. You're not alone even though I'm sure that's how you're feeling right now.