Executions in this country often draw controversy. But when the headlines about them include words like botched or bungled, the debate about capital punishment enters new territory.

In Oklahoma, where I practice medicine, Clayton Lockett was convicted of murdering Stephanie Nieman, who had just graduated from high school, in 1999. Testimony revealed that Lockett bound her hands and mouth with duct tape, shot her twice and buried her alive in a roadside grave. He was convicted of first degree murder in 2000.

After a legal odyssey involving both the state's Supreme Court and the governor issuing stays on the planned execution, a lethal injection was eventually scheduled. But there are shortages of sodium thiopental and pentobarbital, anesthetics that have been used for lethal injections. European manufacturers have discontinued or limited production based on the European Union's proscription of the death penalty.

Without either of these drugs available to render prisoners unconscious, prisons have been forced to devise new protocols for lethal injections.

Defense attorneys have seized upon the changes as an opportunity to make new arguments against the death penalty. They assert that these new, untested combinations violate the Constitution's ban on cruel and unusual punishment. They also say that prisoners have a right to know who manufactures and sells the medicines. Several states, Oklahoma among them, have secrecy laws designed to protect the pharmacies that compound, import or dispense the drugs.

Whatever your views on capital punishment, it's clear that we are living through a period of medical experimentation as executioners struggle to come up with the best combination of available drugs to carry out court-imposed death sentences. As the account of Lockett's writhing on the table demonstrates, the search for an appropriate cocktail will continue. A second prisoner, also scheduled to be executed the same night as Lockett, received a two-week reprieve to allow the state to investigate what went wrong.

I'm an internist and a teacher of medical students. I've never been involved in carrying out a death sentence, and I never expect to be. The American Medical Association's Code of Ethics forbids it, for one thing. But despite ethical strictures that go back as far as Hippocrates, physicians have long played a role alongside executioners.

Surgeon and writer Atul Gawande investigated physician participation in executions in a 2006 essay in the New England Journal of Medicine. What makes his piece special are his interviews that get at the motivations and experiences of four doctors and a nurse who participated on capital punishment teams.

Though they understood that their professions barred their participation in capital punishment, these people reasoned that because state-sanctioned execution is currently legal, it's important to provide competent care to the condemned. Nevertheless, with only one exception they all chose to remain anonymous.

Of the 32 states that currently allow capital punishment, all rely on lethal injection as the means. Seventeen of these states require the presence of a physician, though they also legally protect physicians' identities and promise them immunity from prosecution or having their licenses stripped for unethical conduct.

As a doctor, the Lockett case led me to return to some fundamental principles. Medical ethics start off clearly enough. We are to do our best to help nature heal maladies and wounds, and to do so without causing harm. Of course, our treatments often do cause harm. But in our profession, doctors must weigh risks with benefits and permit some harm for the promise of cure, remission or comfort. When we engage in research, we must inform and seek the consent of human participants. Both our patients and study volunteers may withdraw their consent from treatment or participation at any time. Finally, we must offer extra protection for vulnerable populations.

These principles caused me to see the death penalty as incompatible with the practice of medicine. Death row inmates, part of the only segment of the U.S. population with a constitutional right to health care, are paradoxically stripped of their right to refuse their ultimate treatment.

As Oklahoma grapples with how to recover from this embarrassing event, I hope doctors can see Lockett's suffering as a teachable moment.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.