We tried our best, but CPR, an injection of epinephrine, and 360 joules of electricity all failed to restart Mrs. Melnyk’s heart. When everybody on the resuscitation team agreed that we could do no more, I said the words:

“Time of death, 9:32.”

As we cleaned up, a young nurse began to tuck a clean white sheet around Mrs. Melnyk’s body—and then suddenly stopped.

“Wait!” she shouted, pointing at the heart monitor. There on the screen, an electrical impulse registered and quickly disappeared, replaced by a flat green line. “It’s too soon to give up!” the nurse said.

Sadly, she was wrong. Her mistake was an understandable one for somebody still new to the job: The isolated electrical impulse that she believed signified a beating heart was actually just the last gasp of electricity released when a few molecules of salt escaped a dying heart cell. I explained that there was no way to bring Mrs. Melnyk back, and then switched off the heart monitor and went to notify the family.

Later that day, looking back on the incident, I wondered: What time did Mrs. Melnyk really die?

Her death certificate would read 9:32, but in reality, Mrs. Melnyk had died sometime in the preceding moments. Perhaps it was as she sagged to the floor while returning to her hospital bed from the bathroom, or as the nurse ran to get the emergency-response team. Maybe it was the moment my intern put his palms to her chest and started CPR. We would never know. All the green EKG tracing could tell us was that there was some electrical activity in the heart—it couldn’t tell us when the activity that kept her alive became the activity of the heart simply shutting down. Sometimes machine signals are meaningful, but other times they’re just noise.

Mrs. Melnyk’s case is not an isolated one:  As medical technology becomes more advanced, it also becomes more difficult for doctors to discern the line between life and death.

PET scans, which have been widely used since the 1990s, are a good example. Rather than solely showing body anatomy like an MRI or CT scan would, a PET scan can actually detect cellular activity in tissues. In a study published last year in The Lancet, 13 out of 41 patients in a persistent vegetative state showed detectable brain activity on PET scans, results that the investigators thought were consistent with “minimal consciousness.” The investigators were not, of course, able to tell what those 13 patients were thinking, just that some cells in their brains were active and doing … something. “Minimal consciousness” is an optimistic term; the PET scans may have been detecting only the play of random signals across neural wires that had long since failed to relay coherent thought. One year later, four of those 13 patients with detectable brain activity had died, and the remaining nine had either stayed “minimally conscious” or recovered “a higher level of consciousness,” though the authors did not elaborate on what that meant.

This is an interesting finding, but it also complicates how doctors might approach the end of life. Families and clinicians could wonder if all patients in a coma should have a PET scan, or whether patients whose scans show residual brain activity should be kept alive longer than they would have been otherwise. What we don’t know is the most important thing: whether any of the patients in the Lancet study regained the kind of lives they would find meaningful.

In a similar vein, an emerging resuscitation technology called extracorporeal membrane oxygenation, or ECMO, is complicating not how doctors pinpoint a time of death, but how and when we admit that death is inevitable. ECMO is a portable machine the size of a microwave oven that pulls blood out of the body, bubbles oxygen into it, and then circulates the oxygen-rich blood back into patients whose hearts or lungs have failed. Used by a growing number of hospitals around the world, ECMO can keep patients alive in the intensive-care unit while they await surgery or recover from a cardiac arrest, and has been credited with some miraculous saves. Recently, for example, a Canadian hospital reported that 47 percent of patients who received ECMO after in-hospital cardiac arrest had a good neurological outcome, an unheard-of success rate.

But as more and more institutions adopt ECMO, they will also have to confront the ethical issues that come with it. ECMO can sustain life for weeks and even months, but not indefinitely. Eventually, the synthetic tubing that connects the ECMO machine to the body can get clogged or infected, or obstruct blood flow. That means the technology is best used as a bridge to more definitive fixes like heart transplantation. But if that eventual fix becomes impossible—for example, because the patient is too ill—then doctors may need to admit ECMO is a bridge to nowhere and let the patient go. There is no formal stopping point for ECMO, which means it can be up to the physician to decide which day is the right last day for a given patient. Moreover, unlike most patients on life support, some ECMO patients can be awake and interactive. That means physicians may need to look a conscious patient in the eye and tell them the time has come. Once the ECMO machine is turned off, death will likely come within minutes.

PET scans and ECMO have brought new challenges to end-of-life care, but newer technologies will surely emerge, presenting their own challenges. Not least among them is the temptation to use these technologies in a way that defines life only in biomedical terms. It can seem logical to equate life with the detection of brain activity by a PET scan; the miraculous saves possible with ECMO, too, might lead physicians to equate the circulation of oxygenated blood in and out of the body with living.

But both equations are too simple, reducing complex issues about the end of life down to scientific definitions that lack nuance. PET scans and ECMO are great technologies, but they cannot answer a question that is primarily about a patient’s values and preferences. The line between life and death is best defined not by machines, but by patients’ beliefs about what kind of life gives them meaning, and how much they would endure to extend it. If PET scans and ECMO fit into a patient’s wishes, then it makes sense to marshal the full power of these technologies, even with the understanding that they may fail. On the other hand, if these machines cannot restore for a patient the kind of life he wants, then the way to use these technologies may be to do what I did with Mrs. Melnyk’s heart monitor: hit the off button, or better yet, don’t turn them on at all.