Functional gain of hip fracture patients in different cognitive and functional groups