Cal. Penal Code § 6102
The primary purpose of the medical facility shall be the receiving, segregation, confinement, treatment, and care of males under the custody of the Department of Corrections and Rehabilitation or any agency thereof who are any of the following: