sorting/searching in patient