Module: HealthDataStandards::Export::GreenC32::ExportGenerator

Extended by:
ExportGenerator
Included in:
ExportGenerator
Defined in:
lib/health-data-standards/export/green_c32/export_generator.rb

Overview

Module that will create objects that can be used to export GreenCDA sections

Instance Method Summary collapse

Instance Method Details

#create_exporter_for(section) ⇒ Object

Creates an object that can be used to export objects into GreenCDA.

Examples:

Creating an results exporter

exporter = ExportGenerator.create_exporter_for(:result)
exporter.export(result) # => Returns GreenCDA XML in a String

Parameters:

  • section (Symbol)

    the section to create the exporter for

Returns:

  • (Object)

    that has an export method



12
13
14
15
16
17
18
# File 'lib/health-data-standards/export/green_c32/export_generator.rb', line 12

def create_exporter_for(section)
  object = Object.new
  object.define_singleton_method(:export) do |section_instance|
    HealthDataStandards::Export::GreenC32::Entry.new.export(section_instance, section)
  end
  object
end