Bug patient search failed if there were leading or trailing spaces in search term

https://www.pivotaltracker.com/story/show/70782258