class ConceptQL::Operators::ProviderFilter

Filters incoming events to only those that have been associated with providers matching the given criteria.

Public Instance Methods

query(db) click to toggle source
# File lib/conceptql/operators/provider_filter.rb, line 20
def query(db)
  db.from(stream.evaluate(db))
    .where(provider_id: matching_provider_ids(db))
end

Private Instance Methods

matching_provider_ids(db) click to toggle source
# File lib/conceptql/operators/provider_filter.rb, line 26
def matching_provider_ids(db)
  specialty_concept_ids = options[:specialties].split(/\s*,\s*/).map(&:to_i)
  db.from(:provider)
    .where(specialty_concept_id: specialty_concept_ids)
    .select(:provider_id)
end