def lobid_qs(row, q_field='surname', add_fields=[], base_url="https://lobid.org/gnd/search?q="):
    """ creates a lobid query string from the passed in fields"""
    search_url = base_url+row[q_field]+"&filter=type:Person"
    if add_fields:
        filters = []
        for x in add_fields:
            if x:
                filters.append(row[x])
        search_url = "{} AND {}".format(search_url, "AND ".join(filters))
    return search_url