If, due to the prescribed medication or alcohol, the driver is “too impaired to safely operate a vehicle”  because of either or the combination of both, the prosecution can establish a basis for DUI conviction.  The prosecution, however,  must show both the impairment level and the causative link between that impairment and the the substances in order to prove their DUI charge.  It’s a little easier in the case of alcohol DUI, because of the presumptive level of .08, but even there, they have to show reasonable or probable cause of impairment to justify the arrest.   A DUI can rely on only legally prescribed medications in the system,  if the required level of impairment, due to those drugs, can be shown beyond a reasonable doubt.  Of course, illness, physical limitations, fatigue, and other conditions must all be be highlighted, and taken into account.