luma
Ruby gem for Luma Health API
Installation
Add this line to your application’s Gemfile:
ruby
gem 'luma'
And then execute:
$ bundle
Or install it yourself as:
$ gem install luma
Usage
Supply email and password with each request based upon the requesting client/group’s API user.
### Create Appointment Type
ruby
body = { "name": "Infusion", "description": "Infusion" }
Luma::AppointmentType.new(email: email, password: password).create_appointment_type(body: body)
Create Facility
```ruby body = { name: “Facility Test Deb 1”, phone: “5121111111”, address: “101 Bob Avenue”, state: “Texas”, city: “Austin”, postcode: 78705 }
Luma::Facilities.new(email: email, password: password).create_facility(body: body) ```
Create Provider
ruby
body = { "name": "Billy Bob 2", "npi": 1234567891 }
Luma::Provider.new(email: email, password: password).create_provider(body: body)
Create Patient
```ruby dob = Luma::Models::DateOfBirth.new(year: 1993, month: 1, day: 2) contact = Luma::Models::Contact.new(type: Luma::Models::Contact::CONTACT_TYPES[:email], value: “[email protected]”, active: true ) body = Luma::Models::Patient.new(first_name: ‘Ruby’, last_name: ‘Jones’, dob: dob, address: ‘123 Main’, city: ‘Austin’, state: ‘TX’, zip_code: 78701, contact: [contact], do_not_contact: false )
Luma::Patient.new(email: email, password: password).create_patient(body: body) ```
Update Patient
```ruby body = Luma::Models::Patient.new(address: ‘456 Old Main’) patient_identifier = ‘12345a45b67c89101d2e3456’
Luma::Patient.new(email: email, password: password).update_patient(identifier: patient_identifier, body: body) ```
GET Patient
```ruby patient_identifier = ‘12345a45b67c89101d2e3456’
Luma::Patient.new(email: email, password: password).get_patient(identifier: patient_identifier) ```
Create Appointment
```ruby body = Luma::Models::Appointment.new( appt_date: ‘2019-06-18T15:45:00.000Z’, appt_duration: ‘60’, appt_status: ‘Unconfirmed’, patient_id: ‘12345’, provider_id: ‘23456’, facility_id: ‘34567’, appt_type_id: ‘45678’, )
Luma::Appointment.new(email: email, password: password).create_appointment(body: body) ```
Update Appointment
```ruby body = { appt_duration: ‘60’ }
Luma::Appointment.new(email: email, password: password).update_appointment(‘appointment_id’, body: body) ```
Development
Prep
After checking out the repo, run bin/setup
to install dependencies.
Test
Run rake test
to run the tests.
Debug
Run bin/console
for an interactive prompt that will allow you to experiment.
Install Local
To install this gem onto your local machine, run bundle exec rake install
.
Release
To release a new version, update the version number in version.rb
and add notes to CHANGELOG.md
.
From up-to-date main
branch, run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.