luma 0.0.1 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +40 -1
- data/README.md +41 -2
- data/lib/luma/appointment_type.rb +23 -0
- data/lib/luma/connection.rb +11 -0
- data/lib/luma/facilities.rb +14 -0
- data/lib/luma/provider.rb +18 -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: 4fa51b1a67a6654b087dd07a6fac2cbfa92d5bdabd78adb9ac1dc7b7a61d4f20
|
4
|
+
data.tar.gz: 152164770be9e7a8753b0456f2a94b15f2fcfc1f75795b9266b09cb81fbecc20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fd82fa1ded48b2aea24bdedaa370ec498d28fe3be85748974b606273d3be0991ee570d2083c83bd19e5217e8b8181ab063df3abbf31f74ec0595a05c478934a
|
7
|
+
data.tar.gz: c9769fb14069ad01e56b53f9ac512735ee51f2cab42f003b3bd9eb9a3d59a452e52ae9a21e5db0548de48700463a4f2e3007e9e4f47689fa41f282a568baf9c5
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,43 @@
|
|
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.5] - 2021-10-14
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
- Return HTTParty response when creating facility, appointment type, provider
|
12
|
+
|
13
|
+
## [0.0.4] - 2021-09-7
|
14
|
+
|
15
|
+
### Added
|
16
|
+
|
17
|
+
- Added API Access for creating a facility (POST)
|
18
|
+
|
19
|
+
## [0.0.3] - 2021-08-30
|
20
|
+
|
21
|
+
### Changed
|
22
|
+
|
23
|
+
- Models to have better inheritance and DRYer code
|
24
|
+
|
25
|
+
### Added
|
26
|
+
|
27
|
+
- Added API access for creating a provider (POST)
|
28
|
+
|
29
|
+
## [0.0.2] - 2021-08-26
|
30
|
+
|
31
|
+
### Added
|
32
|
+
|
33
|
+
- Added API access for creating and finding appointment types (GET and POST)
|
34
|
+
|
1
35
|
## [0.0.1] - 2021-05-28
|
36
|
+
|
2
37
|
- Initial Create
|
3
38
|
|
4
|
-
[0.
|
39
|
+
[0.0.5]: https://github.com/WeInfuse/luma/compare/v0.0.4...v0.0.5
|
40
|
+
[0.0.4]: https://github.com/WeInfuse/luma/compare/v0.0.3...v0.0.4
|
41
|
+
[0.0.3]: https://github.com/WeInfuse/luma/compare/v0.0.2...v0.0.3
|
42
|
+
[0.0.2]: https://github.com/WeInfuse/luma/compare/v0.0.1...v0.0.2
|
43
|
+
[0.0.1]: https://github.com/WeInfuse/luma/compare/4626a358638...v0.0.1
|
data/README.md
CHANGED
@@ -29,8 +29,47 @@ 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
|
+
Luma::Provider.new.create_provider(name: 'Billy Bob', npi: 1234567891)
|
55
|
+
```
|
56
|
+
|
32
57
|
## Development
|
33
58
|
|
34
|
-
|
59
|
+
### Prep
|
60
|
+
After checking out the repo, run `bin/setup` to install dependencies.
|
61
|
+
|
62
|
+
### Test
|
63
|
+
Run `rake test` to run the tests.
|
64
|
+
|
65
|
+
### Debug
|
66
|
+
Run `bin/console` for an interactive prompt that will allow you to experiment.
|
67
|
+
|
68
|
+
### Install Local
|
69
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
70
|
+
|
71
|
+
### Release
|
72
|
+
|
73
|
+
To release a new version, update the version number in `version.rb` and add notes to `CHANGELOG.md`.
|
35
74
|
|
36
|
-
|
75
|
+
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
@@ -10,6 +10,11 @@ module Luma
|
|
10
10
|
|
11
11
|
format :json
|
12
12
|
|
13
|
+
def initialize(body: nil, headers: {})
|
14
|
+
@body = body
|
15
|
+
@headers = headers
|
16
|
+
end
|
17
|
+
|
13
18
|
def request(endpoint: DEFAULT_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post)
|
14
19
|
body = body.to_json if body.is_a?(Hash)
|
15
20
|
headers = auth_header.merge(headers) if auth
|
@@ -17,6 +22,12 @@ module Luma
|
|
17
22
|
self.class.send("#{verb}", endpoint, body: body, headers: headers)
|
18
23
|
end
|
19
24
|
|
25
|
+
def add_headers_and_body
|
26
|
+
@body = @body.to_json
|
27
|
+
@headers = auth_header.merge(@headers)
|
28
|
+
@headers["Content-Type"] = 'application/json'
|
29
|
+
end
|
30
|
+
|
20
31
|
private
|
21
32
|
|
22
33
|
def auth_header
|
@@ -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
|
+
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, name: "", npi: nil, headers: {}, auth: true, verb: :post)
|
8
|
+
@body = {
|
9
|
+
name: name,
|
10
|
+
npi: npi
|
11
|
+
}
|
12
|
+
|
13
|
+
self.add_headers_and_body if auth
|
14
|
+
|
15
|
+
result = self.class.send(verb.to_s, endpoint, body: @body, headers: @headers, debug_output: $stdout)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
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.5
|
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-14 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
|