An autistic patient who hanged themselves outside the Royal Sussex County Hospital told clinicians they would kill themselves if they had to leave hospital.