Sha256: 6adb3c41b8283c7346fc456f8df625d90197ee81b7ff4f1106fa010738207167

Contents?: true

Size: 855 Bytes

Versions: 75

Compression:

Stored size: 855 Bytes

Contents

module HQMF1
  class Comparison
  
    include HQMF1::Utilities
    
    attr_reader :restrictions, :data_criteria_id, :title, :subset
    
    def initialize(data_criteria_id, entry, parent, doc)
      @doc = doc
      @data_criteria_id = data_criteria_id
      @entry = entry
      title_def = @entry.at_xpath('./*/cda:title')
      if title_def
        @title = title_def.inner_text
      end
      @restrictions = []
      restriction_def = @entry.at_xpath('./*/cda:sourceOf')
      if restriction_def
        @entry.xpath('./*/cda:sourceOf').each do |restriction|
          @restrictions << Restriction.new(restriction, self, @doc)
        end
      end
    end
    
    def to_json
      
      json = build_hash(self, [:data_criteria_id,:title,:subset])
      json[:restrictions] = json_array(@restrictions)
      json
      
    end
    
  end
end

Version data entries

75 entries across 75 versions & 3 rubygems

Version Path
health-data-standards-4.3.2 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-4.3.1 lib/hqmf-parser/1.0/comparison.rb
cqm-parsers-0.2.1 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-4.3.0 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-4.2.0 lib/hqmf-parser/1.0/comparison.rb
cqm-parsers-0.1.1 lib/hqmf-parser/1.0/comparison.rb
cqm-parsers-0.1.0 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-4.1.0 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-4.0.6 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-4.0.5 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-4.0.4 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-4.0.3 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-4.0.2 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-4.0.1 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-4.0.0 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-3.7.0 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-3.6.1 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-3.5.3 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-3.5.2 lib/hqmf-parser/1.0/comparison.rb
health-data-standards-3.5.1 lib/hqmf-parser/1.0/comparison.rb