module FHIR::Sections::History

Public Instance Methods

all_history() click to toggle source

Retrieve the update history for all resource types since the start of server records.

# File lib/fhir_client/sections/history.rb, line 66
def all_history
  history(history: {})
end
all_history_as_of(last_update) click to toggle source

Retrieve the update history for all resource types since a specific last update date/time.

Note: @param last_update @return

# File lib/fhir_client/sections/history.rb, line 77
def all_history_as_of(last_update)
  history(history: { since: last_update })
end
history(options) click to toggle source

Retrieve the update history for a resource with given id since last update time. Last update may be null TODO - ensure this is the case.

@param last_update @param resourceClass @param id @return

public <T extends Resource> AtomFeed history(Calendar last_update, Class<T> resourceClass, String id); public <T extends Resource> AtomFeed history(DateAndTime last_update, Class<T> resourceClass, String id);

# File lib/fhir_client/sections/history.rb, line 26
def history(options)
  options = {format: @default_format}.merge(options)
  reply = get resource_url(options), fhir_headers

  # The history reply should be a bundle
  bundle_klass = self.versioned_resource_class(:Bundle)

  reply.resource = parse_reply(bundle_klass, options[:format], reply)
  reply.resource_class = options[:resource]
  reply
end
resource_history(klass) click to toggle source
# File lib/fhir_client/sections/history.rb, line 55
def resource_history(klass)
  history(resource: klass, history: {})
end
resource_history_as_of(klass, last_update) click to toggle source
# File lib/fhir_client/sections/history.rb, line 59
def resource_history_as_of(klass, last_update)
  history(resource: klass, history: { since: last_update })
end
resource_instance_history(klass, id) click to toggle source
# File lib/fhir_client/sections/history.rb, line 51
def resource_instance_history(klass, id)
  history(resource: klass, id: id, history: {})
end
resource_instance_history_as_of(klass, id, last_update) click to toggle source

Retrieve the entire update history for a resource with the given id. Last update may be null TODO - ensure this is the case.

@param resourceClass @param id @param last_update @return

# File lib/fhir_client/sections/history.rb, line 47
def resource_instance_history_as_of(klass, id, last_update)
  history(resource: klass, id: id, history: { since: last_update })
end