Amended IN Assembly March 24, 2025 CALIFORNIA LEGISLATURE 20252026 REGULAR SESSION Assembly Bill No. 994Introduced by Assembly Member HadwickFebruary 20, 2025 An act to amend Section 4001 4007 of the Penal Code, relating to jails. LEGISLATIVE COUNSEL'S DIGESTAB 994, as amended, Hadwick. County jails.Existing law authorizes the sheriff to remove a prisoner to any California state prison for safekeeping when there are reasonable grounds to believe that the prisoner may be forcibly removed from a county jail, as specified. Existing law also authorizes a judge of the superior court to, on the request of the county sheriff and with the consent of the Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to secure confinement of a prisoner, subject to space available, when there are reasonable grounds to believe that the prisoner in a county jail is likely to be a threat to other persons in the facility or is likely to cause substantial damage to the facility.This bill would require, when a person currently committed to a state prison is alleged to have committed a new offense, any pretrial confinement pending disposition of charges for the new offense that would otherwise be served in the county jail to occur at the nearest state prison that would be able to secure confinement of the prisoner, subject to space available, or the state prison at which the prisoner is currently confined, upon the request of the county sheriff and unless the person is otherwise eligible for and obtains pretrial release.Existing law requires each county jail to contain a sufficient number of rooms to allow persons belonging to specified classes to be confined separately from other persons belonging to other classes.This bill would make technical, nonsubstantive changes to those provisions.Digest Key Vote: MAJORITY Appropriation: NO Fiscal Committee: NOYES Local Program: NO Bill TextThe people of the State of California do enact as follows:SECTION 1. Section 4007 of the Penal Code is amended to read:4007. (a) When there is no jail in the county, or when the jail becomes unfit or unsafe for the confinement of prisoners, the judge of the superior court may, by a written order filed with the clerk of the court, designate the jail of a contiguous county for the confinement of any prisoner of his or her their county, and may at any time modify or vacate the order.When (b) When there are reasonable grounds to believe that a prisoner may be forcibly removed from a county jail, the sheriff may remove the prisoner to any California state prison for safekeeping and it is the duty of the warden of the prison to accept and detain the prisoner in his or her their custody until his or her their removal is ordered by the superior court of the county from which he or she the prisoner was delivered. Immediately upon receiving the prisoner the warden shall advise the Director of Corrections Secretary of the Department of Corrections and Rehabilitation of that fact in writing.When (c) When a county prisoner requires medical treatment necessitating hospitalization which cannot be provided at the county jail or county hospital because of lack of adequate detention facilities, and when the prisoner also presents a serious custodial problem because of his or her their past or present behavior, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to provide the necessary medical treatment and secure confinement of the prisoner. The written order of the judge shall be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall not be transferred to the state prison or correctional facility prior to the hearing, except upon a determination by the physician responsible for the prisoners health care that a medical emergency exists which requires the transfer of the prisoner to the state prison or correctional facility prior to the hearing. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The prisoner may waive his or her their right to this hearing in writing at any time. If the prisoner waives his or her their right to the hearing, the county sheriff shall notify the prisoners attorney of the transfer within 48 hours, or the next business day, whichever is later. The court may modify or vacate the order at any time.The (d) The rate of compensation for the prisoners medical treatment and confinement within a California state prison or correctional facility shall be established by the Department of Corrections, Department of Corrections and Rehabilitation, and shall be charged against the county making the request.When (e) When there are reasonable grounds to believe that there is a prisoner in a county jail who is likely to be a threat to other persons in the facility or who is likely to cause substantial damage to the facility, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to secure confinement of the prisoner, subject to space available. The written order of the judge must be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The court may modify or vacate that order at any time. The rate of compensation for the prisoners confinement within a California state prison or correctional facility shall be established by the Department of Corrections Department of Corrections and Rehabilitation and shall be charged against the county making the request.(f) Notwithstanding Section 4000 or 4001, when a person currently committed to a state prison is alleged to have committed a new offense, any pretrial confinement pending disposition of charges for the new offense that would otherwise be served in the county jail shall occur at the nearest state prison that would be able to secure confinement of the prisoner, subject to space available, or the state prison at which the prisoner is currently confined, upon the request of the county sheriff and unless the person is otherwise eligible for and obtains pretrial release.SECTION 1.Section 4001 of the Penal Code is amended to read:4001.A county jail shall contain a sufficient number of rooms to allow all persons belonging to any one of the following classes to be confined separately and distinctly from persons belonging to either of the other classes:(a)Persons committed on criminal process and detained for trial.(b)Persons already convicted of crime and held under sentence.(c)Persons detained as witnesses or held under civil process, or under an order imposing punishment for a contempt. Amended IN Assembly March 24, 2025 CALIFORNIA LEGISLATURE 20252026 REGULAR SESSION Assembly Bill No. 994Introduced by Assembly Member HadwickFebruary 20, 2025 An act to amend Section 4001 4007 of the Penal Code, relating to jails. LEGISLATIVE COUNSEL'S DIGESTAB 994, as amended, Hadwick. County jails.Existing law authorizes the sheriff to remove a prisoner to any California state prison for safekeeping when there are reasonable grounds to believe that the prisoner may be forcibly removed from a county jail, as specified. Existing law also authorizes a judge of the superior court to, on the request of the county sheriff and with the consent of the Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to secure confinement of a prisoner, subject to space available, when there are reasonable grounds to believe that the prisoner in a county jail is likely to be a threat to other persons in the facility or is likely to cause substantial damage to the facility.This bill would require, when a person currently committed to a state prison is alleged to have committed a new offense, any pretrial confinement pending disposition of charges for the new offense that would otherwise be served in the county jail to occur at the nearest state prison that would be able to secure confinement of the prisoner, subject to space available, or the state prison at which the prisoner is currently confined, upon the request of the county sheriff and unless the person is otherwise eligible for and obtains pretrial release.Existing law requires each county jail to contain a sufficient number of rooms to allow persons belonging to specified classes to be confined separately from other persons belonging to other classes.This bill would make technical, nonsubstantive changes to those provisions.Digest Key Vote: MAJORITY Appropriation: NO Fiscal Committee: NOYES Local Program: NO Amended IN Assembly March 24, 2025 Amended IN Assembly March 24, 2025 CALIFORNIA LEGISLATURE 20252026 REGULAR SESSION Assembly Bill No. 994 Introduced by Assembly Member HadwickFebruary 20, 2025 Introduced by Assembly Member Hadwick February 20, 2025 An act to amend Section 4001 4007 of the Penal Code, relating to jails. LEGISLATIVE COUNSEL'S DIGEST ## LEGISLATIVE COUNSEL'S DIGEST AB 994, as amended, Hadwick. County jails. Existing law authorizes the sheriff to remove a prisoner to any California state prison for safekeeping when there are reasonable grounds to believe that the prisoner may be forcibly removed from a county jail, as specified. Existing law also authorizes a judge of the superior court to, on the request of the county sheriff and with the consent of the Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to secure confinement of a prisoner, subject to space available, when there are reasonable grounds to believe that the prisoner in a county jail is likely to be a threat to other persons in the facility or is likely to cause substantial damage to the facility.This bill would require, when a person currently committed to a state prison is alleged to have committed a new offense, any pretrial confinement pending disposition of charges for the new offense that would otherwise be served in the county jail to occur at the nearest state prison that would be able to secure confinement of the prisoner, subject to space available, or the state prison at which the prisoner is currently confined, upon the request of the county sheriff and unless the person is otherwise eligible for and obtains pretrial release.Existing law requires each county jail to contain a sufficient number of rooms to allow persons belonging to specified classes to be confined separately from other persons belonging to other classes.This bill would make technical, nonsubstantive changes to those provisions. Existing law authorizes the sheriff to remove a prisoner to any California state prison for safekeeping when there are reasonable grounds to believe that the prisoner may be forcibly removed from a county jail, as specified. Existing law also authorizes a judge of the superior court to, on the request of the county sheriff and with the consent of the Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to secure confinement of a prisoner, subject to space available, when there are reasonable grounds to believe that the prisoner in a county jail is likely to be a threat to other persons in the facility or is likely to cause substantial damage to the facility. This bill would require, when a person currently committed to a state prison is alleged to have committed a new offense, any pretrial confinement pending disposition of charges for the new offense that would otherwise be served in the county jail to occur at the nearest state prison that would be able to secure confinement of the prisoner, subject to space available, or the state prison at which the prisoner is currently confined, upon the request of the county sheriff and unless the person is otherwise eligible for and obtains pretrial release. Existing law requires each county jail to contain a sufficient number of rooms to allow persons belonging to specified classes to be confined separately from other persons belonging to other classes. This bill would make technical, nonsubstantive changes to those provisions. ## Digest Key ## Bill Text The people of the State of California do enact as follows:SECTION 1. Section 4007 of the Penal Code is amended to read:4007. (a) When there is no jail in the county, or when the jail becomes unfit or unsafe for the confinement of prisoners, the judge of the superior court may, by a written order filed with the clerk of the court, designate the jail of a contiguous county for the confinement of any prisoner of his or her their county, and may at any time modify or vacate the order.When (b) When there are reasonable grounds to believe that a prisoner may be forcibly removed from a county jail, the sheriff may remove the prisoner to any California state prison for safekeeping and it is the duty of the warden of the prison to accept and detain the prisoner in his or her their custody until his or her their removal is ordered by the superior court of the county from which he or she the prisoner was delivered. Immediately upon receiving the prisoner the warden shall advise the Director of Corrections Secretary of the Department of Corrections and Rehabilitation of that fact in writing.When (c) When a county prisoner requires medical treatment necessitating hospitalization which cannot be provided at the county jail or county hospital because of lack of adequate detention facilities, and when the prisoner also presents a serious custodial problem because of his or her their past or present behavior, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to provide the necessary medical treatment and secure confinement of the prisoner. The written order of the judge shall be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall not be transferred to the state prison or correctional facility prior to the hearing, except upon a determination by the physician responsible for the prisoners health care that a medical emergency exists which requires the transfer of the prisoner to the state prison or correctional facility prior to the hearing. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The prisoner may waive his or her their right to this hearing in writing at any time. If the prisoner waives his or her their right to the hearing, the county sheriff shall notify the prisoners attorney of the transfer within 48 hours, or the next business day, whichever is later. The court may modify or vacate the order at any time.The (d) The rate of compensation for the prisoners medical treatment and confinement within a California state prison or correctional facility shall be established by the Department of Corrections, Department of Corrections and Rehabilitation, and shall be charged against the county making the request.When (e) When there are reasonable grounds to believe that there is a prisoner in a county jail who is likely to be a threat to other persons in the facility or who is likely to cause substantial damage to the facility, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to secure confinement of the prisoner, subject to space available. The written order of the judge must be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The court may modify or vacate that order at any time. The rate of compensation for the prisoners confinement within a California state prison or correctional facility shall be established by the Department of Corrections Department of Corrections and Rehabilitation and shall be charged against the county making the request.(f) Notwithstanding Section 4000 or 4001, when a person currently committed to a state prison is alleged to have committed a new offense, any pretrial confinement pending disposition of charges for the new offense that would otherwise be served in the county jail shall occur at the nearest state prison that would be able to secure confinement of the prisoner, subject to space available, or the state prison at which the prisoner is currently confined, upon the request of the county sheriff and unless the person is otherwise eligible for and obtains pretrial release.SECTION 1.Section 4001 of the Penal Code is amended to read:4001.A county jail shall contain a sufficient number of rooms to allow all persons belonging to any one of the following classes to be confined separately and distinctly from persons belonging to either of the other classes:(a)Persons committed on criminal process and detained for trial.(b)Persons already convicted of crime and held under sentence.(c)Persons detained as witnesses or held under civil process, or under an order imposing punishment for a contempt. The people of the State of California do enact as follows: ## The people of the State of California do enact as follows: SECTION 1. Section 4007 of the Penal Code is amended to read:4007. (a) When there is no jail in the county, or when the jail becomes unfit or unsafe for the confinement of prisoners, the judge of the superior court may, by a written order filed with the clerk of the court, designate the jail of a contiguous county for the confinement of any prisoner of his or her their county, and may at any time modify or vacate the order.When (b) When there are reasonable grounds to believe that a prisoner may be forcibly removed from a county jail, the sheriff may remove the prisoner to any California state prison for safekeeping and it is the duty of the warden of the prison to accept and detain the prisoner in his or her their custody until his or her their removal is ordered by the superior court of the county from which he or she the prisoner was delivered. Immediately upon receiving the prisoner the warden shall advise the Director of Corrections Secretary of the Department of Corrections and Rehabilitation of that fact in writing.When (c) When a county prisoner requires medical treatment necessitating hospitalization which cannot be provided at the county jail or county hospital because of lack of adequate detention facilities, and when the prisoner also presents a serious custodial problem because of his or her their past or present behavior, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to provide the necessary medical treatment and secure confinement of the prisoner. The written order of the judge shall be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall not be transferred to the state prison or correctional facility prior to the hearing, except upon a determination by the physician responsible for the prisoners health care that a medical emergency exists which requires the transfer of the prisoner to the state prison or correctional facility prior to the hearing. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The prisoner may waive his or her their right to this hearing in writing at any time. If the prisoner waives his or her their right to the hearing, the county sheriff shall notify the prisoners attorney of the transfer within 48 hours, or the next business day, whichever is later. The court may modify or vacate the order at any time.The (d) The rate of compensation for the prisoners medical treatment and confinement within a California state prison or correctional facility shall be established by the Department of Corrections, Department of Corrections and Rehabilitation, and shall be charged against the county making the request.When (e) When there are reasonable grounds to believe that there is a prisoner in a county jail who is likely to be a threat to other persons in the facility or who is likely to cause substantial damage to the facility, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to secure confinement of the prisoner, subject to space available. The written order of the judge must be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The court may modify or vacate that order at any time. The rate of compensation for the prisoners confinement within a California state prison or correctional facility shall be established by the Department of Corrections Department of Corrections and Rehabilitation and shall be charged against the county making the request.(f) Notwithstanding Section 4000 or 4001, when a person currently committed to a state prison is alleged to have committed a new offense, any pretrial confinement pending disposition of charges for the new offense that would otherwise be served in the county jail shall occur at the nearest state prison that would be able to secure confinement of the prisoner, subject to space available, or the state prison at which the prisoner is currently confined, upon the request of the county sheriff and unless the person is otherwise eligible for and obtains pretrial release. SECTION 1. Section 4007 of the Penal Code is amended to read: ### SECTION 1. 4007. (a) When there is no jail in the county, or when the jail becomes unfit or unsafe for the confinement of prisoners, the judge of the superior court may, by a written order filed with the clerk of the court, designate the jail of a contiguous county for the confinement of any prisoner of his or her their county, and may at any time modify or vacate the order.When (b) When there are reasonable grounds to believe that a prisoner may be forcibly removed from a county jail, the sheriff may remove the prisoner to any California state prison for safekeeping and it is the duty of the warden of the prison to accept and detain the prisoner in his or her their custody until his or her their removal is ordered by the superior court of the county from which he or she the prisoner was delivered. Immediately upon receiving the prisoner the warden shall advise the Director of Corrections Secretary of the Department of Corrections and Rehabilitation of that fact in writing.When (c) When a county prisoner requires medical treatment necessitating hospitalization which cannot be provided at the county jail or county hospital because of lack of adequate detention facilities, and when the prisoner also presents a serious custodial problem because of his or her their past or present behavior, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to provide the necessary medical treatment and secure confinement of the prisoner. The written order of the judge shall be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall not be transferred to the state prison or correctional facility prior to the hearing, except upon a determination by the physician responsible for the prisoners health care that a medical emergency exists which requires the transfer of the prisoner to the state prison or correctional facility prior to the hearing. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The prisoner may waive his or her their right to this hearing in writing at any time. If the prisoner waives his or her their right to the hearing, the county sheriff shall notify the prisoners attorney of the transfer within 48 hours, or the next business day, whichever is later. The court may modify or vacate the order at any time.The (d) The rate of compensation for the prisoners medical treatment and confinement within a California state prison or correctional facility shall be established by the Department of Corrections, Department of Corrections and Rehabilitation, and shall be charged against the county making the request.When (e) When there are reasonable grounds to believe that there is a prisoner in a county jail who is likely to be a threat to other persons in the facility or who is likely to cause substantial damage to the facility, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to secure confinement of the prisoner, subject to space available. The written order of the judge must be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The court may modify or vacate that order at any time. The rate of compensation for the prisoners confinement within a California state prison or correctional facility shall be established by the Department of Corrections Department of Corrections and Rehabilitation and shall be charged against the county making the request.(f) Notwithstanding Section 4000 or 4001, when a person currently committed to a state prison is alleged to have committed a new offense, any pretrial confinement pending disposition of charges for the new offense that would otherwise be served in the county jail shall occur at the nearest state prison that would be able to secure confinement of the prisoner, subject to space available, or the state prison at which the prisoner is currently confined, upon the request of the county sheriff and unless the person is otherwise eligible for and obtains pretrial release. 4007. (a) When there is no jail in the county, or when the jail becomes unfit or unsafe for the confinement of prisoners, the judge of the superior court may, by a written order filed with the clerk of the court, designate the jail of a contiguous county for the confinement of any prisoner of his or her their county, and may at any time modify or vacate the order.When (b) When there are reasonable grounds to believe that a prisoner may be forcibly removed from a county jail, the sheriff may remove the prisoner to any California state prison for safekeeping and it is the duty of the warden of the prison to accept and detain the prisoner in his or her their custody until his or her their removal is ordered by the superior court of the county from which he or she the prisoner was delivered. Immediately upon receiving the prisoner the warden shall advise the Director of Corrections Secretary of the Department of Corrections and Rehabilitation of that fact in writing.When (c) When a county prisoner requires medical treatment necessitating hospitalization which cannot be provided at the county jail or county hospital because of lack of adequate detention facilities, and when the prisoner also presents a serious custodial problem because of his or her their past or present behavior, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to provide the necessary medical treatment and secure confinement of the prisoner. The written order of the judge shall be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall not be transferred to the state prison or correctional facility prior to the hearing, except upon a determination by the physician responsible for the prisoners health care that a medical emergency exists which requires the transfer of the prisoner to the state prison or correctional facility prior to the hearing. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The prisoner may waive his or her their right to this hearing in writing at any time. If the prisoner waives his or her their right to the hearing, the county sheriff shall notify the prisoners attorney of the transfer within 48 hours, or the next business day, whichever is later. The court may modify or vacate the order at any time.The (d) The rate of compensation for the prisoners medical treatment and confinement within a California state prison or correctional facility shall be established by the Department of Corrections, Department of Corrections and Rehabilitation, and shall be charged against the county making the request.When (e) When there are reasonable grounds to believe that there is a prisoner in a county jail who is likely to be a threat to other persons in the facility or who is likely to cause substantial damage to the facility, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to secure confinement of the prisoner, subject to space available. The written order of the judge must be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The court may modify or vacate that order at any time. The rate of compensation for the prisoners confinement within a California state prison or correctional facility shall be established by the Department of Corrections Department of Corrections and Rehabilitation and shall be charged against the county making the request.(f) Notwithstanding Section 4000 or 4001, when a person currently committed to a state prison is alleged to have committed a new offense, any pretrial confinement pending disposition of charges for the new offense that would otherwise be served in the county jail shall occur at the nearest state prison that would be able to secure confinement of the prisoner, subject to space available, or the state prison at which the prisoner is currently confined, upon the request of the county sheriff and unless the person is otherwise eligible for and obtains pretrial release. 4007. (a) When there is no jail in the county, or when the jail becomes unfit or unsafe for the confinement of prisoners, the judge of the superior court may, by a written order filed with the clerk of the court, designate the jail of a contiguous county for the confinement of any prisoner of his or her their county, and may at any time modify or vacate the order.When (b) When there are reasonable grounds to believe that a prisoner may be forcibly removed from a county jail, the sheriff may remove the prisoner to any California state prison for safekeeping and it is the duty of the warden of the prison to accept and detain the prisoner in his or her their custody until his or her their removal is ordered by the superior court of the county from which he or she the prisoner was delivered. Immediately upon receiving the prisoner the warden shall advise the Director of Corrections Secretary of the Department of Corrections and Rehabilitation of that fact in writing.When (c) When a county prisoner requires medical treatment necessitating hospitalization which cannot be provided at the county jail or county hospital because of lack of adequate detention facilities, and when the prisoner also presents a serious custodial problem because of his or her their past or present behavior, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to provide the necessary medical treatment and secure confinement of the prisoner. The written order of the judge shall be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall not be transferred to the state prison or correctional facility prior to the hearing, except upon a determination by the physician responsible for the prisoners health care that a medical emergency exists which requires the transfer of the prisoner to the state prison or correctional facility prior to the hearing. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The prisoner may waive his or her their right to this hearing in writing at any time. If the prisoner waives his or her their right to the hearing, the county sheriff shall notify the prisoners attorney of the transfer within 48 hours, or the next business day, whichever is later. The court may modify or vacate the order at any time.The (d) The rate of compensation for the prisoners medical treatment and confinement within a California state prison or correctional facility shall be established by the Department of Corrections, Department of Corrections and Rehabilitation, and shall be charged against the county making the request.When (e) When there are reasonable grounds to believe that there is a prisoner in a county jail who is likely to be a threat to other persons in the facility or who is likely to cause substantial damage to the facility, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to secure confinement of the prisoner, subject to space available. The written order of the judge must be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The court may modify or vacate that order at any time. The rate of compensation for the prisoners confinement within a California state prison or correctional facility shall be established by the Department of Corrections Department of Corrections and Rehabilitation and shall be charged against the county making the request.(f) Notwithstanding Section 4000 or 4001, when a person currently committed to a state prison is alleged to have committed a new offense, any pretrial confinement pending disposition of charges for the new offense that would otherwise be served in the county jail shall occur at the nearest state prison that would be able to secure confinement of the prisoner, subject to space available, or the state prison at which the prisoner is currently confined, upon the request of the county sheriff and unless the person is otherwise eligible for and obtains pretrial release. 4007. (a) When there is no jail in the county, or when the jail becomes unfit or unsafe for the confinement of prisoners, the judge of the superior court may, by a written order filed with the clerk of the court, designate the jail of a contiguous county for the confinement of any prisoner of his or her their county, and may at any time modify or vacate the order. When (b) When there are reasonable grounds to believe that a prisoner may be forcibly removed from a county jail, the sheriff may remove the prisoner to any California state prison for safekeeping and it is the duty of the warden of the prison to accept and detain the prisoner in his or her their custody until his or her their removal is ordered by the superior court of the county from which he or she the prisoner was delivered. Immediately upon receiving the prisoner the warden shall advise the Director of Corrections Secretary of the Department of Corrections and Rehabilitation of that fact in writing. When (c) When a county prisoner requires medical treatment necessitating hospitalization which cannot be provided at the county jail or county hospital because of lack of adequate detention facilities, and when the prisoner also presents a serious custodial problem because of his or her their past or present behavior, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to provide the necessary medical treatment and secure confinement of the prisoner. The written order of the judge shall be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall not be transferred to the state prison or correctional facility prior to the hearing, except upon a determination by the physician responsible for the prisoners health care that a medical emergency exists which requires the transfer of the prisoner to the state prison or correctional facility prior to the hearing. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The prisoner may waive his or her their right to this hearing in writing at any time. If the prisoner waives his or her their right to the hearing, the county sheriff shall notify the prisoners attorney of the transfer within 48 hours, or the next business day, whichever is later. The court may modify or vacate the order at any time. The (d) The rate of compensation for the prisoners medical treatment and confinement within a California state prison or correctional facility shall be established by the Department of Corrections, Department of Corrections and Rehabilitation, and shall be charged against the county making the request. When (e) When there are reasonable grounds to believe that there is a prisoner in a county jail who is likely to be a threat to other persons in the facility or who is likely to cause substantial damage to the facility, the judge of the superior court may, on the request of the county sheriff and with the consent of the Director of Corrections, Secretary of the Department of Corrections and Rehabilitation, designate by written order the nearest state prison or correctional facility which would be able to secure confinement of the prisoner, subject to space available. The written order of the judge must be filed with the clerk of the court. The court shall immediately calendar the matter for a hearing to determine whether the order shall continue or be rescinded. The hearing shall be held within 48 hours of the initial order or the next judicial day, whichever occurs later. The prisoner shall be entitled to be present at the hearing and to be represented by counsel. The court may modify or vacate that order at any time. The rate of compensation for the prisoners confinement within a California state prison or correctional facility shall be established by the Department of Corrections Department of Corrections and Rehabilitation and shall be charged against the county making the request. (f) Notwithstanding Section 4000 or 4001, when a person currently committed to a state prison is alleged to have committed a new offense, any pretrial confinement pending disposition of charges for the new offense that would otherwise be served in the county jail shall occur at the nearest state prison that would be able to secure confinement of the prisoner, subject to space available, or the state prison at which the prisoner is currently confined, upon the request of the county sheriff and unless the person is otherwise eligible for and obtains pretrial release. A county jail shall contain a sufficient number of rooms to allow all persons belonging to any one of the following classes to be confined separately and distinctly from persons belonging to either of the other classes: (a)Persons committed on criminal process and detained for trial. (b)Persons already convicted of crime and held under sentence. (c)Persons detained as witnesses or held under civil process, or under an order imposing punishment for a contempt.