combine_query_boolean function

Combine a database query with a cohort returning a 0/1 vector depending on whether each individual has a recorded code of interest.