Not the exact same, but Vancouver is piloting something like this. You get evaluated by a doctor and if you're addicted and have fentanyl in your system (at high risk of OD), they will prescribe you hydromorphone (which is a very cherished street drug). There is a "vending machine" where you can put in your credentials and out pops your dose. You can do it as often as you want, but there is a minimum time between doses.[1]
[1]https://www.cbc.ca/news/canada/british-columbia/vancouver-dr...