DOVER, Del. (AP) - A Delaware judge has ruled that a medical marijuana user fired from his factory job after failing a drug test can pursue a lawsuit against his former employer.

Jeremiah Chance was fired in 2016 from his job as a yard equipment operator at the Kraft Heinz plant in Dover. He claims his termination violated an anti-discrimination provision contained in Delaware's Medical Marijuana Act.

Chance also claims he was targeted for retaliation after pointing out safety issues with the facility's railroad ties.

The company argued that the anti-discrimination provision in Delaware's law is pre-empted by the federal Controlled Substances Act, which defines marijuana as an illegal drug and contains no exception for medical use.

In a case of first impression, Superior Court Judge Noel Primos ruled Monday that Delaware's medical marijuana law is not pre-empted by federal law. The medical marijuana law "not require employers to participate in an illegal activity ... but instead merely prohibits them from discriminating based upon medical marijuana use," Primos wrote.

Primos also rejected the company's argument in ruling that the medical marijuana statute carries an implied private right of action allowing a citizen to file a lawsuit seeking enforcement of his rights under the law.

The judge noted that the no state agency or commission has been tasked with enforcing the law's anti-discrimination provision, and that a medical marijuana cardholder fired for failing a drug test has no remedy other than a private lawsuit.

"The fact that an anti-discrimination provision was included in the DMMA demonstrates legislative intent to remedy the problem of discrimination based upon one's cardholder status," Primos wrote.

Kraft Heinz spokesman Michael Mullen said in an email Friday that the company had no comment on the pending litigation.

The lawsuit comes as medical marijuana use, and complaints that employers are mistreating employees who use medical marijuana, are on the rise in Delaware.

"It's coming up repeatedly, employers trying to terminate folks who either have a card, and they know it, or who test positive for marijuana," said Chance's attorney, Patrick Gallagher.

According to its most recent annual report, the state Office of Medical Marijuana issued 6,625 registration cards in fiscal 2018, an 85 percent increase from the 3,588 cards issued the prior year.

Of the cards issued last year, 4,389 were for new patients, more than double the number of new patient cards issued in fiscal 2017.

According to court records, Chance, who suffers from back problems and other ailments that have caused him to make frequent use of medical leave, obtained a medical marijuana card in 2016.

In August 2016, according to the lawsuit, Chance submitted an incident report to Kraft Heinz management regarding unsafe conditions of railroad ties at the Dover plant.

The following day, after meeting with a maintenance supervisor and warehouse supervisor, Chance was operating a shuttle wagon on the railroad tracks when it derailed. He was asked to undergo a drug test, which was inconclusive, and underwent a second test a couple of days later.

After being told that he tested positive, Chance informed a medical review officer that he had a medical marijuana card. He was fired 10 days later.

He claims his firing violated the protections of the medical marijuana law, which says an employer cannot discriminate against a person based on his status as a medical marijuana cardholder, or against a cardholder who tests positive for marijuana, unless the person used, possessed or was impaired by marijuana while on the job.

While allowing the lawsuit to proceed, the judge dismissed Chance's claim that the company violated the Americans with Disabilities Act and Delaware's employment protection law for persons with disabilities. He said there was no legal authority for suggesting that a person who is a medical marijuana cardholder has a "disability" under state or federal law.

The judge refused, for the time being, to dismiss Chance's claim that he was targeted for retaliation in violation of Delaware's Whistleblowers' Protection Act for pointing out safety issues.

He noted, however, he may grant Kraft Heinz summary judgment on that issue if Chance is unable to provide evidence to support his allegation.