(1) The Department of Corrections is authorized to transfer substance abuse impaired persons, as defined in chapter 397, and tuberculous or other prisoners requiring specialized services to appropriate public or private facilities or programs for the purpose of providing specialized services or treatment for as long as the services or treatment is needed, but for no longer than the remainder of the prisoner’s sentence.
(2) The Department of Corrections is authorized to enter into agreements with the controlling authorities of such state institutions which have or are provided with appropriate facilities for the secure confinement and treatment of substance abuse impaired persons, mentally ill persons, and tuberculous persons. In any such agreement, the department shall provide for custodial personnel to maintain proper security of persons transferred from the correctional system to any other state institution. Such custodial personnel shall be employed and paid by the department and subject to rules such as are agreed upon jointly by it and the controlling authority entering into such agreement.
(3) The department shall reimburse the institution furnishing treatment at a figure agreed upon by it and the controlling authority of such institution.
(4) When, in the opinion of the superintendent of an institution to which a prisoner has been transferred, such prisoner has been cured, or will no longer benefit from treatment at that institution, other than a mentally ill prisoner, the superintendent shall notify the department which shall, at the earliest practicable date thereafter, convey such prisoner to the appropriate classification center for reclassification.
(5) When the department plans to release a mentally ill or retarded offender, an involuntary commitment hearing shall be held as soon as possible prior to his or her release, according to the provisions of chapter 393 or chapter 394.
(6) A prisoner who has been determined by the Department of Children and Family Services and the Department of Corrections to be amenable to rehabilitative treatment for sexual deviation, and who has voluntarily agreed to participate in such rehabilitative treatment, may be transferred to the Department of Children and Family Services provided appropriate bed space is available.
(7) A “mentally ill person” is one who has an impairment of the emotional processes, of the ability to exercise conscious control of one’s actions, or of the ability to perceive reality or to understand, which impairment substantially interferes with a person’s ability to meet the ordinary demands of living, regardless of etiology.