Yes. Under the law it is illegal to drive or be in physical control of a vehicle if you are under the influence of a chemical substance or a controlled substance to the extent that your normal faculties are impaired.
To put that in simpler terms, if you take any drugs that affect your driving, you can get a DUI. The law does not make an exception for prescription medication. It does not matter that you took your medication as directed. The officers can still arrest you and you can still be convicted.
If you have been arrested for DUI while taking prescription medication call an attorney immediately. There are several defenses that may be available to you. If you don’t contact an attorney you may not be able to take advantage of these defenses.