Notwithstanding the provisions of Sections 4011 and 4011.5, when it appears that the prisoner in need of medical or surgical treatment necessitating hospitalization or in need of medical or hospital care was arrested for, charged with, or convicted of an offense constituting a felony, the court in proceedings under Section 4011 or the sheriff or jailer in action taken under Section 4011. 5 may direct that the guard be removed from the prisoner while he is in the hospital, if it reasonably appears that the prisoner is physically unable to effectuate an escape or the prisoner does not constitute a danger to life or property.
Ca. Pen. Code § 4011.9