'This can be called from prep to apply a filter based on
data in the record or the primary resource id.'

def set_filter(self, filterby=None, filter_opts=None, not_filterby=None, not_filter_opts=None):

    if filterby:
        self.filterby = filterby
    if filter_opts:
        self.filter_opts = filter_opts
    if not_filterby:
        self.not_filterby = not_filterby
    if not_filter_opts:
        self.not_filter_opts = not_filter_opts
