Understanding emergency department wait times : access to inpatient beds and patient flow