Four in five people on trolleys at Irish hospitals are waiting in the emergency departments, new data has shown.