The Whiting Forensic Hospital shall exist for the care and treatment of (1) patients with psychiatric disabilities, confined in facilities under the control of the Department of Mental Health and Addiction Services, including persons who require care and treatment under maximum security conditions, (2) persons convicted of any offense enumerated in § 17a-566 who, after examination by the staff of the diagnostic unit of the hospital as herein provided, are determined to have psychiatric disabilities and be dangerous to themselves or others and to require custody, care and treatment at the hospital, (3) inmates in the custody of the Commissioner of Correction who are transferred in accordance with sections 17a-512 to 17a-517, inclusive, and who require custody, care and treatment at the hospital, and (4) persons committed to the hospital pursuant to § 17a-582 or 54-56d.