Class: HealthDataStandards::Import::CCR::SimpleImporter

Inherits:
SectionImporter show all
Defined in:
lib/health-data-standards/import/ccr/simple_importer.rb

Constant Summary

Constants inherited from SectionImporter

HealthDataStandards::Import::CCR::SectionImporter::CODE_SYSTEM_MAP

Instance Attribute Summary

Attributes inherited from SectionImporter

#check_for_usable

Instance Method Summary collapse

Methods inherited from SectionImporter

#extract_codes, #extract_dates, #extract_status, #extract_time, #extract_value, #initialize, #normalize_coding_system

Constructor Details

This class inherits a constructor from HealthDataStandards::Import::CCR::SectionImporter

Instance Method Details

#create_entries(doc) ⇒ Array

Traverses that ASTM CCR document passed in using XPath and creates an Array of Entry objects based on what it finds

Parameters:

  • doc (Nokogiri::XML::Document)

    It is expected that the root node of this document will have the “ccr” namespace registered to “urn:astm-org:CCR” measure definition

Returns:

  • (Array)

    will be a list of Entry objects



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/health-data-standards/import/ccr/simple_importer.rb', line 11

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