class HealthDataStandards::CQM::Prefilter

Public Instance Methods

build_query_hash(effective_time) click to toggle source
# File lib/health-data-standards/models/cqm/prefilter.rb, line 18
def build_query_hash(effective_time)
  filter_value = if self.effective_time_based
    et = Time.at(effective_time)
    et.years_ago(effective_time_offset).to_i
  else
    self.desired_value
  end

  if self.comparison == '$eq'
    {self.record_field => desired_value}
  else
    {self.record_field => {self.comparison => filter_value}}
  end
end