Each correctional facility shall adopt a classification system for inmates to provide for the security, safety, and order of the correctional facility and for the safety and security of the community. If the correctional facility has adopted a classification system approved by the department of corrections and rehabilitation, the correctional facility is not required to comply with subsections 3, 4, and 5. In grade one and grade two correctional facilities and, where practicable, in grade three correctional facilities, the following groups of inmates must be housed separately from each other:
1. Female inmates from male inmates.2. Juveniles from adults, except that an adult held under a delinquency proceeding may be held with juveniles and a juvenile transferred or waived to adult court on a felony criminal offense may be housed with adults in a jail or regional correctional facility.3. Persons detained for hearing or trial from inmates under sentence of imprisonment, unless authorized to be housed together by the administrator for security, order, or rehabilitation.4. Persons detained for hearing or trial or under sentence of imprisonment from persons otherwise detained by order of the court, unless authorized to be housed together by the administrator for security, order, or rehabilitation.5. Inmates who may have special needs as determined by the correctional facility or whose behavior may present a serious threat to the safety or security of the correctional facility, the staff, the inmate, or other inmates.