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
114 115 116 |
# File 'lib/fhir_client/ext/model.rb', line 114 def all(client = self.client) handle_response client.exception_class, client.read_feed(self) end |
#client ⇒ Object
60 61 62 |
# File 'lib/fhir_client/ext/model.rb', line 60 def client FHIR::Model.client end |
#client=(client) ⇒ Object
64 65 66 |
# File 'lib/fhir_client/ext/model.rb', line 64 def client=(client) FHIR::Model.client = client end |
#conditional_create(model, params, client = self.client) ⇒ Object
105 106 107 108 |
# File 'lib/fhir_client/ext/model.rb', line 105 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
100 101 102 103 |
# File 'lib/fhir_client/ext/model.rb', line 100 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
110 111 112 |
# File 'lib/fhir_client/ext/model.rb', line 110 def partial_update(id, patchset, = {}) handle_response client.exception_class, client.partial_update(self, id, patchset, ) end |
#read(id, client = self.client) ⇒ Object
68 69 70 |
# File 'lib/fhir_client/ext/model.rb', line 68 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
72 73 74 |
# File 'lib/fhir_client/ext/model.rb', line 72 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
80 81 82 |
# File 'lib/fhir_client/ext/model.rb', line 80 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
84 85 86 |
# File 'lib/fhir_client/ext/model.rb', line 84 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
88 89 90 |
# File 'lib/fhir_client/ext/model.rb', line 88 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
92 93 94 |
# File 'lib/fhir_client/ext/model.rb', line 92 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
96 97 98 |
# File 'lib/fhir_client/ext/model.rb', line 96 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
76 77 78 |
# File 'lib/fhir_client/ext/model.rb', line 76 def vread(id, version_id, client = self.client) handle_response client.exception_class, client.vread(self, id, version_id) end |