California Welfare and Institutions Code Section 7350
CA Welf & Inst Code § 7350 (2017)
The provisions of this article except for Section 7355 shall not apply to any patient held upon an order of a court or judge in a proceeding arising out of a criminal action.