Hospitals are not allowed to keep you against your will unless they petition to have you committed, which usually only happens in cases of extreme injury/sickness or when a patient is not of sound mind.
You're free to leave AMA (Against Medical Advice). This is how it works in the States, at least. I'd hedge a bet that Canada is no less draconian than the US in that aspect
something planned or unplanned?