luma 0.0.4 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +38 -1
- data/README.md +78 -2
- data/lib/luma/appointment.rb +14 -0
- data/lib/luma/appointment_type.rb +3 -5
- data/lib/luma/facilities.rb +2 -3
- data/lib/luma/models/appointment.rb +17 -0
- data/lib/luma/models/contact.rb +18 -0
- data/lib/luma/models/date_of_birth.rb +12 -0
- data/lib/luma/models/patient.rb +19 -0
- data/lib/luma/patient.rb +14 -0
- data/lib/luma/provider.rb +4 -8
- data/lib/luma/version.rb +1 -1
- data/lib/luma.rb +6 -0
- data/luma.gemspec +1 -0
- metadata +23 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 154f08ce7d11575161ae8c86c50e69caa8194a205562e94d340591bfaa6dd906
|
4
|
+
data.tar.gz: 2e29bfa638c795d4708e449ca8fbfc93a6ed23d9eed67c075687bd4b6eee158c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8d86c0863c92155c7e4700ab0cc827a4b4b10e1a6985f158427db84144f971e1764696616d0f5416d2bed915b53e8f881a7751aae1e20cc46c835b685b852ca
|
7
|
+
data.tar.gz: 8f12b4d72357213e5db9e6f5c110abccced32403344541d57bf1edf2288d188143e0060a7183cbe26a4cb3ffb2c3bf1babe3443cdf58eb981266030425a9f7b4
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,34 @@
|
|
1
1
|
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [0.0.8] - 2021-11-02
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
- Add API access for creating an appointment (POST)
|
12
|
+
- Add Appointment model for use in creating appointment payload
|
13
|
+
|
14
|
+
## [0.0.7] - 2021-10-25
|
15
|
+
|
16
|
+
### Added
|
17
|
+
|
18
|
+
- Add API access for creating a patient (POST)
|
19
|
+
- Add Patient, Date of Birth and Contact models used in create patient payload
|
20
|
+
|
21
|
+
## [0.0.6] - 2021-10-15
|
22
|
+
|
23
|
+
### Changed
|
24
|
+
|
25
|
+
- Adjust provider to accept body parameter
|
26
|
+
|
27
|
+
## [0.0.5] - 2021-10-14
|
28
|
+
|
29
|
+
### Changed
|
30
|
+
|
31
|
+
- Return HTTParty response when creating facility, appointment type, provider
|
2
32
|
|
3
33
|
## [0.0.4] - 2021-09-7
|
4
34
|
|
@@ -26,4 +56,11 @@
|
|
26
56
|
|
27
57
|
- Initial Create
|
28
58
|
|
29
|
-
[0.
|
59
|
+
[0.0.8]: https://github.com/WeInfuse/luma/compare/v0.0.7...v0.0.8
|
60
|
+
[0.0.7]: https://github.com/WeInfuse/luma/compare/v0.0.6...v0.0.7
|
61
|
+
[0.0.6]: https://github.com/WeInfuse/luma/compare/v0.0.5...v0.0.6
|
62
|
+
[0.0.5]: https://github.com/WeInfuse/luma/compare/v0.0.4...v0.0.5
|
63
|
+
[0.0.4]: https://github.com/WeInfuse/luma/compare/v0.0.3...v0.0.4
|
64
|
+
[0.0.3]: https://github.com/WeInfuse/luma/compare/v0.0.2...v0.0.3
|
65
|
+
[0.0.2]: https://github.com/WeInfuse/luma/compare/v0.0.1...v0.0.2
|
66
|
+
[0.0.1]: https://github.com/WeInfuse/luma/compare/4626a358638...v0.0.1
|
data/README.md
CHANGED
@@ -29,8 +29,84 @@ Luma.configure do |c|
|
|
29
29
|
end
|
30
30
|
```
|
31
31
|
|
32
|
+
### Create Appointment Type
|
33
|
+
```ruby
|
34
|
+
body = { "name": "Infusion", "description": "Infusion" }
|
35
|
+
Luma::AppointmentType.new.create_appointment_type(body: body)
|
36
|
+
```
|
37
|
+
|
38
|
+
### Create Facility
|
39
|
+
```ruby
|
40
|
+
body = {
|
41
|
+
name: "Facility Test Deb 1",
|
42
|
+
phone: "5121111111",
|
43
|
+
address: "101 Bob Avenue",
|
44
|
+
state: "Texas",
|
45
|
+
city: "Austin",
|
46
|
+
postcode: 78705
|
47
|
+
}
|
48
|
+
|
49
|
+
Luma::Facilities.new.create_facility(body: body)
|
50
|
+
```
|
51
|
+
|
52
|
+
### Create Provider
|
53
|
+
```ruby
|
54
|
+
body = { "name": "Billy Bob 2", "npi": 1234567891 }
|
55
|
+
Luma::Provider.new.create_provider(body: body)
|
56
|
+
```
|
57
|
+
|
58
|
+
### Create Patient
|
59
|
+
```ruby
|
60
|
+
dob = Luma::Models::DateOfBirth.new(year: 1993, month: 1, day: 2)
|
61
|
+
contact = Luma::Models::Contact.new(type: Luma::Models::Contact::CONTACT_TYPES[:email],
|
62
|
+
value: "ruby@test.com",
|
63
|
+
active: true
|
64
|
+
)
|
65
|
+
body = Luma::Models::Patient.new(first_name: 'Ruby',
|
66
|
+
last_name: 'Jones',
|
67
|
+
dob: dob,
|
68
|
+
address: '123 Main',
|
69
|
+
city: 'Austin',
|
70
|
+
state: 'TX',
|
71
|
+
zip_code: 78701,
|
72
|
+
contact: [contact],
|
73
|
+
do_not_contact: false
|
74
|
+
)
|
75
|
+
|
76
|
+
Luma::Patient.new.create_patient(body: body)
|
77
|
+
```
|
78
|
+
|
79
|
+
### Create Appointment
|
80
|
+
```ruby
|
81
|
+
body = Luma::Models::Appointment.new(
|
82
|
+
appt_date: '2019-06-18T15:45:00.000Z',
|
83
|
+
appt_duration: '60',
|
84
|
+
appt_status: 'Unconfirmed',
|
85
|
+
patient_id: '12345',
|
86
|
+
provider_id: '23456',
|
87
|
+
facility_id: '34567',
|
88
|
+
appt_type_id: '45678',
|
89
|
+
)
|
90
|
+
|
91
|
+
Luma::Appointment.new.create_appointment(body: body)
|
92
|
+
```
|
93
|
+
|
32
94
|
## Development
|
33
95
|
|
34
|
-
|
96
|
+
### Prep
|
97
|
+
After checking out the repo, run `bin/setup` to install dependencies.
|
98
|
+
|
99
|
+
### Test
|
100
|
+
Run `rake test` to run the tests.
|
101
|
+
|
102
|
+
### Debug
|
103
|
+
Run `bin/console` for an interactive prompt that will allow you to experiment.
|
104
|
+
|
105
|
+
### Install Local
|
106
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
107
|
+
|
108
|
+
### Release
|
109
|
+
|
110
|
+
To release a new version, update the version number in `version.rb` and add notes to `CHANGELOG.md`.
|
35
111
|
|
36
|
-
|
112
|
+
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](https://rubygems.org).
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Luma
|
2
|
+
class Appointment < Connection
|
3
|
+
APPOINTMENT_ENDPOINT = '/api/appointments'.freeze
|
4
|
+
|
5
|
+
base_uri 'https://api.lumahealth.io/'.freeze
|
6
|
+
|
7
|
+
def create_appointment(endpoint: APPOINTMENT_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post, debug_output: $stdout)
|
8
|
+
@body = body
|
9
|
+
self.add_headers_and_body if auth
|
10
|
+
|
11
|
+
self.class.send(verb.to_s, endpoint, body: @body, headers: @headers)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -10,16 +10,14 @@ module Luma
|
|
10
10
|
url = "api/appointmentTypes?name=#{name}&description=#{description}"
|
11
11
|
full_url = "https://api.lumahealth.io/" + url
|
12
12
|
|
13
|
-
|
14
|
-
{ result: result, headers: @headers }
|
13
|
+
HTTParty.get(full_url.to_str, headers: @headers, debug_output: $stdout)
|
15
14
|
end
|
16
15
|
|
17
16
|
def create_appointment_type(endpoint: APPOINTMENT_TYPE_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post, debug_output: $stdout)
|
18
17
|
@body = body
|
19
18
|
self.add_headers_and_body if auth
|
20
19
|
|
21
|
-
|
22
|
-
{ result: result, headers: @headers }
|
20
|
+
self.class.send(verb.to_s, endpoint, body: @body, headers: @headers, debug_output: $stdout)
|
23
21
|
end
|
24
22
|
end
|
25
|
-
end
|
23
|
+
end
|
data/lib/luma/facilities.rb
CHANGED
@@ -8,8 +8,7 @@ module Luma
|
|
8
8
|
@body = body
|
9
9
|
self.add_headers_and_body if auth
|
10
10
|
|
11
|
-
|
12
|
-
{ result: result, headers: @headers }
|
11
|
+
self.class.send(verb.to_s, endpoint, body: @body, headers: @headers)
|
13
12
|
end
|
14
13
|
end
|
15
|
-
end
|
14
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Luma
|
2
|
+
module Models
|
3
|
+
class Appointment < Hashie::Trash
|
4
|
+
include Hashie::Extensions::IgnoreUndeclared
|
5
|
+
include Hashie::Extensions::IndifferentAccess
|
6
|
+
|
7
|
+
property :date, from: :appt_date, required: false
|
8
|
+
property :duration, from: :appt_duration, required: false
|
9
|
+
property :status, from: :appt_status, required: false
|
10
|
+
property :patient, from: :patient_id, required: false
|
11
|
+
property :provider, from: :provider_id, required: false
|
12
|
+
property :facility, from: :facility_id, required: false
|
13
|
+
property :type, from: :appt_type_id, required: false
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Luma
|
2
|
+
module Models
|
3
|
+
class Contact < Hashie::Trash
|
4
|
+
include Hashie::Extensions::IgnoreUndeclared
|
5
|
+
include Hashie::Extensions::IndifferentAccess
|
6
|
+
|
7
|
+
CONTACT_TYPES = {
|
8
|
+
email: "email",
|
9
|
+
text: "sms",
|
10
|
+
phone: "voice"
|
11
|
+
}
|
12
|
+
|
13
|
+
property :type, required: false
|
14
|
+
property :value, required: false
|
15
|
+
property :active, required: false, default: false
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Luma
|
2
|
+
module Models
|
3
|
+
class DateOfBirth < Hashie::Trash
|
4
|
+
include Hashie::Extensions::IgnoreUndeclared
|
5
|
+
include Hashie::Extensions::IndifferentAccess
|
6
|
+
|
7
|
+
property :year, required: false
|
8
|
+
property :month, required: false
|
9
|
+
property :day, required: false
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Luma
|
2
|
+
module Models
|
3
|
+
class Patient < Hashie::Trash
|
4
|
+
include Hashie::Extensions::IgnoreUndeclared
|
5
|
+
include Hashie::Extensions::IndifferentAccess
|
6
|
+
|
7
|
+
property :firstname, from: :first_name, required: false
|
8
|
+
property :lastname, from: :last_name, required: false
|
9
|
+
property :dateOfBirth, from: :dob, required: false, default: {}
|
10
|
+
property :address, required: false
|
11
|
+
property :city, required: false
|
12
|
+
property :state, required: false
|
13
|
+
property :postcode, from: :zip_code, required: false
|
14
|
+
property :contact, required: false
|
15
|
+
property :doNotContact, from: :do_not_contact, required: false, default: true
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/luma/patient.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
module Luma
|
2
|
+
class Patient < Connection
|
3
|
+
PATIENT_ENDPOINT = '/api/patients'.freeze
|
4
|
+
|
5
|
+
base_uri 'https://api.lumahealth.io/'.freeze
|
6
|
+
|
7
|
+
def create_patient(endpoint: PATIENT_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post, debug_output: $stdout)
|
8
|
+
@body = body
|
9
|
+
self.add_headers_and_body if auth
|
10
|
+
|
11
|
+
self.class.send(verb.to_s, endpoint, body: @body, headers: @headers)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/luma/provider.rb
CHANGED
@@ -4,16 +4,12 @@ module Luma
|
|
4
4
|
|
5
5
|
base_uri 'https://api.lumahealth.io/'.freeze
|
6
6
|
|
7
|
-
def create_provider(endpoint: PROVIDER_ENDPOINT,
|
8
|
-
@body =
|
9
|
-
name: name,
|
10
|
-
npi: npi
|
11
|
-
}
|
7
|
+
def create_provider(endpoint: PROVIDER_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post)
|
8
|
+
@body = body
|
12
9
|
|
13
10
|
self.add_headers_and_body if auth
|
14
11
|
|
15
|
-
|
16
|
-
{ result: result, headers: @headers }
|
12
|
+
self.class.send(verb.to_s, endpoint, body: @body, headers: @headers, debug_output: $stdout)
|
17
13
|
end
|
18
14
|
end
|
19
|
-
end
|
15
|
+
end
|
data/lib/luma/version.rb
CHANGED
data/lib/luma.rb
CHANGED
@@ -7,6 +7,12 @@ require 'luma/authentication'
|
|
7
7
|
require 'luma/provider'
|
8
8
|
require 'luma/appointment_type'
|
9
9
|
require 'luma/facilities'
|
10
|
+
require 'luma/patient'
|
11
|
+
require 'luma/models/contact'
|
12
|
+
require 'luma/models/date_of_birth'
|
13
|
+
require 'luma/models/patient'
|
14
|
+
require 'luma/appointment'
|
15
|
+
require 'luma/models/appointment'
|
10
16
|
|
11
17
|
module Luma
|
12
18
|
class Configuration
|
data/luma.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Angela Rodriguez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -128,6 +128,20 @@ dependencies:
|
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0.9'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: pry
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
131
145
|
description:
|
132
146
|
email:
|
133
147
|
- angela.rodriguez@weinfuse.com
|
@@ -141,11 +155,17 @@ files:
|
|
141
155
|
- README.md
|
142
156
|
- Rakefile
|
143
157
|
- lib/luma.rb
|
158
|
+
- lib/luma/appointment.rb
|
144
159
|
- lib/luma/appointment_type.rb
|
145
160
|
- lib/luma/authentication.rb
|
146
161
|
- lib/luma/connection.rb
|
147
162
|
- lib/luma/facilities.rb
|
148
163
|
- lib/luma/luma_exception.rb
|
164
|
+
- lib/luma/models/appointment.rb
|
165
|
+
- lib/luma/models/contact.rb
|
166
|
+
- lib/luma/models/date_of_birth.rb
|
167
|
+
- lib/luma/models/patient.rb
|
168
|
+
- lib/luma/patient.rb
|
149
169
|
- lib/luma/provider.rb
|
150
170
|
- lib/luma/version.rb
|
151
171
|
- luma.gemspec
|
@@ -169,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
189
|
- !ruby/object:Gem::Version
|
170
190
|
version: '0'
|
171
191
|
requirements: []
|
172
|
-
rubygems_version: 3.
|
192
|
+
rubygems_version: 3.0.3
|
173
193
|
signing_key:
|
174
194
|
specification_version: 4
|
175
195
|
summary: Ruby wrapper for the Luma Health API
|