It's even easier. You just shut it off and pull the drug while they're sleeping.
My dad had that happen at least once during a weeks long hospital stay. They took forever figuring out how to get him more morphine... as he'd already been prescribed and there are at least reasonable safeguards on the overprescription side.
They even had an idea who it was, as missing drugs was a problem in that ward. They didn't do anything, just said "watch out for that guy". I'm sure they eventually caught him... it's extremely likely someone like that is going to make a mistake... but he sure was hurting a lot of people along the way. The hospital sure could have tried harder to catch him.