Drug quality control