Cumulus Ruby Gem

A Ruby wrapper for the Cumulus API.

Installation

$ gem install cumulus_ruby

API Usage Examples

You will need to get an access token. Once you have it, initialize the client to make authenticated further calls.

# initializing the client
client = Cumulus::Client.new(token: 'access-token')

Patients

Create a patient.

attributes = { first_name: 'John', middle_name: 'Doe', curp: 'JDOE' }
patient = Cumulus::Patient.new(client, attributes)
patient.create
# or
patient = Patient.new(client)
patient.create(attributes)

Update a patient.

patient.update(first_name: 'Mike')

Fetch a patient.

patient.fetch(other_patient.curp)

Search patient info.

patient.search(other_patient.curp, { query: 'foo' })

P*mex

pmx = Cumulus::Pmx.new(client)

Look for companies

pmx.companies({ 'numeroEmpleado' => '123' })

Look for entitlement

pmx.entitled({ 'numeroEmpresa' => '123',
  'numeroEmpleado' => '123', 'codigoDerechoHabiente' => '0' })

Look for a patient

pmx.patient({ 'numeroEmpresa' => '123',
  'numeroEmpleado' => '123', 'codigoDerechoHabiente' => '0' })

License

The gem is available as open source under the terms of the MIT License.