There is a difference between someone who gets hooked while using illegal drugs recreationally and one who becomes addicted to prescription medicine while recovering from a medical injury, espeically if the firm which produced the drug didn't warn that it could be addictive.
Both individuals have used a drug illegally to their detriment.
I see no reason to draw lines of demarcation.
Each should be offered treatment before jail time.