Creates ElasticSearch queries for patient selection