BOSTON — The Massachusetts Department of Public Health says about a third of doctors are not checking the state’s opioid tracking system when they write prescriptions, despite a new law mandating them to do so.

The Boston Herald reports that in the first six months of 2017, 6,200 of the 18,700 doctors who wrote prescriptions didn’t search the prescription tracking system, known as MassPAT.

A 2016 law requires Massachusetts doctors to check the system to combat doctor-shopping and the opioid epidemic.

The newspaper reports that of the group that skipped checking the database, most were doctors who infrequently prescribe opioids. Doctors who prescribed opiods frequently conducted searches 88 percent of the time.

Officials said they believed many who didn’t perform searches were covered under exemptions, such as providing hospice care.