Cognitive decline in elderly medical and surgical inpatients