Cal. Health & Safety Code § 11551
(a) Whenever any court in this state grants probation to a person who the court has reason to believe is or has been a user of controlled substances, the court may require as a condition to probation that the probationer submit to periodic tests by a city or county health officer, or by a physician and surgeon appointed by the city or county health officer with the approval of the Attorney General, to determine, by whatever means is available, whether the probationer is addicted to a controlled substance.
In any case provided for in this subdivision, the city or county health officer, or the physician and surgeon appointed by the city or county health officer with the approval of the Attorney General shall report the results of the tests to the probation officer.