Prison isn't the right idea. But getting them into some sort of treatment would make sense. And that could be court mandated for repeat offenders for some crimes.
That was what was supposed to happen in Oregon when they decriminalized drugs. However, building the treatment centers, shelters, etc took forever, in part due to communities pushing back against these facilities being built in their neighborhoods, and you still need a well-staffed justice system with sufficient judges and public defenders to actually process offenders in a timely fashion or at all. Lack of public defenders, judges and jail capacity is why Portland has so much catch and release, not due to unwillingness to enforce the law.
I kind of read the suggestion as a deterrent for dealers and people engaged in drug trafficking, which could lead to less addicts... Not as "jail the junkies!"
And? Doctors are not supposed to be a pharma dispensary. Depending on motivational factors a doctor may either tell someone to suck it up, quickly fill out a standard subscription to cover up the symptoms or spends some time to diagnose and fix the root cause and then prescribe medication by taking into account but the patients immediate needs and the long-term health impacts.