The NHS and councils have had to come up with plans to reduce numbers in hospitals