GOV. CHARLIE BAKER recently signed into law a bill to mitigate the state-level effects of the ongoing opioid crisis. Like other such legislative efforts at both the federal and state levels, this important legislation requires healthcare providers and pharmacies to switch to electronic prescribing of controlled substances.

This most recent legislative success reflects just how quickly electronic prescription is emerging as a key tool in the national fight against opioids. Indeed, the Massachusetts law typifies what we are increasingly seeing in both state legislatures across the country and in the U.S. Congress: a recognition of the significant role technology can play in combatting this national drug abuse epidemic.

With passage of its opioid legislation, Massachusetts joins 10 other states in mandating some form of digital prescription.

Federal legislation is likewise proceeding. On June 19, the U.S. House of Representatives passed legislation that would require e-prescribing for coverage under part D of the Medicare program by January 1, 2020. This federal requirement would establish a milestone for the role of information technology in combatting prescription drug abuse, particularly the opioid crisis. With more than 40 million people nationwide enrolled in a Medicare part D plan, this federal legislation would require electronic prescribing to be in place at nearly all hospitals and healthcare delivery organizations across the U.S. by the beginning of 2020.

The US Senate, for its part, is poised to pass an opioids package very soon that would likely include a provision similar to the House version.

Corporate leaders, meantime, are now actively joining lawmakers in the growing push to create a more secure opioid distribution chain. Several large companies are now requiring that prescriptions for controlled substances be completed electronically. Just this past spring, Walmart – one of the nation’s largest pharmacy chains – stated that “e-prescriptions are proven to be less prone to errors, they cannot be altered or copied and are electronically trackable.” Like Massachusetts, this retail giant is requiring electronic prescription by January 1, 2020.

Healthcare systems are also joining in, and the benefits they’re seeing include not only safety and security – they also include bottom-line savings. The Geisinger Health System in Pennsylvania, for example, recently released data demonstrating this extra benefit. According to the Geisinger data, electronic prescribing, in conjunction with other safety and security measures, helped reduce overall opioid prescribing by approximately 50 percent. Geisinger also estimates that they are saving more than $1 million per month by using electronic prescriptions.

Clearly, e-prescriptions are enjoying real momentum on both the legislative and corporate fronts. The Massachusetts legislation, the Walmart announcement, the Geisinger cost savings data – these are only the latest in a building national call for a more secure opioid distribution chain by requiring that prescriptions for controlled substances be completed electronically.

As a provider, I know electronic prescription alone isn’t a “magic pill” for solving the nation’s growing opioid epidemic. But in my role as Chief Medical Officer at a leading healthcare security company, I’ve also witnessed first-hand the vital role technology can play in preventing over-prescribing, addiction, misuse, and abuse before it begins.

Technology solutions adopted such as digital prescriptions can help curb opiate abuse by creating accountable and secure practices for those who prescribe and dispense controlled substances. Electronic prescriptions provide a secure, transparent system that makes it easier to prescribe controlled substances to those patients who legitimately need them, while making it more difficult to commit fraud or abuse.

Electronic prescribing of opioids and other controlled substances helps address drug diversion, fraud, and doctor shopping by taking the paper prescription—and the prescriber’s DEA number—out of the hands of the patient. Prescriptions are securely sent directly to the pharmacy, which improves patient safety and prescription security.

While it does help fight opioid abuse, healthcare organizations and prescribers still must meet a number of specific requirements to comply with DEA regulations pertaining to electronic prescriptions. These requirements are designed to create a secure, auditable chain of trust through the entire prescribing process. If implemented incorrectly, however, organizations introduce the risk of non-compliance or limited adoption by providers.

Technology is clearly integral to the prevention of opiate abuse. But it must be applied in a thoughtful way that works for both providers and patients, not against them; the last thing most providers want is another electronic system to work with.

The best way to achieve these positive outcomes is to enact legislation and create a standard that providers can adhere to – and one that patients can count on. E-prescriptions promise to save lives by ensuring that opioids are provided more securely and appropriately, and save money by reducing costly prescription errors and mistreatments.

Massachusetts legislators are the latest leaders to recognize the emerging truth about electronic prescriptions: that implementing strategies that work for patients and physicians can help address the massive opioid epidemic invading our communities. Lives are depending on it, and Massachusetts legislators have acted accordingly. I look forward to other national healthcare leaders following suit.

Dr. Sean Kelly is the chief medical officer at Imprivata, a health care IT security company. He is an emergency room physician and teaches at Beth Israel Deaconess Medical Center.