module FHIR::BundleExtras
Public Instance Methods
each(&block)
click to toggle source
# File lib/fhir_client/ext/bundle.rb, line 30 def each(&block) iterator = @entry.map(&:resource).each(&block) if next_bundle next_iterator = next_bundle.each(&block) Enumerator.new do |y| iterator.each { |r| y << r } next_iterator.each { |r| y << r } end else iterator end end
first_link()
click to toggle source
# File lib/fhir_client/ext/bundle.rb, line 7 def first_link link.select { |n| n.relation == 'first' }.first end
get_by_id(id)
click to toggle source
# File lib/fhir_client/ext/bundle.rb, line 23 def get_by_id(id) entry.each do |item| return item.resource if item.id == id || item.resource.id == id end nil end
last_link()
click to toggle source
# File lib/fhir_client/ext/bundle.rb, line 11 def last_link link.select { |n| n.relation == 'last' }.first end
next_bundle()
click to toggle source
# File lib/fhir_client/ext/bundle.rb, line 43 def next_bundle return nil unless client && next_link.try(:url) @next_bundle ||= client.parse_reply(self.class, client.default_format, client.raw_read_url(next_link.url)) end
next_link()
click to toggle source
# File lib/fhir_client/ext/bundle.rb, line 15 def next_link link.select { |n| n.relation == 'next' }.first end
previous_link()
click to toggle source
# File lib/fhir_client/ext/bundle.rb, line 19 def previous_link link.select { |n| n.relation == 'previous' || n.relation == 'prev' }.first end
self_link()
click to toggle source
# File lib/fhir_client/ext/bundle.rb, line 3 def self_link link.select { |n| n.relation == 'self' }.first end