Timing and risk factors for functional changes associated with medical hospitalization in older patients.