added automated tests for patient search

refactored patient search criteria
integrated patient search with search by person attribute
task 2472 not finished, this commit is for an intermediate review