Joan was settled into the intensive care unit (ICU) after she had emergency surgery to deal with a staph infection in her knee. She was also being treated aggressively for the sepsis that had developed, since it can easily progress to septic shock and lead to death.

Many days later, she was transferred to a regular hospital room. She was still very sick, though, and soon she was startled to be told, "You can't stay in the hospital. You've got to go to a nursing home."

With one or two days' notice, Joan's husband Greg worked hard to get a room for her at a nearby short-term rehabilitation facility. (Such units are often housed in a wing of a skilled nursing/nursing facility, sometimes informally termed a "nursing home"). Joan was taken there by ambulance.

Greg finally caught up with the facility's doctor late afternoon the next day, a Friday. The doctor seemed to be in a hurry to leave for the weekend. He was also upset, saying to Greg that the hospital had discharged Joan prematurely.

Although Joan had a chronic heart condition and diabetes, before being hospitalized she had been perfectly mobile and had enjoyed long walks with Greg around the grounds of the lovely development in which they lived. But now Joan was unable to move around at all. With her recent surgery and infection on top of her heart problem, she couldn't even shift her position in bed, much less turn over by herself. She could not support her own weight. To get Joan out of bed, aides had to use a hoist.

The facility's doctor was correct; Joan was discharged too soon.

How can you avoid being forced to leave the hospital before you are ready? Five steps that you or your advocate can take appear below.

First, find out who your "attending physician" is. It may be your primary care doctor (but often isn't), a specialist such as a heart surgeon, or a doctor - a "hospitalist" - provided by the hospital specifically to oversee care of hospitalized patients.

Your attending physician is the one who will order your discharge, so it's important that the two of you communicate clearly about your condition. Hint: If your attending physician asks how you are, don't say politely, "Fine, thanks," if you are not fine. Doctors in this situation may not be making small talk; they may be deciding whether you are well enough to leave the hospital.

Second, ask your attending physician how long your stay is expected to be, and what medical milestones you need to meet before leaving. (One example you may have experienced with outpatient surgery: Before people can leave the hospital, generally any urinary catheters must be removed and patients must be able to urinate on their own).

Third, find out who in the hospital is expected to guide you through the discharge planning process, and start talking with them within a day or so of your arrival. Don't wait.

Fourth, if you are told that you must leave "because your insurance won't cover any more days" and you are not ready, talk to your attending physician, who typically provides any documentation needed to appeal such a decision.

Fifth, know your insurer's appeal process and be prepared to follow its steps. People covered by Medicare must be given a notice upon admission titled, "An Important Message from Medicare About Your Rights" with a phone number to call if issues arise.

If you feel that you are being discharged too soon, do not leave the hospital when told to do so. Instead, call that phone number and ask for an "immediate review" of your case. Once you do that, you may stay in the hospital and Medicare coverage will continue while the reviewer considers the information that you, your attending physician and the hospital provide. Even if your appeal is denied, Medicare will still pay for your care until noon of the day after you are told of this decision.

By knowing your rights and asking key questions ahead of time, you can avoid being caught off guard if you are asked to leave the hospital before you are ready.