Around 11 p.m. at the local county hospital, we were called to the room of a patient who was reportedly having difficulty breathing. As the on call residents, we weren’t quite sure what lay ahead for us, but the overwhelming smell of vomit, the unavoidable air of foreboding, and the abundance of nurses and medical assistants struggling to help Ms. D get off her bedside commode gave us enough clues.

We saw her glassy stare and heard her gurgling breaths before even entering the room. As my colleague left the room to call for additional help, I helped the nurses get Ms. D back in her bed. By the time she was in bed, she had lost her pulse, and within seconds, a code blue was called.

When a code blue is called in a hospital, it’s for help in an emergency situation where a patient has suffered from cardiopulmonary arrest—in other words, they’ve lost their pulse and their heart is no longer pumping on its own. Flocks of white-coated and scrub-wearing doctors rush through corridors and a code team arrives on site ASAP so that resuscitative efforts can begin immediately.

If you’ve ever seen a code blue on TV or in movies, I can assure you that you have no idea what proper resuscitative measures actually entail. Form, technique, and effective cardiopulmonary resuscitation (CPR) aside, popular media has also managed to terribly misinform the public about the clinical outcomes following CPR.

The School of Gerontology at the University of Southern California recently published a study that looked at episodes of Grey’s Anatomy and House from 2010 and 2011. During this period, CPR was depicted in 46 of 91 episodes, and the survival rate of patients to hospital discharge was a whopping 72 percent.

Compare this to 2012 data from the American Heart Association, which found the actual rate of survival to hospital discharge in-patients with in-hospital cardiac arrest to be only 23 percent. This false representation in numbers alone would be enough to confuse any non-medical person about how successful or unsuccessful CPR can be, but let’s add a visual to this story. Take, for example, this clip from one of the most popular American medical dramas to date, ER:

The inappropriate and inconsiderate medical student aside, how many times have my patients woken up and spoken to me after resuscitative efforts? Zero times. Usually, if and when we are fortunate enough to have regained a pulse, the patient is already intubated and on a ventilator. We then rapidly rush them to the intensive care unit (ICU) and start vasopressor medications to ensure that their blood pressure holds. I have colleagues who have had to resume chest compressions in elevators because their patients have coded again while en route to the ICU.

To make matters worse, TV shows almost always ignore the relevance of the underlying disease process at play in the context of a code blue. Conversations about goals of care, advanced directives, and code status are very rarely seen discussed on the small screen—but these discussions are critical. As physicians, the last thing we want to do is cause more harm than good for our patients and their families. The very best outcome any patient will ever have after successful CPR is to return to a worse baseline than they were at before they lost their pulse. And for patients with metastatic cancer or any other terminal disease process, sometimes the better part of valor really is to let the patient die naturally without aggressive resuscitative measures.

Of course, none of these decisions should be made without understanding our patient’s goals and needs—very complex matters that should be handled with care. Sadly, this clip from Grey’s Anatomy shows the exact opposite attitude toward the character’s do-not-resuscitate (DNR) order.

Perhaps the worst part of the flippancy involving Izzie’s code blue is that, as a patient with metastatic melanoma that has spread to her brain, she has aggressive CPR and the very next day is being wheeled around the hospital looking better than she did before her code:

My patient Ms. D did not have the luck of Izzie Stevens. In fact, she lost her pulse again two times overnight and subsequently had repeated cycles of CPR. With every round of CPR, her chances of a meaningful recovery dwindled further and further; however, she recovered a very weak pulse and was supported through the night on three potent vasopressors.

To be completely honest, often physicians can feel like torture artists when these situations play out. When the underlying disease processes at play are irreversible, there is very little good we can accomplish with repeated and prolonged resuscitation. When I left work the next morning, I had a fairly good idea what I would see when I returned to work that night. And as I had anticipated, Ms. D died after being unable to achieve return of spontaneous circulation after a fourth code blue.

In an advanced medical world where we’re all living much longer, the importance of discussions around end of life care and advance directives can never be emphasized enough. A study published in JAMA in 2008 followed patients with advanced cancer and their home caregivers (family, friends, etc.) from 2002 to 2008 and found that end-of-life discussions with medical providers resulted in less aggressive care and earlier hospice referrals. The study also found that aggressive care measures were associated with decreased patient quality of life and worse bereavement adjustment for their caregivers after the patient’s death.

Most of us avoid talking about life and death because of the sadness and morbidity that seem to follow these conversations. But what we fail to realize is that confronting our fears earlier, with a clearer mind, can help us better accept and process difficult situations when we are immersed in them. I will never know what Ms. D had really wanted for herself, but I imagine her prolonged suffering and subsequent death in the hospital ICU was not something she had ever hoped for.