Sha256: b8faec3e639fc0e10b8537c58a59d6b6ff3bdfc2f567583a6580c8363023e0e3
Contents?: true
Size: 1.4 KB
Versions: 6
Compression:
Stored size: 1.4 KB
Contents
module HealthDataStandards module CQM class QueryCache include Mongoid::Document include Mongoid::Timestamps store_in collection: 'query_cache' field :calculation_date, type: Time field :status, type: Hash field :measure_id, type: String field :sub_id, type: String field :population_ids, type: Hash field :effective_date, type: Integer field :IPP, type: Integer field :DENOM, type: Integer field :NUMER, type: Integer field :antinumerator, type: Integer field :DENEX, type: Integer field :DENEXCEP, type: Integer field :MSRPOPL, type: Integer field :OBSERV, type: Float field :supplemental_data, type: Hash def self.aggregate_measure(measure_id, effective_date, filters=nil, test_id=nil) query_hash = {'effective_date' => effective_date, 'measure_id' => measure_id, 'test_id' => test_id} if filters query_hash.merge!(filters) end cache_entries = self.where(query_hash) aggregate_count = AggregateCount.new(measure_id) cache_entries.each do |cache_entry| aggregate_count.add_entry(cache_entry) end aggregate_count end def is_stratification? population_ids.has_key?('stratification') end def is_cv? population_ids.has_key?('MSRPOPL') end end end end
Version data entries
6 entries across 6 versions & 1 rubygems