A shift in deaths from emergency departments toward hospice care highlights the need for people to have end-of-life conversations earlier with their loved ones.

We don’t always get to choose where we die.

But research suggests that over the past two decades fewer people are dying in emergency departments, and more are spending their final days or weeks in hospice care.

In spite of this shift, some experts say that people should be talking to their families earlier about end-of-life issues before illness takes away their ability to communicate their wishes.

“A lot of people are not having these conversations about where they want to die, how they want to die, what it looks like at end-of-life, who they want to be around them, would they prefer to die at home, in an institution, in a hospice, or in a hospital,” Dr. Tabitha Goring, an internal medicine and palliative care specialist at Memorial Sloan-Kettering Cancer Center, told Healthline.

Read more: End-of-life care: Who’s doing it right? »

Between 1997 and 2011, deaths in emergency departments in the United States decreased by 48 percent, according to a study published this month in Health Affairs.

The most common reasons for visits to the emergency room were shortness of breath, injury, or chest pain. Almost two-thirds of people were not breathing, or their heart had stopped beating, or they were unconscious or dead on arrival.

The data for the study comes from the National Ambulatory Medical Care Survey (NAMCS). Researchers analyzed more than 1.3 billion adult emergency room (ER) visits across the United States over a 15-year period.

Researchers write that some of the drop in emergency room deaths is due to improvements in treatments for life-threatening conditions like heart attack, stroke, trauma, and sepsis.

But other factors could have also contributed to the decline.

New guidelines in some states allow paramedics to stop or withhold resuscitation efforts before reaching the hospital for patients whose hearts have stopped. There has also been a shift in which groups of people are showing up in the ER.

More people may also be surviving their visit to the ER, only to end up as a patient in the hospital or in hospice care. However, the researchers found that inpatient hospital deaths remained steady between 2005 and 2011.

This is echoed by another study that found a decline in recent years in the number of older adults dying in hospitals. Hospice deaths, though, increased over the same period.

In addition, home deaths between 1989 and 2007 increased by more than 50 percent, according to the Centers for Disease Control and Prevention (CDC).

Read more: People who die at home live longer »

A report by the National Hospice and Palliative Care Organization (NHPCO) estimated that 1.6 to 1.7 million patients received hospice services in 2014.

This number has been steadily increasing over the past few years.

More than half of hospice patients received care for fewer than 17 days. The average length of hospice care in 2014 was 71 days. Others stayed even longer — more than 180 days.

Hospice provides care to patients after it is clear they will not recover. The focus is on caring, not curing. This strategy includes providing patients with medical care, pain management, and emotional or spiritual support.

When many people think of hospice, they imagine people dying at home while surrounded by loved ones.

But according to the NHPCO report, only a little more than one-third of hospice patients died in a private residence in 2014.

The others died in a nursing home, residential facility, hospice center, or hospital. But that does not mean these people were not “home.”

“When it comes down to the final period of life, [patients] may not literally mean the home that I own, or that I rent, or where I’ve lived,” Judy Thomas, J.D., chief executive officer of the Coalition for Compassionate Care of California, told Healthline.

She says that what is more important is that people are in a setting where they can find closure to their lives — wrapping up unfinished business and coming to terms with things emotionally or spiritually.

“A more comfortable environment that’s familiar — where they can be around people that they love, if that’s what they choose — is definitely going to be more conducive to those kind of developmental processes that happen,” said Thomas.

Read more: End-of-life care: What doctors want for themselves »

Given the option, many people would prefer to die at home.

Research suggests that this preference doesn’t change even as a person’s illness progresses.

But patients don’t always have a choice.

If a person’s illness progresses quickly, there may not be time to transport them to the hospital. Or medical decisions may put patients on a certain path before the family realizes that it conflicts with their loved one’s wishes.

“All these little decisions end up where you’re at a place physically where you may not be able to undo that easily and take the person home,” said Thomas.

Or the family might not be able to afford to bring their loved one home, or insurance might not cover hospice care.

There are also many practical issues that come with caring for a dying family member at home, something the patients themselves often realize.

Goring said patients might say something like, “I don’t want to die at home because of the trauma that might impose on my family members.”

Some patients who are dying have young children or extended family members at home. In many cities, the family could be living in a small apartment, so they might not be able to accommodate home hospice care for a loved one.

But even hospice is not a complete solution.

“Hospice only offers limited care. It’s not like there’s a nurse sitting at your bedside 24 hours a day pushing meds. That is in the final phase,” said Goring. “Hospice — at least hospice in New York — requires a huge family involvement.”

Read more: What Medicare does and doesn’t cover »

Planning ahead can alleviate some of the stress that families face when their loved one is close to the end of life.

But talking about dying or hospice is not always easy.

“I sometimes say, let’s not mention the h-word to certain people. That is like a bad word,” said Goring. “A lot of people feel like it’s giving up and there’s got to be something else you can do.”

People can decide where they want to die as part of advance care planning. Even if it’s not written down, patients can have conversations so their family members can make those difficult end-of-life decisions later.

Thomas also cautions families against interpreting their loved one’s wishes too rigidly.

“Family members can end up with a lot of guilt if they’re not able to get their loved one back to what they assume that person means is ‘home,’” said Thomas. “If you focus more on the qualities of a homelike environment — what were the things that were important to that person — then it’s easier to meet it.”