Class: HealthDataStandards::Export::Cat3

Inherits:
Object
  • Object
show all
Defined in:
lib/health-data-standards/export/cat_3.rb

Instance Method Summary collapse

Constructor Details

#initializeCat3

Returns a new instance of Cat3.



4
5
6
7
8
9
10
# File 'lib/health-data-standards/export/cat_3.rb', line 4

def initialize
  template_helper = HealthDataStandards::Export::TemplateHelper.new('cat3', 'cat3')
  @rendering_context = HealthDataStandards::Export::RenderingContext.new
  @rendering_context.template_helper = template_helper
  @cat1_renderer = HealthDataStandards::Export::RenderingContext.new
  @cat1_renderer.template_helper = HealthDataStandards::Export::TemplateHelper.new('cat1', 'cat1')
end

Instance Method Details

#export(measures, header, effective_date, start_date, end_date, filter = nil, test_id = nil) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/health-data-standards/export/cat_3.rb', line 12

def export(measures, header, effective_date, start_date, end_date, filter=nil,test_id=nil)
  results = {}
  measures.each do |measure|
    results[measure['hqmf_id']] = HealthDataStandards::CQM::QueryCache.aggregate_measure(measure['hqmf_id'], effective_date, filter, test_id)
  end
  @rendering_context.render(:template => 'show', 
                            :locals => {:measures => measures, :start_date => start_date, 
                                        :end_date => end_date, :cat1_renderer => @cat1_renderer,
                                        :results => results,
                                        :header=>header})
end