Building the EHR Foundation Model via Next Event Prediction