Class: HealthDataStandards::CQM::AggregateCount

Inherits:
Object
  • Object
show all
Includes:
PopulationSelectors
Defined in:
lib/health-data-standards/models/cqm/aggregate_objects.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PopulationSelectors

#denominator, #denominator_exceptions, #denominator_exclusions, #method_missing, #multiple_population_types?, #numerator, #population_count, #population_id

Constructor Details

#initializeAggregateCount

Returns a new instance of AggregateCount.



73
74
75
76
# File 'lib/health-data-standards/models/cqm/aggregate_objects.rb', line 73

def initialize
  @stratifications = []
  @top_level_populations = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class HealthDataStandards::CQM::PopulationSelectors

Instance Attribute Details

#measure_idObject

Returns the value of attribute measure_id.



69
70
71
# File 'lib/health-data-standards/models/cqm/aggregate_objects.rb', line 69

def measure_id
  @measure_id
end

#stratificationsObject

Returns the value of attribute stratifications.



69
70
71
# File 'lib/health-data-standards/models/cqm/aggregate_objects.rb', line 69

def stratifications
  @stratifications
end

#supplemental_dataObject

Returns the value of attribute supplemental_data.



69
70
71
# File 'lib/health-data-standards/models/cqm/aggregate_objects.rb', line 69

def supplemental_data
  @supplemental_data
end

#top_level_populationsObject Also known as: populations

Returns the value of attribute top_level_populations.



69
70
71
# File 'lib/health-data-standards/models/cqm/aggregate_objects.rb', line 69

def top_level_populations
  @top_level_populations
end

Instance Method Details

#is_cv?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/health-data-standards/models/cqm/aggregate_objects.rb', line 78

def is_cv?
  top_level_populations.any? {|pop| pop.type == 'MSRPOPL'}
end

#performance_rateObject



82
83
84
85
# File 'lib/health-data-standards/models/cqm/aggregate_objects.rb', line 82

def performance_rate
  numerator_count.to_f / 
    (denominator_count - denominator_exclusions_count - denominator_exceptions_count)
end

#supplemental_data_for(population_type, supplemental_data_type) ⇒ Object



87
88
89
# File 'lib/health-data-standards/models/cqm/aggregate_objects.rb', line 87

def supplemental_data_for(population_type, supplemental_data_type)
  supplemental_data[population_type][supplemental_data_type]
end