luma 0.0.3 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +55 -1
- data/README.md +63 -2
- data/lib/luma/appointment_type.rb +3 -11
- data/lib/luma/facilities.rb +14 -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 -14
- data/lib/luma/version.rb +1 -1
- data/lib/luma.rb +5 -0
- data/luma.gemspec +1 -0
- metadata +21 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '00429d3b54d9cda59b281b0446ff7585008fcc498f2199f0fce23855c2582cc6'
|
4
|
+
data.tar.gz: 1c15d031ecf8b95be3d2fa97082ef6e6f72ba0d090351ad5c8fae594764a6312
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b50ab8b8b32e94a2d10d5782b01935781613af96aeae2e6efd5c1211f6cfbe5528d92fb134aa0248c5131ca59a9ae485f855d28f7eb102469f66b39c1f98a1ed
|
7
|
+
data.tar.gz: 3353c539d5e508a10af4f8807620935d07db0432f9382ef0355a135f9dc9ba1ffbd073179da644efcb69fcf15a0b5ff4914d59f86f009321708754b71143e6f0
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,58 @@
|
|
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.7] - 2021-10-25
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
- Add API access for creating a patient (POST)
|
12
|
+
- Add Patient, Date of Birth and Contact models used in create patient payload
|
13
|
+
|
14
|
+
## [0.0.6] - 2021-10-15
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
|
18
|
+
- Adjust provider to accept body parameter
|
19
|
+
|
20
|
+
## [0.0.5] - 2021-10-14
|
21
|
+
|
22
|
+
### Changed
|
23
|
+
|
24
|
+
- Return HTTParty response when creating facility, appointment type, provider
|
25
|
+
|
26
|
+
## [0.0.4] - 2021-09-7
|
27
|
+
|
28
|
+
### Added
|
29
|
+
|
30
|
+
- Added API Access for creating a facility (POST)
|
31
|
+
|
32
|
+
## [0.0.3] - 2021-08-30
|
33
|
+
|
34
|
+
### Changed
|
35
|
+
|
36
|
+
- Models to have better inheritance and DRYer code
|
37
|
+
|
38
|
+
### Added
|
39
|
+
|
40
|
+
- Added API access for creating a provider (POST)
|
41
|
+
|
42
|
+
## [0.0.2] - 2021-08-26
|
43
|
+
|
44
|
+
### Added
|
45
|
+
|
46
|
+
- Added API access for creating and finding appointment types (GET and POST)
|
47
|
+
|
1
48
|
## [0.0.1] - 2021-05-28
|
49
|
+
|
2
50
|
- Initial Create
|
3
51
|
|
4
|
-
[0.
|
52
|
+
[0.0.7]: https://github.com/WeInfuse/luma/compare/v0.0.6...v0.0.7
|
53
|
+
[0.0.6]: https://github.com/WeInfuse/luma/compare/v0.0.5...v0.0.6
|
54
|
+
[0.0.5]: https://github.com/WeInfuse/luma/compare/v0.0.4...v0.0.5
|
55
|
+
[0.0.4]: https://github.com/WeInfuse/luma/compare/v0.0.3...v0.0.4
|
56
|
+
[0.0.3]: https://github.com/WeInfuse/luma/compare/v0.0.2...v0.0.3
|
57
|
+
[0.0.2]: https://github.com/WeInfuse/luma/compare/v0.0.1...v0.0.2
|
58
|
+
[0.0.1]: https://github.com/WeInfuse/luma/compare/4626a358638...v0.0.1
|
data/README.md
CHANGED
@@ -29,8 +29,69 @@ 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
|
+
|
32
79
|
## Development
|
33
80
|
|
34
|
-
|
81
|
+
### Prep
|
82
|
+
After checking out the repo, run `bin/setup` to install dependencies.
|
83
|
+
|
84
|
+
### Test
|
85
|
+
Run `rake test` to run the tests.
|
86
|
+
|
87
|
+
### Debug
|
88
|
+
Run `bin/console` for an interactive prompt that will allow you to experiment.
|
89
|
+
|
90
|
+
### Install Local
|
91
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
92
|
+
|
93
|
+
### Release
|
94
|
+
|
95
|
+
To release a new version, update the version number in `version.rb` and add notes to `CHANGELOG.md`.
|
35
96
|
|
36
|
-
|
97
|
+
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).
|
@@ -2,30 +2,22 @@ module Luma
|
|
2
2
|
class AppointmentType < Connection
|
3
3
|
APPOINTMENT_TYPE_ENDPOINT = '/api/appointmentTypes'.freeze
|
4
4
|
|
5
|
-
include HTTParty
|
6
|
-
|
7
5
|
base_uri 'https://api.lumahealth.io/'.freeze
|
8
6
|
|
9
|
-
headers 'Content-Type' => 'application/json'
|
10
|
-
|
11
|
-
format :json
|
12
|
-
|
13
7
|
def view_appointment_types(endpoint: APPOINTMENT_TYPE_ENDPOINT, auth: true, name: nil, description: nil, debug_output: $stdout)
|
14
8
|
self.add_headers_and_body if auth
|
15
9
|
|
16
10
|
url = "api/appointmentTypes?name=#{name}&description=#{description}"
|
17
11
|
full_url = "https://api.lumahealth.io/" + url
|
18
12
|
|
19
|
-
|
20
|
-
{ result: result, headers: @headers }
|
13
|
+
HTTParty.get(full_url.to_str, headers: @headers, debug_output: $stdout)
|
21
14
|
end
|
22
15
|
|
23
16
|
def create_appointment_type(endpoint: APPOINTMENT_TYPE_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post, debug_output: $stdout)
|
24
17
|
@body = body
|
25
18
|
self.add_headers_and_body if auth
|
26
19
|
|
27
|
-
|
28
|
-
{ result: result, headers: @headers }
|
20
|
+
self.class.send(verb.to_s, endpoint, body: @body, headers: @headers, debug_output: $stdout)
|
29
21
|
end
|
30
22
|
end
|
31
|
-
end
|
23
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Luma
|
2
|
+
class Facilities < Connection
|
3
|
+
FACILITY_ENDPOINT = '/api/facilities'.freeze
|
4
|
+
|
5
|
+
base_uri 'https://api.lumahealth.io/'.freeze
|
6
|
+
|
7
|
+
def create_facility(endpoint: FACILITY_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
|
@@ -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
@@ -2,24 +2,14 @@ module Luma
|
|
2
2
|
class Provider < Connection
|
3
3
|
PROVIDER_ENDPOINT = '/api/providers'.freeze
|
4
4
|
|
5
|
-
include HTTParty
|
6
|
-
|
7
5
|
base_uri 'https://api.lumahealth.io/'.freeze
|
8
6
|
|
9
|
-
headers
|
10
|
-
|
11
|
-
format :json
|
12
|
-
|
13
|
-
def create_provider(endpoint: PROVIDER_ENDPOINT, name: "", npi: nil, headers: {}, auth: true, verb: :post)
|
14
|
-
@body = {
|
15
|
-
name: name,
|
16
|
-
npi: npi
|
17
|
-
}
|
7
|
+
def create_provider(endpoint: PROVIDER_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post)
|
8
|
+
@body = body
|
18
9
|
|
19
10
|
self.add_headers_and_body if auth
|
20
11
|
|
21
|
-
|
22
|
-
{ result: result, headers: @headers }
|
12
|
+
self.class.send(verb.to_s, endpoint, body: @body, headers: @headers, debug_output: $stdout)
|
23
13
|
end
|
24
14
|
end
|
25
|
-
end
|
15
|
+
end
|
data/lib/luma/version.rb
CHANGED
data/lib/luma.rb
CHANGED
@@ -6,6 +6,11 @@ require 'luma/connection'
|
|
6
6
|
require 'luma/authentication'
|
7
7
|
require 'luma/provider'
|
8
8
|
require 'luma/appointment_type'
|
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'
|
9
14
|
|
10
15
|
module Luma
|
11
16
|
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.7
|
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-10-25 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
|
@@ -144,7 +158,12 @@ files:
|
|
144
158
|
- lib/luma/appointment_type.rb
|
145
159
|
- lib/luma/authentication.rb
|
146
160
|
- lib/luma/connection.rb
|
161
|
+
- lib/luma/facilities.rb
|
147
162
|
- lib/luma/luma_exception.rb
|
163
|
+
- lib/luma/models/contact.rb
|
164
|
+
- lib/luma/models/date_of_birth.rb
|
165
|
+
- lib/luma/models/patient.rb
|
166
|
+
- lib/luma/patient.rb
|
148
167
|
- lib/luma/provider.rb
|
149
168
|
- lib/luma/version.rb
|
150
169
|
- luma.gemspec
|