In one case, in the area served by NHS Tayside, a patient was left waiting for more than two years before they were eventually discharged.
Another patient being looked after by NHS Borders had to wait 680 days before being allowed home, while another waited 447 days in Fife.
The longest case, described by health chiefs as “very complex”, was a patient who at the end of the 2018/19 period was still waiting to be discharged in the Borders, despite having been declared ready to leave 1,373 days before.
All the delays have been attributed to “health and social care reasons” – meaning they involved patients waiting on a care home place, support to enable them to return to their own home or for a needs assessment to be conducted.
The situation was described as “miserable” by the Scottish Liberal Democrats, who uncovered the figures via a series of Freedom of Information requests.
Alex Cole-Hamilton, the party’s health spokesman, said: “Keeping someone in hospital unnecessarily for a year costs the NHS almost £100,000.
“Hospitals are getting congested all the way up to critical care because there isn’t enough capacity to take care of people in the community.
“Even more damaging is the crushing cost to patients’ wellbeing. Conditions worsen and critical opportunities to rebuild their lives are lost. It’s miserable.
“Medical staff have declared these people ready to leave hospital but the community-based support they need to move on simply doesn’t exist. These are factors within this government’s control. Indeed, the SNP government promised to eradicate delayed discharges from the system by 2016.
“It’s time to end the social care scandal. Staff are working tirelessly but there just aren’t enough of them to go around. The SNP’s new workforce plan, published a whole year late, must now make demonstrable progress.
“Furthermore, we simply can’t afford for existing staff to be driven away by the Conservative’s damaging Brexit, so Boris Johnson must now step up too.”
Nicky Berry, director of nursing and acute services at NHS Borders, said he was unable to comment on individual cases for reasons of confidentiality.
He added: “Across our health and social care system it is always our aim to ensure that patients are only admitted to hospital when necessary, and when an admission is required the patient’s stay is safe and as brief as possible.
“Occasionally there are factors which lead to a patient not being able to move to their next appropriate place of care as soon as they are medically fit.
“We work very closely with patients, carers and our partners across the health and social care system to ensure that these cases are the exception and not the norm.”
A spokeswoman for NHS Tayside said: “Discharge from hospital can be delayed for a number of reasons including when waiting for admission to care homes, social care assessment, provision of equipment or care at home services. NHS Tayside has been working very closely with the three health and social care partnerships and third sector partners in Angus, Dundee and Perth & Kinross to build sustainable solutions that seek to reduce unscheduled care demand, and avoid unnecessary delays in discharging patients from hospital.
“Some patients may have highly complicated health and social care difficulties, and need specialist, high-quality care provision in place before their discharge from hospital.
“This is tailored to the needs of the individual service user and arranged in conjunction with the three health and social care partnerships, and with community providers.”
A Scottish Government spokesman said: “People should not have to spend unnecessary time in hospital once treatment is complete. That is why we are investing more than £700m this year to support social care and integration.
“Progress has been made in reducing delays – bed days lost are down by one per cent overall since 2016/17.
“However, we want to go further with our partners in local government, the NHS, and in integration authorities to address where delays have increased and work to improve performance.
“The ongoing integration of health and social care has been key to achieving progress in recent years, with integration authorities now responsible for nearly £9 billion of funding previously managed separately by Health Boards and Councils.
“We have established an Expert Support Group to work with those health and social care partnerships facing the most significant challenges and ensure sustainable progress can be achieved.”