SAN FRANCISCO — Law and order may soon be coming to the Wild West of weed.

A California lawmaker has introduced legislation to regulate the state’s free-wheeling medical marijuana industry — the farmers that grow the drug, the hundreds of storefront shops that sell it and especially the doctors who write recommendations allowing people to use it.

The state in 1996 was the first to authorize marijuana use for health purposes — there are now 20. But to this day no one knows how many dispensaries and patients California has or what conditions pot is being used to treat because the loosely worded law did not give government agencies a role in tracking the information.

The bill introduced by state Sen. Lou Correa marks a milestone not only because it would provide significant state oversight of the multi-billion dollar industry for the first time, but because it is likely to get serious consideration in Sacramento after years of inaction.

SB1262 is the brainchild of the California Police Chiefs Association and the League of California Cities, two politically influential groups that have stood in the way of previous efforts to legitimize pot growers and dispensaries by subjecting them to state control and taxation.

“This legislation seems counterintuitive, but we polled our membership and over 90 percent of the chiefs felt that, regardless of how you felt about the marijuana issue itself, there needed to be a responsible public safety approach to this,” said Covina Police Chief Kim Raney, president of the chiefs association.

Medical marijuana advocates, who have lobbied unsuccessfully for a statewide regulatory scheme they hoped would make the industry less susceptible to federal raids and arrests, is taking a wait-and-see approach on Correa’s legislation.

They prefer a bill held over from last year, co-sponsored by Assemblyman Tom Ammiano and Sens. Darryl Steinberg and Mark Leno, that calls for regulating and taxing medical marijuana like alcohol and places fewer restrictions on doctors than Correa’s measure does, but are prepared to hammer out a compromise, said Lynne Lyman, California director for the Drug Policy Alliance.

“We are very encouraged by law enforcement coming to the table with their proposals and we think we can all work together and come up with some model legislation in the state, finally, 18 years later,” Lyman said.

The police chiefs and cities are getting on the regulatory bandwagon now because they worry that if they don’t champion a plan of their own, marijuana advocates will succeed in getting the Legislature to pass one that aggravates the ongoing concerns of law enforcement and local governments instead of addressing them. Last year alone, the groups beat back three bills that would have required pot shops to be licensed by the state but that the league feared would make it harder for cities and counties to ban or regulate them.

Meanwhile, public support for legalizing the recreational use of marijuana, as voters in Colorado and Washington have done, is growing and the White House has softened its stance on the issue.

“We were very concerned about the legislation last year,” League of California Cities lobbyist Tim Cromartie said. “We thought it was unwise to purely play defense. We thought we needed to play offense.”

The bill co-sponsored by the league and the police chiefs’ association would require the California Department of Public Health to license dispensaries and cultivation sites but only if they first had secured operating permits from local jurisdictions. The department also would develop “quality assurance” procedures for testing marijuana for bacteria, mold and nonorganic pesticides, which growers would be prohibited from using.

The legislation also imposes substantial new requirements on doctors. If passed, it would allow medical marijuana recommendations to be given only by either a patient’s primary care doctor or a licensed specialist to whom the doctor has referred the patient. The doctor must have completed a certification course that covers substance abuse training.

The issuing doctor also would have to instruct the patient on dosage, whether the marijuana should be smoked, eaten or applied externally, and even what strain to use.

Certified doctors also would have to keep detailed records and to report how many recommendations they give and why to the California Medical Board, which would audit those who issue more than 100 in a year.

The mandates represent a significant departure from the status quo. Doctors currently can recommend marijuana to treat any ailment they choose and do not have to report to the state any information about their patients or the number of recommendations they issue and for what.

California Medical Association spokeswoman Molly Weedn said the organization has not had a chance to review Correa’s bill but would probably take a position on it in coming months.

Don Duncan, co-founder and California director of Americans for Safe Access, a medical marijuana advocacy group, thinks the new requirements for doctors “go overboard,” but at this stage is trying to persuade Correa to amend the bill instead of working to defeat it.

“Nothing is perfect. If we get a good-enough bill, that’s better than no bill,” Duncan said.

AP-WF-03-09-14 1513GMT