Issue #885: Refactor the Export patient search query marco out into a separate file.