Sha256: 12ddd2ca174ee3246330cebfe87a3ecb85c5b8369e681d98bea8658adcc7c1f4

Contents?: true

Size: 1.08 KB

Versions: 25

Compression:

Stored size: 1.08 KB

Contents

module HealthDataStandards
  module Export
    class HTML
      def initialize
        template_helper = TemplateHelper.new('html', 'html')
        @rendering_context = RenderingContext.new
        @rendering_context.template_helper = template_helper
        @rendering_context.extensions = [HealthDataStandards::Export::Helper::HTMLViewHelper]
        @code_map = nil
      end

      def export(patient, measures=[])
        @code_map ||= self.build_code_map
        @rendering_context.render(:template => 'show', :locals => {:patient => patient, :code_map => @code_map, :measures => measures})
      end
      
      def build_code_map
        super_code_map = {}
        val_set_array = HealthDataStandards::SVS::ValueSet.all.to_a
        val_set_array.each do |valset| 
          valset.concepts.each do |concept|
            super_code_map[concept.code_system_name] ||= {}
            super_code_map[concept.code_system_name][concept.code] = concept.display_name unless super_code_map[concept.code_system_name][concept.code]
          end
        end
        super_code_map
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
health-data-standards-3.6.1 lib/health-data-standards/export/html.rb
health-data-standards-3.5.3 lib/health-data-standards/export/html.rb
health-data-standards-3.5.2 lib/health-data-standards/export/html.rb
health-data-standards-3.5.1 lib/health-data-standards/export/html.rb
health-data-standards-3.5.0 lib/health-data-standards/export/html.rb
health-data-standards-3.4.6 lib/health-data-standards/export/html.rb
health-data-standards-3.4.5 lib/health-data-standards/export/html.rb
health-data-standards-3.4.4 lib/health-data-standards/export/html.rb
health-data-standards-3.4.3 lib/health-data-standards/export/html.rb
health-data-standards-3.4.2 lib/health-data-standards/export/html.rb
health-data-standards-3.4.1 lib/health-data-standards/export/html.rb
health-data-standards-3.4.0 lib/health-data-standards/export/html.rb
health-data-standards-3.2.12 lib/health-data-standards/export/html.rb
health-data-standards-3.3.0 lib/health-data-standards/export/html.rb
health-data-standards-3.2.11 lib/health-data-standards/export/html.rb
health-data-standards-3.2.10 lib/health-data-standards/export/html.rb
health-data-standards-3.2.8 lib/health-data-standards/export/html.rb
health-data-standards-3.2.7 lib/health-data-standards/export/html.rb
health-data-standards-3.2.6 lib/health-data-standards/export/html.rb
health-data-standards-3.2.5 lib/health-data-standards/export/html.rb