implemented search-per-patient