As a condition of probation, parole or postrelease supervision, a probationer, parolee or person on postrelease supervision may be placed in a diagnostic, or treatment facility by order of the court or prisoner review board. Placement in a diagnostic or treatment facility shall not exceed 90 days or the maximum period of the prison sentence that could be imposed, but may be renewed for further ninety-day periods on certificates presented to the court by the director of such facility.
K.S.A. 22-3712