What purification measures are taken to ensure no side products are present in the medication? Because hardly any organic reaction is perfectly efficient, I'm guessing that multiple recrystallizations are performed. Also how would recrystallizations even be performed on an industrial scale? How much product is then lost and can it be recovered or is not economically advantageous to do so?
Most registered specifications will contain the main active pharmaceutical ingredient (API) at an assay of 98-102% to allow for hplc variation(the most common analytical technique for pharmaceuticals). The list of known impurities usually follows with their maximum limit ; this is usually derived from toxicology studies. But not always.
An exception is something like Sativex which has an assay of <90% for the main API, but the other ingredients are not detrimental but generally regarded as safe (GRAS); sterols, triglycerides.
The drug product then has the API in specified range and can comprise most of the medication e.g. paracetamol tablets, or not very much e.g. acyclovir in ointment form or cisatracurium besylate in water for injection. Excipients are added which could be seen to reduce the "purity" of the medication, but they are present to aid bioavailability, taste etc.
Any technique you can think of can be used industrially... at a cost. So while liquid -liquid extraction is cheapest and easiest, it rarely gives the desired purity. Recrystallisation is a cost effective technique and is frequently used industrially. Put solid in a reactor, pump in solvent, heat, cool. Extract, distil solvent, solvent switch, heat, cool is also valid.
Yield loss from industrial scale recrystallisation is usually 5% or greater. I have seen 30% for achiral material. I've seen 55% for a diastereomeric salt crystallisation (so at least 50% is to be expected).
Sometimes one crystallisation is enough; sometimes three are required. It depends on the chemical transformation efficiency and co-crystallising impurities.
As for recovery ; economic viability depends on the cost of the material. So at 20 dollars/kg, probably not. 15000 dollars/kg, probably yes.
Not all impurities are bad as they can be very similar to the API and simply have a different effect e.g. anti-histamine. Some could genotoxic and are controlled at the ppm level.
Unknown impurities are tightly controlled to, typically, the total being no more than (NMT) 0.5%. Again, there are exceptions.