Among modern wonders of the world is the extensive, high-tech palliative care given to elderly patients suffering terminal illnesses: a series of Lazarus-like resurrections most doctors say they wish to someday avoid.

Some 88.3 percent of doctors in the United States have signed advance planning directives forbidding resuscitation, as enthusiasm continues to rise for such end-of-life planning, a new study from Stanford University shows.

“Physicians know it’s not the right thing to do, but we find ourselves participating in treatment that causes pain and suffering for our patient,” V.J. Periyakoil, the director of the Stanford Palliative Care Education and Training Program, told Time. “Families are traumatized and there is a huge financial cost to the individual and the nation.”

The Stanford team surveyed nearly 1,100 doctors about their attitudes toward end-of-life planning, finding little difference in opinion since the legal concept arose a quarter-century ago. Whereas most practitioners would choose to avoid such a fate for themselves, many still make every effort to prolong the lives of patients nearing the end of their lives — opting for “full code” in the most hopeless of circumstances.

“Doctors' attitudes towards [advanced directives] have not changed significantly in the past 23 years,” Periyakoil and his colleagues said. “Our study raises questions about why doctors continue to provide high-intensity care for terminally ill patients but personally forego such care for themselves at the end of life.”

That question gets to the crux of the matter as the U.S. elderly population rises rapidly with demographic changes, and some 90 million Americans live with at least one chronic illness, according to a report last year from Dartmouth Atlas. Although more than 80 percent of Americans wish to avoid such agonizing deaths, Periyakoil says their wishes are often ignored.

Moreover, analysis of Medicare spending finds large disparities throughout the country on end-of-life care, depending on local health care capacity as well as the individual style of the attending physician. Overall, the system spends 32 percent of its budget on palliative care for patients enduring the last two years of life. Even worse, spending rose 12 percent between 2002 and 2010 on Medicare patients who saw at least 10 different physicians during the last six years of life, spending numerous days in intensive care units rather than hospice or home.

Amid the beeps and whistles and distant voices, the final hours of life come for many Americans as a series of painful and expensive experiences, an unwanted detour from the road of life.

Source: Periyakoil VS, Neri E, Fong A, et al. Do Unto Others: Doctors' Personal End-of-Life Resuscitation Preferences and Their Attitudes toward Advance Directives. PLoS One. 2014.