Children were among the nearly 200 patients in hospitals across the country who could not be discharged last year due to homelessness, it has emerged.