Mining the patient flow through an emergency department to deal with overcrowding