luma 0.1.2 → 0.1.3
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 +6 -0
- data/README.md +7 -0
- data/lib/luma/models/patient_response.rb +30 -0
- data/lib/luma/patient.rb +10 -0
- data/lib/luma/version.rb +1 -1
- data/lib/luma.rb +1 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f722a4bfdbfbdc81d2e9b85e52c8dd78aef2fdd64df668be3424bcbec766876d
|
4
|
+
data.tar.gz: 21be1a31248e6787d5b2b6a272a5d0ef424dcc01564a5a6e2942a880a4108014
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cfc178b60a519cfe2fec7d61c0aa26e410e5a47dc2c743239cfeb275f97548366ea7e61961cad3d1495df2696e6c66421126f1a98200963c855291cf1653fe1
|
7
|
+
data.tar.gz: d39c57e2e8c78fe22f425fdbf560691907f308b4ae2e4e4553f5f4b362dbc4fc07e1f83ea4d42bc452adfb95e9b5af3470343073e83d6f6b618917ec7fc084c5
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
|
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
|
+
## [0.1.3] - 2022-02-10
|
7
|
+
|
8
|
+
### Changed
|
9
|
+
|
10
|
+
- Added API access for patient data (GET)
|
6
11
|
|
7
12
|
## [0.1.2] - 2022-01-13
|
8
13
|
|
@@ -75,6 +80,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
75
80
|
|
76
81
|
- Initial Create
|
77
82
|
|
83
|
+
[0.1.3]: https://github.com/WeInfuse/luma/compare/v0.1.2...v0.1.3
|
78
84
|
[0.1.2]: https://github.com/WeInfuse/luma/compare/v0.1.1...v0.1.2
|
79
85
|
[0.1.1]: https://github.com/WeInfuse/luma/compare/v0.1.0...v0.1.1
|
80
86
|
[0.1.0]: https://github.com/WeInfuse/luma/compare/v0.0.8...v0.1.0
|
data/README.md
CHANGED
@@ -74,6 +74,13 @@ patient_identifier = '12345a45b67c89101d2e3456'
|
|
74
74
|
Luma::Patient.new(email: email, password: password).update_patient(identifier: patient_identifier, body: body)
|
75
75
|
```
|
76
76
|
|
77
|
+
### GET Patient
|
78
|
+
```ruby
|
79
|
+
patient_identifier = '12345a45b67c89101d2e3456'
|
80
|
+
|
81
|
+
Luma::Patient.new(email: email, password: password).get_patient(identifier: patient_identifier)
|
82
|
+
```
|
83
|
+
|
77
84
|
### Create Appointment
|
78
85
|
```ruby
|
79
86
|
body = Luma::Models::Appointment.new(
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Luma
|
2
|
+
module Models
|
3
|
+
class PatientResponse
|
4
|
+
attr_reader :data
|
5
|
+
|
6
|
+
def initialize(data: nil, response: nil)
|
7
|
+
@data = data
|
8
|
+
@data = response.parsed_response if @data.nil? && response && response.ok?
|
9
|
+
@data ||= {}
|
10
|
+
@response = response
|
11
|
+
end
|
12
|
+
|
13
|
+
def do_not_contact
|
14
|
+
@data['doNotContact']
|
15
|
+
end
|
16
|
+
|
17
|
+
def contact
|
18
|
+
@data['contact']
|
19
|
+
end
|
20
|
+
|
21
|
+
def ok?
|
22
|
+
@response&.ok?
|
23
|
+
end
|
24
|
+
|
25
|
+
def errors?
|
26
|
+
!@data['errors'].nil? && !@data['errors'].empty?
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/luma/patient.rb
CHANGED
@@ -19,5 +19,15 @@ module Luma
|
|
19
19
|
|
20
20
|
self.class.send(verb.to_s, endpoint, body: @body, headers: @headers)
|
21
21
|
end
|
22
|
+
|
23
|
+
def get_patient(identifier:, endpoint: PATIENT_ENDPOINT, headers: {}, auth: true, verb: :get, debug_output: $stdout)
|
24
|
+
self.add_headers_and_body if auth
|
25
|
+
|
26
|
+
endpoint = "#{endpoint}/#{identifier}"
|
27
|
+
|
28
|
+
response = self.class.send(verb.to_s, endpoint, headers: @headers)
|
29
|
+
|
30
|
+
Luma::Models::PatientResponse.new(response: response)
|
31
|
+
end
|
22
32
|
end
|
23
33
|
end
|
data/lib/luma/version.rb
CHANGED
data/lib/luma.rb
CHANGED
@@ -10,6 +10,7 @@ require 'luma/facilities'
|
|
10
10
|
require 'luma/patient'
|
11
11
|
require 'luma/models/contact'
|
12
12
|
require 'luma/models/date_of_birth'
|
13
|
+
require 'luma/models/patient_response'
|
13
14
|
require 'luma/models/patient'
|
14
15
|
require 'luma/appointment'
|
15
16
|
require 'luma/models/appointment'
|
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.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Angela Rodriguez
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -142,7 +142,7 @@ dependencies:
|
|
142
142
|
- - ">="
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
|
-
description:
|
145
|
+
description:
|
146
146
|
email:
|
147
147
|
- angela.rodriguez@weinfuse.com
|
148
148
|
executables: []
|
@@ -165,6 +165,7 @@ files:
|
|
165
165
|
- lib/luma/models/contact.rb
|
166
166
|
- lib/luma/models/date_of_birth.rb
|
167
167
|
- lib/luma/models/patient.rb
|
168
|
+
- lib/luma/models/patient_response.rb
|
168
169
|
- lib/luma/patient.rb
|
169
170
|
- lib/luma/provider.rb
|
170
171
|
- lib/luma/version.rb
|
@@ -174,7 +175,7 @@ licenses:
|
|
174
175
|
- MIT
|
175
176
|
metadata:
|
176
177
|
allowed_push_host: https://rubygems.org
|
177
|
-
post_install_message:
|
178
|
+
post_install_message:
|
178
179
|
rdoc_options: []
|
179
180
|
require_paths:
|
180
181
|
- lib
|
@@ -190,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
191
|
version: '0'
|
191
192
|
requirements: []
|
192
193
|
rubygems_version: 3.1.4
|
193
|
-
signing_key:
|
194
|
+
signing_key:
|
194
195
|
specification_version: 4
|
195
196
|
summary: Ruby wrapper for the Luma Health API
|
196
197
|
test_files: []
|