A federal judge ruled in favor of a former Walmart employee who was fired after a drug test despite her medical-marijuana card.

An Arizona Walmart location terminated an employee in 2016 who held a valid medical-marijuana card after a drug test came back positive.

But now a federal judge has ruled that because Walmart could not prove the employee was impaired at work, the company violated the nondiscrimination provision in the Arizona Medical Marijuana Act.

In a significant decision that recognized a private right of action for employment discrimination under the AMMA, Arizona U.S. District Judge James A. Teilborg said last week that Walmart was not justified in firing the worker based on the company's idea that marijuana metabolites in her urine meant she must have been impaired at work.

Whitmire's attorney Joshua Carden, who runs a Scottsdale-based law firm, said Teilborg's decision is "the first of its kind in Arizona."

"No court has officially decided whether a private right-of-action exists under the Arizona Medical Marijuana Act, so that was a big part of the decision," Carden told Phoenix New Times on Tuesday.

Before she was fired, Carol Whitmire had worked at Walmart stores in Show Low and Taylor for about eight years.

On May 21, 2016, while working as a customer service supervisor at the Taylor Walmart, a bag of ice fell on Whitmire's wrist while she was leveling the bags, according to the lawsuit. The injury led to an urgent care visit and a drug test, pursuant to Walmart policy. Whitmire’s urine tested positive for marijuana metabolites.

A medical-marijuana cardholder for approximately the last five years, Whitmire smokes marijuana before bed to treat her shoulder pain and arthritis, and as a sleep aid, according to court records. She says she never brought marijuana to work or reported to the job impaired.

After the wrist injury, Whitmire informed the Walmart human resources department and the urgent care clinic that she holds a medical-marijuana card.

She continued working until July 4, when she was suspended as a result of the urine sample. Her manager fired Whitmire on July 22 because of the positive result of the drug test, the complaint says.

In March 2017, Whitmire filed a discrimination charge with the Equal Employment Opportunity Commission and the civil rights division of the Arizona Attorney General’s Office. Three months later, she sued Walmart in federal court in Phoenix, alleging wrongful termination and discrimination in violation of the AMMA, the Arizona Civil Rights Act, and Arizona worker's compensation law.

In his decision last week, first reported by Law360, Teilborg granted partial summary judgment to Whitmire for her claim of discrimination under the AMMA. The judge, however, denied Whitmire’s claims alleging discrimination under the Arizona Civil Rights Act and retaliatory termination under Arizona employment protection and worker’s compensation laws.

The court will make a decision regarding damages or Whitmire's potential reinstatement in May, her attorney said.

Under the AMMA, it is illegal for an employer to discriminate in hiring or firing based on a patient's "positive drug test for marijuana components or metabolites, unless the patient used, possessed or was impaired by marijuana on the premises of the place of employment or during the hours of employment."

In court, Walmart denied wrongfully terminating or discriminating against Whitmire, and said the company's drug testing policy is lawful and protected under Arizona's Drug Testing of Employees Act (DTEA).

But Teilborg wrote that in the absence of expert testimony establishing that Whitmire's drug test shows she was impaired at work because of marijuana she smoked the night before, Walmart "is unable to prove that Plaintiff’s drug screen gave it a ‘good faith basis’ to believe Plaintiff was impaired at work."

Walmart could not meet the burden of proving that the urine sample after the accident “sufficiently establishes the presence of metabolites or components of marijuana in a scientifically sufficient concentration to cause impairment,” the judge wrote.

An amicus curie brief submitted by the AG's office did not side with either party in the case, but argued that there is no conflict between the AMMA and the DTEA.

Provisions in the AMMA and the DTEA should be read together, the AG's office wrote. An employer cannot be sued if they believe an employee was impaired while working when that belief “is based on a drug test showing that ‘metabolites or components of marijuana’ are present in scientifically sufficient concentration to cause impairment.”

Likewise, under the AMMA, an employee who is a medical-marijuana patient “shall not be considered to be under the influence of marijuana solely because of the presence of metabolites or components of marijuana that appear in insufficient concentration to cause impairment," the attorney general's office wrote.

In a statement to New Times, Walmart said, “We work every day to create and maintain a safe environment for our associates and customers. We are pleased the Court dismissed several of the claims; and we will continue to prepare our case.”

Carden described Whitmire as "a delightful lady" in her 50s, and said she is very excited about the decision. She initially began smoking medical marijuana at night to manage her pain because she disliked the way prescribed pharmaceuticals made her feel, he said.

He characterized the judge's order as a rejection of Walmart's argument.

“The drug test is mentioned in the statute," Carden said. "You can’t fire somebody just because they test positive for metabolites.”