SIOUX FALLS, S.D. — A major health care system serving the upper Midwest said this week that the number of opioid pills it prescribes has fallen by almost a quarter as it works to respond to America’s opioid epidemic.

South Dakota-headquartered Sanford Health started analyzing its prescribing last year to direct its response to rising opioid and heroin overdose deaths, said Doug Griffin, who spearheaded the system’s data collection as vice president and medical officer for Sanford in Fargo, North Dakota.

Griffin said the health system learned that the numbers are “staggering” — the system reported prescribing 4.3 million opioid pills in the first quarter of 2016 — a figure that doesn’t include cancer patients’ prescriptions. Sanford took steps as a result including mandating opioid education for providers and using its electronic health record system to alert doctors about safe prescribing habits, Griffin said.

Sanford has since seen a significant reduction in both the number of pills prescribed and prescriptions written. Sanford providers wrote 18 percent fewer prescriptions for opioids in the third quarter of 2017 compared to the first quarter of 2016, amounting to 24 percent — or about 1.25 million — fewer pills prescribed, according to the health system.

The Sioux Falls, South Dakota, region saw a 19 percent reduction in pills prescribed, while the Fargo area experienced a 33 percent drop and the Bemidji, Minnesota, region saw a 37 percent decrease, according to Sanford.

“The stance that we have taken is clearly opioid overdoses, both illicit and prescription overdoses, are a problem in this country, including in our footprint,” Griffin said. “Like many things in medicine, our knowledge has changed and our focus has shifted on this.”

Allison Suttle, chief medical officer at Sanford, said the system’s end goal is to ensure patients are safe and well-treated and that physicians are educated in how to treat patients’ pain while being “good stewards of the use of opioids.”

“Large health systems can serve as examples,” she said.

South Dakota Department of Health Secretary Kim Malsam-Rysdon said that South Dakota has a low opioid overdose death rate compared to other states, but noted that the state had 38 opioid overdose deaths last year. She said large health systems are on the front lines.

“I think they’re extremely committed to this, and I’m really confident that we’re going to see the changes that we need to see to stay ahead of this epidemic that we’re seeing in other states,” she said.

Avera Health, a Sioux Falls-based health system, sponsored a conference this month with the U.S. Attorney’s Office of South Dakota on the opioid epidemic. Deb Fischer-Clemens, Avera vice president of public policy, said the organization’s responsible prescribing program includes patient contracts, educating providers and patients on opioids and working with its electronic health record to create easy access to the state Prescription Drug Monitoring Program.

Jay Bhatt, senior vice president and chief medical office for the American Hospital Association, said in a statement that the nation’s hospitals and health systems are working to reduce the number of prescriptions written for opioids and the number of days that many patients take them.

Utah-based Intermountain Healthcare pledged in August to cut by 40 percent the average amount of opioids given per acute pain prescription by the end of next year.

“We feel like we owe this to the community and to our patients,” said David Hasleton, associated chief medical officer for Intermountain Healthcare. “We’re trying to shut the flow off, or slow the flow, I suppose, and make this appropriate prescribing rather than overprescribing.”