luma 0.0.6 → 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 +8 -0
- data/README.md +21 -0
- data/lib/luma/appointment_type.rb +2 -2
- 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 +1 -1
- data/lib/luma/version.rb +1 -1
- data/lib/luma.rb +4 -0
- metadata +6 -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
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
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
|
+
|
7
14
|
## [0.0.6] - 2021-10-15
|
8
15
|
|
9
16
|
### Changed
|
@@ -42,6 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
42
49
|
|
43
50
|
- Initial Create
|
44
51
|
|
52
|
+
[0.0.7]: https://github.com/WeInfuse/luma/compare/v0.0.6...v0.0.7
|
45
53
|
[0.0.6]: https://github.com/WeInfuse/luma/compare/v0.0.5...v0.0.6
|
46
54
|
[0.0.5]: https://github.com/WeInfuse/luma/compare/v0.0.4...v0.0.5
|
47
55
|
[0.0.4]: https://github.com/WeInfuse/luma/compare/v0.0.3...v0.0.4
|
data/README.md
CHANGED
@@ -55,6 +55,27 @@ body = { "name": "Billy Bob 2", "npi": 1234567891 }
|
|
55
55
|
Luma::Provider.new.create_provider(body: body)
|
56
56
|
```
|
57
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
|
+
|
58
79
|
## Development
|
59
80
|
|
60
81
|
### Prep
|
@@ -10,14 +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
|
-
|
13
|
+
HTTParty.get(full_url.to_str, headers: @headers, debug_output: $stdout)
|
14
14
|
end
|
15
15
|
|
16
16
|
def create_appointment_type(endpoint: APPOINTMENT_TYPE_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post, debug_output: $stdout)
|
17
17
|
@body = body
|
18
18
|
self.add_headers_and_body if auth
|
19
19
|
|
20
|
-
|
20
|
+
self.class.send(verb.to_s, endpoint, body: @body, headers: @headers, debug_output: $stdout)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
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
@@ -9,7 +9,7 @@ module Luma
|
|
9
9
|
|
10
10
|
self.add_headers_and_body if auth
|
11
11
|
|
12
|
-
|
12
|
+
self.class.send(verb.to_s, endpoint, body: @body, headers: @headers, debug_output: $stdout)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
data/lib/luma/version.rb
CHANGED
data/lib/luma.rb
CHANGED
@@ -7,6 +7,10 @@ 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'
|
10
14
|
|
11
15
|
module Luma
|
12
16
|
class Configuration
|
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-10-
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -160,6 +160,10 @@ files:
|
|
160
160
|
- lib/luma/connection.rb
|
161
161
|
- lib/luma/facilities.rb
|
162
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
|
163
167
|
- lib/luma/provider.rb
|
164
168
|
- lib/luma/version.rb
|
165
169
|
- luma.gemspec
|