Adaptive Prediction Timing for Electronic Health Records