Cal. Health & Safety Code § 1799.111
(a) Subject to subdivision (b), a licensed general acute care hospital, as defined in subdivision (a) of Section 1250, that is not a county-designated facility pursuant to Section 5150 of the Welfare and Institutions Code, a licensed acute psychiatric hospital, as defined in subdivision (b) of Section 1250, that is not a county-designated facility pursuant to Section 5150 of the Welfare and Institutions Code, licensed professional staff of those hospitals, or any physician and surgeon, providing emergency medical services in any department of those hospitals to a person at the hospital is not civilly or criminally liable for detaining a person if all of the following conditions exist during the detention:
(2) The hospital staff, treating physician and surgeon, or appropriate licensed mental health professional, have made, and documented, repeated unsuccessful efforts to find appropriate mental health treatment for the person.
(b) If the person is detained pursuant to subdivision (a) beyond eight hours, but less than 24 hours, both of the following additional conditions shall be met:
(c) In addition to the immunities set forth in subdivision (a), a licensed general acute care hospital, as defined in subdivision (a) of Section 1250, that is not a county-designated facility pursuant to Section 5150 of the Welfare and Institutions Code, a licensed acute psychiatric hospital, as defined by subdivision (b) of Section 1250, that is not a county-designated facility pursuant to Section 5150 of the Welfare and Institutions Code, licensed professional staff of those hospitals, or a physician and surgeon, providing emergency medical services in any department of those hospitals to a person at the hospital shall not be civilly or criminally liable for the actions of a person detained up to 24 hours in those hospitals who is subject to detention pursuant to subdivision (a) after that person’s release from the detention at the hospital, if all of the following conditions exist during the detention: