
86 Cal.Rptr.2d 653 (1999)
73 Cal.App.4th 661
Matthew TERRY, Petitioner,
v.
The SUPERIOR COURT of San Luis Obispo County, Respondent,
The People, Real Party in Interest.
No. B127801.
Court of Appeal, Second District, Division Six.
July 15, 1999.
*654 Kenneth P. Cirisian, for Petitioner.
No appearance for Respondent.
Gerald T. Shea, San Luis Obispo County District Attorney and Ronald A. Abrams, Deputy District Attorney, for Real Party in Interest.

OPINION AND ORDER
GILBERT, Acting P.J.
To be found eligible for a drug treatment program under Penal Code[1] section 1000 a person must consent to various conditions. Here we conclude that the submission to an unreasonable search and seizure is not one of the conditions.
Petitioner Matthew Terry seeks relief by way of extraordinary writ to eliminate the drug testing and search terms the trial court imposed upon him as a condition of deferred entry of judgment. We conclude the trial court could lawfully impose drug testing conditions, but lacked the authority to impose search terms. We therefore grant a writ of mandate.

FACTS
Terry grew marijuana in a flower pot in his back yard. Pursuant to a lawful search by the police, he was arrested and charged with felony cultivation of marijuana. (Health & Saf.Code, § 11358.)
At Terry's arraignment the felony count was dismissed. Terry pled no contest to a new charge of misdemeanor possession of less than an ounce of marijuana. The court deferred entry of judgment pursuant to section 1000. The court also announced its intention to impose concomitant drug testing and search terms on Terry. (§ 1318.)[2]
Terry objected to the imposition of drug testing and search terms. The trial court reasoned that Terry's status was like that of an accused liberated from jail on his own recognizance ("OR") and, in such instance, it could lawfully impose search terms. (§ 1318.) The court required Terry to submit to unannounced chemical tests at the request of a peace or probation officer, and submit to searches and seizures of his person and property, and any vehicle he *655 owns or is operating, at the request of a peace or probation officer.
Terry petitioned this court for alternative writ of prohibition/mandate, in which he sought relief from the imposition of the test and search terms. We have granted an order to show cause.

DISCUSSION

1. Legality of Search Condition
Section 1000 provides that certain first-time drug offenders who meet specified conditions may, with the approval of the district attorney, bypass the normal criminal process and enter a drug treatment program. Prior to the statute's amendment in 1996, the program was called "drug diversion."
Effective January 1, 1997, some requirements of section 1000 et seq. were changed. Gone from the statutory scheme was pretrial diversion without a guilty plea.[3] In its stead, the accused is required to enter a guilty plea, and formal judgment is deferred.[4]
If a defendant performs satisfactorily during the deferral period, "the criminal charge or charges shall be dismissed." (§ 1000.3.) Section 1000.4, subdivision (a), provides: "Upon successful completion of a deferred entry of judgment program, the arrest upon which the judgment was deferred shall be deemed to have never occurred."
If a defendant has not performed satisfactorily during the period of deferred entry of judgment, "the court shall render a finding of guilt to the charge or charges pled, enter judgment, and schedule a sentencing hearing as otherwise provided in this code." (§ 1000.3.)
The plain objective of section 1000 is to permit "the courts to identify the experimental or tentative user before he becomes deeply involved with drugs, to show him the error of his ways by prompt exposure to educational and counseling programs in his own community, and to restore him to productive citizenship without the lasting stigma of a criminal conviction" and thereby reduce "the clogging of the criminal justice system." (People v. Superior Court (On Tai Ho) (1974) 11 Cal.3d 59, 61-62, 113 Cal.Rptr. 21, 520 P.2d 405.)
The statute's lofty purpose is borne out by recent studies that conclude that proper and effective drug treatment results in a decrease in crime. (Hora, Schuma, and Rosenthal, Therapeutic Jurisprudence and the Drug Treatment Court Movement: Revolutionizing the Criminal Justice Systems Response to Drug Abuse and Crime in America (1999) 74 Notre Dame L.Rev. 439, 536.) The statute, therefore, satisfies a worthy goal. It fits the Mikado's words although not his actions. "My object all sublime[,] I shall achieve in time To let the punishment fit the crime...." (W.S. Gilbert & Arthur Sullivan, The Mikado, Act II, in the Complete Plays of *656 Gilbert and Sullivan, pp. 343, 382 (The Modern Library Random House).)
The deferred entry of judgment, like other attributes of section 1000, is a creature of statute. (See Frederick v. Justice Court (1975) 47 Cal.App.3d 687, 690, 121 Cal.Rptr. 118.) Although the statute prescribes a number of terms and conditions, nowhere does it allow for the imposition of a search condition. In the absence of a compelling necessity, a court may not impose conditions beyond those specified in the statute. (Parra v. Municipal Court (1978) 83 Cal.App.3d 690, 694, 148 Cal. Rptr. 203.)
The prosecution argues that the recent amendments to section 1000 expand the trial court's discretion to impose conditions not found in the statute. It reasons that because Terry's bail has been exonerated, he is deemed to be released on OR. (§§ 1000.2, 1318.) The next logical step, argues the prosecution, is that a search term may be properly imposed as a condition of freedom on a person released on OR. (See In re York (1995) 9 Cal.4th 1133, 1137-1138, 40 Cal.Rptr.2d 308, 892 P.2d 804.)
This argument overlooks that the California Supreme Court in York drew a clear distinction between an OR release and release by way of diversion. (In re York, supra, 9 Cal.4th 1133, 1146, 40 Cal.Rptr.2d 308, 892 P.2d 804.) Significantly for our analysis, the court stated that the statutory scheme "did not include any provision authorizing a trial court to impose additional conditions," specifically search terms, "upon a defendant eligible for diversion." (Ibid.)
In York, our Supreme Court held that in certain circumstances, a court's release of a defendant on his or her own recognizance may be conditioned on the defendant's agreement to submit to random drug testing and to warrantless searches. (In re York, supra, 9 Cal-4th 1133, 1146-1147, 40 Cal.Rptr.2d 308, 892 P.2d 804.) The court concluded that the legislative history of section 1318, subdivision (a)(2), indicates that the Legislature intended to authorize courts to weigh considerations relating to public safety, quite aside from the issue whether the defendant will attend future court hearings. (Id., at p. 1144, 40 Cal.Rptr.2d 308, 892 P.2d 804.)
Unlike the diversion statutes, York pointed out that section 1318, subdivision (a)(2), specifically authorizes the imposition of "`all reasonable conditions'" for an OR release. (In re York, supra, 9 Cal.4th 1133, 1146, 40 Cal.Rptr.2d 308, 892 P.2d 804.) The diversion statutes, as construed by the court of appeal in Frederick v. justice Court, supra, 47 Cal.App.3d 687, 692, 121 Cal.Rptr. 118, do not include provisions authorizing a trial court to impose additional conditions upon a defendant eligible for diversion. (In re York, supra, 9 Cal.4th 1133, 1146, 40 Cal.Rptr.2d 308, 892 P.2d 804.)
It has long been established that a grant of diversion may not depend upon a waiver of Fourth Amendment rights. (People v. Fleming (1994) 22 Cal.App.4th 1566, 1570-1572, 28 Cal.Rptr.2d 78; Frederick v. Justice Court, supra, 47 Cal. App.3d 687, 690, 121 Cal.Rptr. 118.) The Legislature, obviously quite aware of this case law, has had ample opportunities to amend the law to require consent to a search as a condition of diversion-deferred sentencing. The court of appeal in People v. Fleming, supra, 22 Cal.App.4th at page 1572, 28 Cal.Rptr.2d 78, implored the Legislature to amend the law to enable the trial court to impose search conditions. The statute, both before and after the 1996 modifications, has no such provision. We are obliged to take this statute as we find it. (Morse v. Municipal Court (1974) 13 Cal.3d 149, 155-156, 118 Cal.Rptr. 14, 529 P.2d 46.)
As noted, the imposition of a search term deprives the defendant of his or her basic constitutional right to be free from random searches. We believe that the imposition of this additional term is a decision to be made by the Legislature. (Cf. Bermudez v. Municipal Court (1991) 1 Cal.4th 855, 864, 4 Cal.Rptr.2d 609, 823 P.2d 1210.)


