The mum-of-two from Edinburgh was about to discharge herself from hospital before medics changed their minds.