A patient who died under the care of a mental health hospital was allowed to leave day prior despite testing positive for cocaine.