luma 0.0.2 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +47 -1
- data/README.md +42 -2
- data/lib/luma/appointment_type.rb +23 -0
- data/lib/luma/connection.rb +9 -24
- data/lib/luma/facilities.rb +14 -0
- data/lib/luma/provider.rb +15 -0
- data/lib/luma/version.rb +1 -1
- data/lib/luma.rb +3 -0
- data/luma.gemspec +1 -0
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7376e18f5c6bd2d23586d170c298281394d7e8e2d6936923f903f9fe2e6d9cd7
|
4
|
+
data.tar.gz: 95eb1b2a96bf03bfe142b557ed1a4369034c741d0dd6d4ce16bd6cf787efbd4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 597ae8ee7d3bf4357d2d48afead8ab99e574b0f0e21dbf89e4277317d0570701d73f97d1c4a93c059d6497d1ccdb48558c185223d52cd88189c17a56c883fd79
|
7
|
+
data.tar.gz: e525ef5b468fa3e548a07db9886cf24107863b2b117d8741792a1988f7a9921c8749d64a4dd612454431ea0456ce214f4ead0bca12e22f4b01a5e096126a4391
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,50 @@
|
|
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.6] - 2021-10-15
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
- Adjust provider to accept body parameter
|
12
|
+
|
13
|
+
## [0.0.5] - 2021-10-14
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
|
17
|
+
- Return HTTParty response when creating facility, appointment type, provider
|
18
|
+
|
19
|
+
## [0.0.4] - 2021-09-7
|
20
|
+
|
21
|
+
### Added
|
22
|
+
|
23
|
+
- Added API Access for creating a facility (POST)
|
24
|
+
|
25
|
+
## [0.0.3] - 2021-08-30
|
26
|
+
|
27
|
+
### Changed
|
28
|
+
|
29
|
+
- Models to have better inheritance and DRYer code
|
30
|
+
|
31
|
+
### Added
|
32
|
+
|
33
|
+
- Added API access for creating a provider (POST)
|
34
|
+
|
35
|
+
## [0.0.2] - 2021-08-26
|
36
|
+
|
37
|
+
### Added
|
38
|
+
|
39
|
+
- Added API access for creating and finding appointment types (GET and POST)
|
40
|
+
|
1
41
|
## [0.0.1] - 2021-05-28
|
42
|
+
|
2
43
|
- Initial Create
|
3
44
|
|
4
|
-
[0.
|
45
|
+
[0.0.6]: https://github.com/WeInfuse/luma/compare/v0.0.5...v0.0.6
|
46
|
+
[0.0.5]: https://github.com/WeInfuse/luma/compare/v0.0.4...v0.0.5
|
47
|
+
[0.0.4]: https://github.com/WeInfuse/luma/compare/v0.0.3...v0.0.4
|
48
|
+
[0.0.3]: https://github.com/WeInfuse/luma/compare/v0.0.2...v0.0.3
|
49
|
+
[0.0.2]: https://github.com/WeInfuse/luma/compare/v0.0.1...v0.0.2
|
50
|
+
[0.0.1]: https://github.com/WeInfuse/luma/compare/4626a358638...v0.0.1
|
data/README.md
CHANGED
@@ -29,8 +29,48 @@ 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
|
+
|
32
58
|
## Development
|
33
59
|
|
34
|
-
|
60
|
+
### Prep
|
61
|
+
After checking out the repo, run `bin/setup` to install dependencies.
|
62
|
+
|
63
|
+
### Test
|
64
|
+
Run `rake test` to run the tests.
|
65
|
+
|
66
|
+
### Debug
|
67
|
+
Run `bin/console` for an interactive prompt that will allow you to experiment.
|
68
|
+
|
69
|
+
### Install Local
|
70
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
71
|
+
|
72
|
+
### Release
|
73
|
+
|
74
|
+
To release a new version, update the version number in `version.rb` and add notes to `CHANGELOG.md`.
|
35
75
|
|
36
|
-
|
76
|
+
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,23 @@
|
|
1
|
+
module Luma
|
2
|
+
class AppointmentType < Connection
|
3
|
+
APPOINTMENT_TYPE_ENDPOINT = '/api/appointmentTypes'.freeze
|
4
|
+
|
5
|
+
base_uri 'https://api.lumahealth.io/'.freeze
|
6
|
+
|
7
|
+
def view_appointment_types(endpoint: APPOINTMENT_TYPE_ENDPOINT, auth: true, name: nil, description: nil, debug_output: $stdout)
|
8
|
+
self.add_headers_and_body if auth
|
9
|
+
|
10
|
+
url = "api/appointmentTypes?name=#{name}&description=#{description}"
|
11
|
+
full_url = "https://api.lumahealth.io/" + url
|
12
|
+
|
13
|
+
result = HTTParty.get(full_url.to_str, headers: @headers, debug_output: $stdout)
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_appointment_type(endpoint: APPOINTMENT_TYPE_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post, debug_output: $stdout)
|
17
|
+
@body = body
|
18
|
+
self.add_headers_and_body if auth
|
19
|
+
|
20
|
+
result = self.class.send(verb.to_s, endpoint, body: @body, headers: @headers, debug_output: $stdout)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/luma/connection.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
module Luma
|
2
2
|
class Connection
|
3
3
|
DEFAULT_ENDPOINT = '/endpoint'.freeze
|
4
|
-
APPOINTMENT_TYPE_ENDPOINT = '/api/appointmentTypes'.freeze
|
5
4
|
|
6
5
|
include HTTParty
|
7
6
|
|
@@ -11,6 +10,11 @@ module Luma
|
|
11
10
|
|
12
11
|
format :json
|
13
12
|
|
13
|
+
def initialize(body: nil, headers: {})
|
14
|
+
@body = body
|
15
|
+
@headers = headers
|
16
|
+
end
|
17
|
+
|
14
18
|
def request(endpoint: DEFAULT_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post)
|
15
19
|
body = body.to_json if body.is_a?(Hash)
|
16
20
|
headers = auth_header.merge(headers) if auth
|
@@ -18,29 +22,10 @@ module Luma
|
|
18
22
|
self.class.send("#{verb}", endpoint, body: body, headers: headers)
|
19
23
|
end
|
20
24
|
|
21
|
-
def
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
headers["Content-Type"] = 'application/json'
|
26
|
-
end
|
27
|
-
|
28
|
-
url = "api/appointmentTypes?name=#{name}&description=#{description}"
|
29
|
-
full_url = "https://api.lumahealth.io/" + url
|
30
|
-
|
31
|
-
result = HTTParty.get(full_url.to_str, body: nil, headers: headers, debug_output: $stdout)
|
32
|
-
{ result: result, headers: headers }
|
33
|
-
end
|
34
|
-
|
35
|
-
def create_appointment_type(endpoint: APPOINTMENT_TYPE_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post)
|
36
|
-
if auth
|
37
|
-
body = body.to_json
|
38
|
-
headers = auth_header.merge(headers)
|
39
|
-
headers["Content-Type"] = 'application/json'
|
40
|
-
end
|
41
|
-
|
42
|
-
result = self.class.send(verb.to_s, endpoint, body: body, headers: headers, debug_output: $stdout)
|
43
|
-
{ result: result, headers: headers }
|
25
|
+
def add_headers_and_body
|
26
|
+
@body = @body.to_json
|
27
|
+
@headers = auth_header.merge(@headers)
|
28
|
+
@headers["Content-Type"] = 'application/json'
|
44
29
|
end
|
45
30
|
|
46
31
|
private
|
@@ -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,15 @@
|
|
1
|
+
module Luma
|
2
|
+
class Provider < Connection
|
3
|
+
PROVIDER_ENDPOINT = '/api/providers'.freeze
|
4
|
+
|
5
|
+
base_uri 'https://api.lumahealth.io/'.freeze
|
6
|
+
|
7
|
+
def create_provider(endpoint: PROVIDER_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post)
|
8
|
+
@body = body
|
9
|
+
|
10
|
+
self.add_headers_and_body if auth
|
11
|
+
|
12
|
+
result = self.class.send(verb.to_s, endpoint, body: @body, headers: @headers, debug_output: $stdout)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/luma/version.rb
CHANGED
data/lib/luma.rb
CHANGED
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.6
|
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-15 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,9 +155,12 @@ files:
|
|
141
155
|
- README.md
|
142
156
|
- Rakefile
|
143
157
|
- lib/luma.rb
|
158
|
+
- lib/luma/appointment_type.rb
|
144
159
|
- lib/luma/authentication.rb
|
145
160
|
- lib/luma/connection.rb
|
161
|
+
- lib/luma/facilities.rb
|
146
162
|
- lib/luma/luma_exception.rb
|
163
|
+
- lib/luma/provider.rb
|
147
164
|
- lib/luma/version.rb
|
148
165
|
- luma.gemspec
|
149
166
|
homepage: https://github.com/WeInfuse/luma
|