Module: FHIR::ModelExtras::ClassMethods
- Defined in:
- lib/fhir_client/ext/model.rb
Instance Method Summary collapse
- #all(client = self.client) ⇒ Object
- #client ⇒ Object
- #client=(client) ⇒ Object
- #conditional_create(model, params, client = self.client) ⇒ Object
- #create(model, client = self.client) ⇒ Object
- #partial_update(id, patchset, options = {}) ⇒ Object
- #read(id, client = self.client) ⇒ Object
- #read_with_summary(id, summary, client = self.client) ⇒ Object
- #resource_history(client = self.client) ⇒ Object
- #resource_history_as_of(last_update, client = self.client) ⇒ Object
- #resource_instance_history(id, client = self.client) ⇒ Object
- #resource_instance_history_as_of(id, last_update, client = self.client) ⇒ Object
- #search(params = {}, client = self.client) ⇒ Object
- #vread(id, version_id, client = self.client) ⇒ Object
Instance Method Details
#all(client = self.client) ⇒ Object
111 112 113 |
# File 'lib/fhir_client/ext/model.rb', line 111 def all(client = self.client) handle_response client.exception_class, client.read_feed(self) end |
#client ⇒ Object
57 58 59 |
# File 'lib/fhir_client/ext/model.rb', line 57 def client FHIR::Model.client end |
#client=(client) ⇒ Object
61 62 63 |
# File 'lib/fhir_client/ext/model.rb', line 61 def client=(client) FHIR::Model.client = client end |
#conditional_create(model, params, client = self.client) ⇒ Object
102 103 104 105 |
# File 'lib/fhir_client/ext/model.rb', line 102 def conditional_create(model, params, client = self.client) model = new(model) unless model.is_a?(self) handle_response client.exception_class, client.conditional_create(model, params) end |
#create(model, client = self.client) ⇒ Object
97 98 99 100 |
# File 'lib/fhir_client/ext/model.rb', line 97 def create(model, client = self.client) model = new(model) unless model.is_a?(self) handle_response client.exception_class, client.create(model) end |
#partial_update(id, patchset, options = {}) ⇒ Object
107 108 109 |
# File 'lib/fhir_client/ext/model.rb', line 107 def partial_update(id, patchset, = {}) handle_response client.exception_class, client.partial_update(self, id, patchset, ) end |
#read(id, client = self.client) ⇒ Object
65 66 67 |
# File 'lib/fhir_client/ext/model.rb', line 65 def read(id, client = self.client) handle_response client.exception_class, client.read(self, id) end |
#read_with_summary(id, summary, client = self.client) ⇒ Object
69 70 71 |
# File 'lib/fhir_client/ext/model.rb', line 69 def read_with_summary(id, summary, client = self.client) handle_response client.exception_class, client.read(self, id, client.default_format, summary) end |
#resource_history(client = self.client) ⇒ Object
77 78 79 |
# File 'lib/fhir_client/ext/model.rb', line 77 def resource_history(client = self.client) handle_response client.exception_class, client.resource_history(self) end |
#resource_history_as_of(last_update, client = self.client) ⇒ Object
81 82 83 |
# File 'lib/fhir_client/ext/model.rb', line 81 def resource_history_as_of(last_update, client = self.client) handle_response client.exception_class, client.resource_history_as_of(self, last_update) end |
#resource_instance_history(id, client = self.client) ⇒ Object
85 86 87 |
# File 'lib/fhir_client/ext/model.rb', line 85 def resource_instance_history(id, client = self.client) handle_response client.exception_class, client.resource_instance_history(self, id) end |
#resource_instance_history_as_of(id, last_update, client = self.client) ⇒ Object
89 90 91 |
# File 'lib/fhir_client/ext/model.rb', line 89 def resource_instance_history_as_of(id, last_update, client = self.client) handle_response client.exception_class, client.resource_instance_history_as_of(self, id, last_update) end |
#search(params = {}, client = self.client) ⇒ Object
93 94 95 |
# File 'lib/fhir_client/ext/model.rb', line 93 def search(params = {}, client = self.client) handle_response client.exception_class, client.search(self, search: { parameters: params }) end |
#vread(id, version_id, client = self.client) ⇒ Object
73 74 75 |
# File 'lib/fhir_client/ext/model.rb', line 73 def vread(id, version_id, client = self.client) handle_response client.exception_class, client.vread(self, id, version_id) end |