#599: Show count on patient search tabs and refactoring