Capacity planning and bed management for improving the flow of patients through emergency and acute inpatient departments.