At one stage on Sunday night, there were 797 people waiting in Northern Ireland's emergency departments.