*657 2. Drug Testing Condition

We find no merit to Terry's objection to imposition of drug testing terms. In contrast to a search term, drug testing is specifically provided for in section 1000, subdivision (e).[5]
Second, the condition of drug testing is most consistent with the legislative objective of freeing one from chemical dependence. For example, in a dependency case (In re Christopher H. (1996) 50 Cal. App.4th 1001, 57 Cal.Rptr.2d 861), the juvenile court required the father of a minor child to submit to random drug testing as part of a reunification plan. The appellate court aptly stated: "Random drug or alcohol testing will facilitate appellant's compliance with the remainder of the reunification plan. The possibility of random drug tests should provide an added incentive for appellant to avoid illicit drugs and excessive alcohol consumption, either of which will interfere with his ability to provide a suitable home for Christopher and achieve reunification." (Id., at p. 1008, 57 Cal. Rptr.2d 861.)

CONCLUSION
We conclude that the imposition of drug search terms on Terry is unlawful. Let a writ of mandate issue commanding the respondent San Luis Obispo County Superior Court to delete from its order of deferred entry of judgment, dated October 14, 1998, the requirement that Terry submit to warrantless searches. The order to show cause, having served its purpose, is vacated.
YEGAN, J., and COFFEE, J., concur.
NOTES
[1]  All statutory references are to the Penal Code unless otherwise stated.
[2]  Section 1318 allows the court to impose reasonable conditions on defendants who are released on their own recognizance.
[3]  Section 1000.1, subdivision (b), now provides in pertinent part: "If the defendant consents and waives his or her right to a speedy trial or a speedy preliminary hearing, the court may refer the case to the probation department or the court may summarily grant deferred entry of judgment if the defendant pleads guilty to the charge or charges and waives time for the pronouncement of judgment. When directed by the court, the probation department shall make an investigation and ... report its findings and recommendations to the court. The court shall make the final determination regarding education, treatment, or rehabilitation for the defendant. If the court determines that it is appropriate, the court shall grant deferred entry of judgment if the defendant pleads guilty to the charge or charges and waives time for the pronouncement of judgment."
[4]  Specifically, the amendments to the statute substituted the phrase "deferred entry of judgment" for the word "diversion", deleted violation of Health and Safety Code section 11370.1 from the list of offenses for which deferred entry of judgment is available, and provided that a guilty plea must be entered as part of the process. (See Historical Note, 50A West's Ann. Pen.Code (1999 pocket supp.) foll. § 1000, pp. 71-72.)
[5]  Section 1000, subdivision (e), states: "Any defendant who is participating in a program referred to in this section may be required to undergo analysis of his or her urine for the purpose of testing for the presence of any drug as part of the program. However, urine analysis results shall not be admissible as a basis for any new criminal prosecution or proceeding."
