Nothing in this chapter shall be construed as abrogating any rights of a person certified or someone acting on his or her behalf to petition for writ of habeas corpus and/or other relief. In addition, petitions may be specifically based upon, but not limited to, the following grounds:
(1) An alleged insufficiency or illegality of the proceedings leading to the patient's certification not previously litigated on appeal;(2) Although the certification proceedings were proper, the patient's continued detention or hospitalization or the form of his or her hospitalization is not warranted under the provisions of this chapter;(3) The absence of a planned and adequate treatment program to meet the needs of the patient.R.I. Gen. Laws § 40.1-5-12