The President of the High Court has described as "bordering on the inhumane", the transfer of an 82-year-old woman from hospital to a nursing home at 4am.
Mr Justice Peter Kelly also described as "completely unacceptable" the failure of the hospital's discharge note for the woman to state how she was to be fed.
The woman has Alzheimer's disease and has an impaired ability to swallow.
Last Thursday she was discharged from hospital at 4am because an ambulance could not be found until then.
No information about her care plan was given to her GP or the nursing home.
Her family and her GP raised concerns about what appeared to be a palliative treatment plan. Hospital doctors had deemed her unsuitable for tube feeding and she was on a glucose drip only.
Her GP tried several times to contact the hospital. She said her patient was not terminally ill and she would have ethical concerns about a plan which would effectively result in her patient starving to death.
The judge had adjourned the case until today to allow time for proper consultation between the GP and the hospital.
Mr Justice Kelly said he wondered what would have happened had the woman not had a committed family, a committed GP, committed solicitors and, as a ward of court, easy access to the court.
He expected the hospital to review its discharge procedures to ensure this situation would never happen again as it was "unacceptable" and could have "fatal consequences".
He also questioned the advisability of having a normal transfer from hospital at 4am especially where a patient was "elderly, frail and unwell".
While the Health Service Executive said the 4am transfer was due to non-availability of ambulances any earlier, it said this was "an explanation, not an excuse".
Mr Justice Kelly accepted it was in the woman's best interests to return to the nursing home but queried if doing so at 4am was in her best interests.
However, he was happy the situation had resolved, a "comfort feeding" plan was in place since Tuesday, the woman is doing well and her GP and family will be involved with a hospital multi-disciplinary team in devising a care plan for her into the future.
He also noted the woman had been "very well looked after" in the hospital, her family had no criticism of her treatment there and the problem arose rather from the time she was to be discharged.
He awarded costs against the HSE to the lawyers representing the woman's ward of court committee and paid tribute to the woman's husband, son and daughter, who were in court, for their concern for her.
He also expressed sympathy to them, saying this situation must have added to the stress they were already experiencing.
Earlier, Sarah McKechnie SC, for the HSE, said the 4am transfer occurred due to ambulances being exceptionally busy with emergency cases.
When the case first came to court on Monday, the judge directed an urgent inquiry concerning the woman's treatment.
On Tuesday, the HSE apologised for communication failures and said "comfort feeding" was in place. The case was adjourned to allow it put in detailed affidavits concerning her hospital care.
The judge heard today that the woman was admitted to hospital on 4 January following a possible episode of choking leading to aspiration.
She was treated with intravenous fluids and antibiotics and assessed at risk of aspiration if there was oral intake of fluids.
She was reviewed by doctors, a speech and language therapist, dietician, physiotherapist and a palliative care team.
Discussions were also held with her family concerning feeding options for her and it was agreed PEG feeding - via a tube inserted into her stomach - was not appropriate.
It was later decided she was to be managed with subcutaneous fluids in the nursing home and, if her condition improved, she would be treated with "comfort feeding".