This article Transitions in Health Care Are Dangerous gets to the heart of the issue--end-of-life-care--and what is really in the best interest of the patient and family and how money drives so much of the decision making process.
Nursing homes and hospitals need patients to meet their bottom line, and often patients bounce between nursing homes and the hospital when comfort care (called palliative care) may be the better choice for that family member with severe dementia or a terminal illness.
The author has included an article from the New England Journal of Medicine about nursing home residents and how "burdensome transitions...are associated with markers of poor quality in end-of-life-care." This is a good read too.
Have those conversations with your family members about what they would want.
Advance care planning can enable the patient to maintain their dignity, control and increase their quality of life by NOT going in and out of the hospital for care they don't want and can decrease their quality of life. And not bouncing back and forth between hospital and nursing home can significantly reduce the cost of health care, as you will read in this article.
And if you do have a family member in a nursing home, work with a care coordinator to ensure the wishes and needs of the patient and family are attended to.
This coordination of services can make everyone's life so much better.