Tens of thousands of Massachusetts residents could be at risk of losing their jobs if they use marijuana for medical relief, as government agencies work to balance the new state medical marijuana law with federal law, which says the drug is illegal under all circumstances.

Marijuana starts on a shelf during the opening of a Seattle medical marijuana market on Feb. 13 (Elaine Thompson/AP)

One potential scenario: A doctor who becomes a medical marijuana patient would be at "significant risk" of violating his or her license to practice medicine, according to Bill Ryder, legislative and regulatory counsel for the Massachusetts Medical Society.

Ryder says the main problem for doctors is a question on the state license application that asks, "Do you use an illegal drug?" The state Board of Registration in Medicine, which reviews physician licenses and applications, may still be bound to interpret "illegal drug" according to federal law.

"So the board could require you to report that and then judge you on the basis of the fact that you may have violated federal law," Ryder explains.

Even if the board makes an exception for medical marijuana, and a physician has a certificate from his or her doctor, Ryder says the physician who is a patient may still put his or her license at risk.

"The board might find that, 'Gee, we don’t find this use appropriate,' " says Ryder, "even if another physician certified you as having a debilitating condition that might benefit. They [board members] might say, 'No, no, this is recreational use, disguised as a clinical use.' "

There’s no clarity yet from state licensing boards. Panels that review nurses, mental health workers, dentists and many other professions says they are waiting for the Department of Public Health to write regulations on medical marijuana before “determining whether changes to board regulations or policy may be appropriate.”

Nursing and other health care unions think their members will not be in violation of their licenses, as long as they aren’t working while under the effects of marijuana. Still, there’s some uncertainty here, as with many parts of the medical marijuana law.

Some transportation workers, including MBTA employees, are required to report any prescription or over-the-counter drug use to the T. A spokeswoman says a staff doctor decides if workers are fit to work while taking medication.

As for licensed professionals, the Patrick administration said in a statement that "generally, if a licensee is convicted of a crime, the Board considers enforcement actions.” But what if possession of marijuana is a crime under federal law, but not in this state?

For police officers and anyone who carries a gun on the job, it appears federal law wins.

"Any person who uses or is addicted to marijuana, regardless of whether the state has passed legislation authorizing marijuana use for medicinal purposes, is prohibited by federal law from possessing firearms or ammunition," says Donna Sellers, a spokeswoman for the Bureau of Alcohol, Tobacco and Firearms.

Police departments in Massachusetts are expected to enforce this rule and some labor lawyers are conceding that medical marijuana for police officers is out of the question.

"The federal law is the federal law," says Bryan Decker, an attorney at Sandulli Grace who represents a number of municipal police unions. "In Massachusetts, it is a job condition for police officers to carry a firearm. I think that is clear."

But Decker says officers should be able to help care for someone who has a marijuana certificate from their physician.

"If a spouse becomes a qualifying patient, the personal caregiver is someone who assists them in the administration of that medicine, but they are prohibited under the law from being a medical marijuana user," Decker says. He argues that in this situation, officers should not face consequences.

Police chiefs across the state are reviewing this issue. An even bigger dilemma for those chiefs may be if they can issue gun licenses to civilians who use medical marijuana. The ATF spokeswoman said anyone who possesses a gun — not just police officers — cannot also possess marijuana. Gun license applications ask about illegal drug use. It isn't clear if police will have a database of medical marijuana users against which they could check gun license applicants.

"If an applicant self-discloses that they are using what is a federally illegal substance, then that is going to present a new question for us," says Wayne Sampson, director of the Massachusetts Chiefs of Police Association.

In Oregon, the state Supreme Court ruled that sheriffs can't deny weapons permits to applicants because they use medical marijuana. The U.S. Supreme Court declined to hear the Oregon case. The federal ban on possession of a gun and marijuana stands.

Back to job risks. We’ll have much more coverage on this in the weeks to come, but here are two more cautions to keep in mind: There's a law called the federal Drug-Free Workplace Act. It says companies that accept federal grants or contracts must ban employee use of illegal drugs, including marijuana. Some federal transportation funding includes the same prohibition. Employment lawyers say these funding rules have not been enforced aggressively in the past.

If the federal government does step up enforcement, Shaleen Title of the Massachusetts Medical Marijuana Association, a new industry group, urges employers to respect state law.

"It’s our hope that as long as the patient is privately using medical marijuana to treat an illness and it’s not interfering with their work, there’s no reason why employers would discriminate against them," Title says.

But discrimination may not be the issue. It may be how Massachusetts will become the latest state looking for a way to comply with conflicting state and federal laws.