The problem starts with the time between patent award and regulatory approval limiting the commercial exclusivity. This has driven big pharma to patent manufacturing processes instead of the compounds. If I understand it correctly from memory the Ritalin availability crisis was a example of process patent reengineering.
Edit: was not is.