More U.S. workers and job applicants are testing positive for drugs than at any time in the last 12 years, according to a study by a medical laboratory company.

The Quest Diagnostics Inc. analysis released Tuesday of more than 10 million anonymized drug tests found increased incidence of cocaine, marijuana and methamphetamine, while detection of prescription opioids such as oxycodone declined.

Positive tests for heroin plateaued in the general workforce and fell slightly among “safety-sensitive workers” such as pilots and bus drivers who face mandatory federal testing.

Four percent of New York workers tested positive in 2016, compared with 3.5 percent in 2015. Still, those levels were lower than for the nation overall at 4.2 percent in 2016 and 4 percent in 2015.

The study didn’t indicate the percentage of Long Islanders testing positive for drugs.

Robert Chaimowitz, director of recruiting at recruiting firm Executive Alliance in Commack, said that drug testing is far from universal.

advertisement | advertise on newsday

“There are still plenty of companies out there that don’t drug test,” he said.

Businesses will have to deal with a “whole generation” that is more inclined to smoke marijuana than drink liquor, he said.

“It’s not a Long Island problem, it’s nationwide.”

Quest, based in Madison, New Jersey, found that positive tests for cocaine increased by 12 percent in 2016 to 0.28 percent, compared with the previous year among the general workforce nationwide.

Positive results for marijuana in the U.S. general workforce rose by almost 75 percent to 8.9 percent in 2016 from 5.1 percent in 2013 in oral fluid testing, which detects recent drug use.

The first two states to legalize recreational use of that drug — Washington and Colorado — posted a positive urine test rate that outstripped the nation in 2016, the study found.