Cal. Penal Code § 2603.5
(a) Notwithstanding Section 2603, if an individual has been found incompetent to stand trial after having been charged with a misdemeanor offense, as described in Section 1370.01, and is confined in the county jail, antipsychotic medication may be administered without their prior informed consent only in the following circumstances:
(1) An emergency, as defined by either subdivision (m) of Section 5008 of the Welfare and Institutions Code or subdivision (d) of Section 2603 of the Penal Code.
(2)
(A) Upon a court’s determination that the individual is gravely disabled, as defined in subparagraph (A) of paragraph (1) of subdivision (h) of Section 5008 of the Welfare and Institutions Code, and that the individual does not have the capacity to consent to or refuse treatment with antipsychotic medication. The fact that an individual has temporary access to food, clothing, shelter, personal safety, and necessary medical care while incarcerated is not a basis to conclude that the individual is able to provide for their basic personal needs for food, clothing, shelter, personal safety, or necessary medical care, which shall be evaluated based upon the individual’s ability to provide for those needs while not incarcerated. The court shall consider opinions in the reports prepared pursuant to subdivision (b) of Section 1369, as applicable to the issue of whether the individual lacks the capacity to make decisions regarding the administration of antipsychotic medication, and shall proceed as follows:
(i) The court shall conduct a hearing before a superior court judge, a court-appointed commissioner or referee, or a court-appointed hearing officer, as specified in subdivision (c) of Section 5334 of the Welfare and Institutions Code, to determine whether any of the following is true:
(ii)
(b) Before an order authorizing the administration of involuntary medication is issued pursuant to this section, the person shall have the following rights:
(c) After hearing, involuntary medication may be administered if the court finds by clear and convincing evidence that all of the following conditions are met:
(d) The individual’s confinement shall not be extended to provide treatment to the individual with antipsychotic medication pursuant to this section. An order pursuant to this section shall be valid until the first of the following events occurs: