Sha256: b5cbf3337302c432e781ec962a67a64350b3febfcb406bb801bae05364b68b14

Contents?: true

Size: 1.1 KB

Versions: 43

Compression:

Stored size: 1.1 KB

Contents

module HealthDataStandards
  module Import
    module CCR
      class SimpleImporter < SectionImporter
        # Traverses that ASTM CCR document passed in using XPath and creates an Array of Entry
        # objects based on what it finds                          
        # @param [Nokogiri::XML::Document] doc It is expected that the root node of this document
        #        will have the "ccr" namespace registered to "urn:astm-org:CCR"
        #        measure definition
        # @return [Array] will be a list of Entry objects
        def create_entries(doc)
          entry_list = []
          entry_elements = doc.xpath(@entry_xpath)
          entry_elements.each do |entry_element|
            entry = Entry.new
            extract_codes(entry_element, entry)
            extract_dates(entry_element, entry)
            extract_status(entry_element, entry)  
            if @check_for_usable
              entry_list << entry if entry.usable?
            else
              entry_list << entry
            end             
          end
          entry_list              
        end
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
health-data-standards-0.8.1 lib/health-data-standards/import/ccr/simple_importer.rb
health-data-standards-0.8.0 lib/health-data-standards/import/ccr/simple_importer.rb
health-data-standards-0.7.1 lib/health-data-standards/import/ccr/simple_importer.rb