Prescriptions for opioid painkillers declined from 2012 to 2019 among both patients with chronic non-cancer pain and those with cancer who had private insurance, according to a new study.

Between 2012 and 2019, the proportion of people with chronic non-cancer pain who received any opioid prescription dropped from 49.7% to 30.5%, HealthDay reports. For people with cancer, the rate of opioid prescriptions dropped from 86.0% to 78.7%.

Rates of non-opioid pain medication remained steady for people with non-cancer pain (66.7% to 66.4%). Among cancer patients, rates increased (74.4% to 78.8%). Among patients who received an opioid prescription, fewer received extremely high doses or more than a week’s supply.

The researchers wrote, “These findings highlight the need to better understand how declines in prescribing are influencing the management of pain among these patient populations, particularly as the CDC is currently updating opioid prescribing guidelines for chronic pain.”