Class: Cumulus::Patient
- Inherits:
-
Object
- Object
- Cumulus::Patient
- Defined in:
- lib/cumulus/patient.rb
Constant Summary collapse
- PARAMETERS =
{ 'id' => 'id', 'first_name' => 'nombre', 'middle_name' => 'apellido', 'last_name' => 'apellidoSegundo', 'telephone' => 'telefono', 'telephone2' => 'telefonoAlt', 'email' => 'correo', 'born_at' => 'fechaNacimiento', 'gender' => 'sexo', 'curp' => 'curp', 'street' => 'calle', 'city' => 'ciudad', 'state' => 'estado', 'country' => 'pais', 'zipcode' => 'codigoPostal' }
Instance Method Summary collapse
- #create(parameters = {}) ⇒ Object
- #fetch(curp) ⇒ Object
-
#initialize(client, parameters = {}) ⇒ Patient
constructor
A new instance of Patient.
- #search(curp, query) ⇒ Object
- #update(parameters = {}) ⇒ Object
Constructor Details
#initialize(client, parameters = {}) ⇒ Patient
23 24 25 26 |
# File 'lib/cumulus/patient.rb', line 23 def initialize(client, parameters={}) @client = client parameters_handler.set(parameters) end |
Instance Method Details
#create(parameters = {}) ⇒ Object
28 29 30 31 |
# File 'lib/cumulus/patient.rb', line 28 def create(parameters={}) parameters_handler.set(parameters) client.request(:post, '/pacientes', parameters_handler.for_request) end |
#fetch(curp) ⇒ Object
38 39 40 |
# File 'lib/cumulus/patient.rb', line 38 def fetch(curp) client.request(:get, "/pacientes/#{curp}") end |
#search(curp, query) ⇒ Object
42 43 44 |
# File 'lib/cumulus/patient.rb', line 42 def search(curp, query) client.request(:post, "/pacientes/#{curp}/busqueda", { query: query }) end |
#update(parameters = {}) ⇒ Object
33 34 35 36 |
# File 'lib/cumulus/patient.rb', line 33 def update(parameters={}) parameters_handler.set(parameters) client.request(:put, "/pacientes/#{curp}", parameters_handler.for_request) end |