redox 1.4.0 → 1.6.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2c926b510dc2e56b85369003ee89caf82292929308a18775df049e4a57e1d95
4
- data.tar.gz: 9799c173cb24daa74f3dfe02eefb3f8c2a456557dafa819fb7ca2760621a3b4e
3
+ metadata.gz: afc5e51c1e217d2d7571729c5ed5c0a6e97e1d3903c00d6ca2b8e83be2399df6
4
+ data.tar.gz: 1c6d2b0de046b1c2d9b9724fdd0679d5217d1bc955015fa473203d6c0d82e1dc
5
5
  SHA512:
6
- metadata.gz: 1499bf55b2c53f0a0dafc2d68d3b420bc5a0a0760d4258103360d32526b32e4f418a59fddb50afb3feb80ac45a979045b943018d24a717129e7db072c7233faf
7
- data.tar.gz: 2b2eeebee1f5a35c028cee6c77f582e0dff10734cec40ce620fdc02617c01daf42f73d62e4960ec7a7b77ed4290f733c3fb0ce46f408566f826fa86f1d71a970
6
+ metadata.gz: 621a51db8bd3fe0a420ad1b156c57ae3b54a520be56f8066465b2c71f58925d03e0014ad62f8fd9a0583c1efc8b89d0c61706a5be5b05c21480c02b902ff89c6
7
+ data.tar.gz: 5e07da2adc3fea279fc2019d0d0c12a86def95f7bb4b966a637bbb2b5d4b68d710cd6f623ddecf6e0034489f5e33a9128cad7a806c1a9bcf34c586a43c769e61
data/CHANGELOG.md CHANGED
@@ -4,6 +4,43 @@ 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
+ ## [1.6.1] - 2021-03-12
8
+ ### Added
9
+ - Media model file helper to base64 files under 200KB
10
+ - Media model available= sets to valid Redox values with true/false
11
+ - Medai model provider entry
12
+
13
+ ## [1.6.0] - 2021-02-04
14
+ ### Added
15
+ - Media model
16
+ - MediaUpdate Model
17
+ - Media#create
18
+ - Visit#CancelReason
19
+ - Visit#DischargeDateTime
20
+
21
+ ## [1.5.2] - 2021-01-08
22
+ ### Added
23
+ - Visit#Type
24
+ - Visit#Status
25
+ - Visit#Reason
26
+ - Visit#Equipment
27
+
28
+ ## [1.5.1] - 2020-12-22
29
+ ### Added
30
+ - Contacts model
31
+ - Patient#contacts
32
+
33
+ ### Changed
34
+ - typo of martialstatus is now maritalstatus for Demographics model
35
+
36
+ ## [1.5.0] - 2020-12-15
37
+ ### Added
38
+ - Scheduling model
39
+ - Scheduling#create
40
+ - Scheduling#cancel
41
+ - Scheduling#reschedule
42
+ - Scheduling#modification
43
+
7
44
  ## [1.4.0] - 2020-10-13
8
45
  ### Added
9
46
  - AbstractModel that does not add top level key
@@ -18,12 +55,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
18
55
  - Visit#as\_json
19
56
 
20
57
  ## [1.3.0] - 2020-09-17
21
- ### Added
58
+ ### Added
22
59
  - Transaction model
23
60
  - Financial#create
24
61
 
25
62
  ## [1.2.0] - 2020-07-30
26
- ### Added
63
+ ### Added
27
64
  - Visit model
28
65
  - Model#insurances helper for Patient.Insurances || Visit.Insurances
29
66
 
@@ -36,7 +73,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
36
73
  - Moving to Requst classes instead of mixing in logic to models (kept backwards compatibility)
37
74
  - Added potential matches to responses and implemented for patient search
38
75
 
39
- =======
40
76
  ### Added
41
77
  - PotentialMatches class
42
78
 
@@ -121,6 +157,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
121
157
  ### Added
122
158
  - Initial Release
123
159
 
160
+ [1.6.1]: https://github.com/WeInfuse/redox/compare/v1.6.0...v1.6.1
161
+ [1.6.0]: https://github.com/WeInfuse/redox/compare/v1.5.2...v1.6.0
162
+ [1.5.2]: https://github.com/WeInfuse/redox/compare/v1.5.1...v1.5.2
163
+ [1.5.1]: https://github.com/WeInfuse/redox/compare/v1.5.0...v1.5.1
164
+ [1.5.0]: https://github.com/WeInfuse/redox/compare/v1.4.0...v1.5.0
124
165
  [1.4.0]: https://github.com/WeInfuse/redox/compare/v1.3.1...v1.4.0
125
166
  [1.3.1]: https://github.com/WeInfuse/redox/compare/v1.3.0...v1.3.1
126
167
  [1.3.0]: https://github.com/WeInfuse/redox/compare/v1.2.0...v1.3.0
data/lib/redox.rb CHANGED
@@ -12,16 +12,22 @@ require 'redox/models/provider'
12
12
  require 'redox/models/visit'
13
13
  require 'redox/models/transaction'
14
14
  require 'redox/models/financial'
15
+ require 'redox/models/media'
16
+ require 'redox/models/media_upload'
15
17
  require 'redox/models/patient/demographics'
18
+ require 'redox/models/patient/contacts'
16
19
  require 'redox/models/patient/identifier'
17
20
  require 'redox/models/patient/insurance'
18
21
  require 'redox/models/patient/p_c_p'
19
22
  require 'redox/models/potential_matches'
23
+ require 'redox/models/scheduling'
20
24
  require 'redox/request/request'
21
25
  require 'redox/request/financial'
22
26
  require 'redox/request/patient_admin'
23
27
  require 'redox/request/patient_search'
24
28
  require 'redox/request/provider'
29
+ require 'redox/request/scheduling'
30
+ require 'redox/request/media'
25
31
 
26
32
  module Redox
27
33
  class Configuration
@@ -0,0 +1,44 @@
1
+ module Redox
2
+ module Models
3
+ class Media < AbstractModel
4
+ BLOB_REQUIRED_SIZE = 200 * 1024
5
+
6
+ property :FileType, from: :file_type, required: false
7
+ property :FileName, from: :file_name, required: false
8
+ property :FileContents, from: :file_contents, required: false
9
+ property :DocumentType, from: :document_type, required: false
10
+ property :DocumentID, from: :document_id, required: false
11
+ property :Availability, from: :availability, required: false
12
+ property :Provider, from: :provider, required: false
13
+
14
+ alias_method :file_type, :FileType
15
+ alias_method :file_name, :FileName
16
+ alias_method :file_contents, :FileContents
17
+ alias_method :document_type, :DocumentType
18
+ alias_method :document_id, :DocumentID
19
+ alias_method :availability, :Availability
20
+ alias_method :provider, :Provider
21
+
22
+ def availability=(value)
23
+ case value
24
+ when true
25
+ self[:Availability] = 'Available'
26
+ when false
27
+ self[:Availability] = 'Unavailable'
28
+ else
29
+ self[:Availability] = value
30
+ end
31
+ end
32
+
33
+ def add_filepath(path)
34
+ if File.size(path) > BLOB_REQUIRED_SIZE
35
+ raise 'Not implemented'
36
+ else
37
+ self.file_contents = Base64::encode64(File.read(path))
38
+ self.file_type = "#{File.extname(path)}".delete_prefix('.').upcase
39
+ self.file_name = File.basename(path, '.*')
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,13 @@
1
+ module Redox
2
+ module Models
3
+ class MediaUpload < AbstractModel
4
+ property :Patient, required: false, from: :patient, default: Redox::Models::Patient.new
5
+ property :Visit, required: false, from: :visit, default: Redox::Models::Visit.new
6
+ property :Media, required: false, from: :media, default: Redox::Models::Media.new
7
+
8
+ alias_method :patient, :Patient
9
+ alias_method :visit, :Visit
10
+ alias_method :media, :Media
11
+ end
12
+ end
13
+ end
@@ -4,10 +4,12 @@ module Redox
4
4
  property :Identifiers, from: :identifiers, required: false, default: []
5
5
  property :Insurances, from: :insurances, required: false, default: []
6
6
  property :Demographics, from: :demographics, required: false
7
+ property :Contacts, from: :contacts, required: false, default: []
7
8
  property :PCP, from: :primary_care_provider, required: false
8
9
 
9
10
  alias_method :identifiers, :Identifiers
10
11
  alias_method :insurances, :Insurances
12
+ alias_method :contacts, :Contacts
11
13
 
12
14
  def demographics
13
15
  self[:Demographics] = Demographics.new(self[:Demographics]) unless self[:Demographics].is_a?(Redox::Models::Demographics)
@@ -22,6 +24,10 @@ module Redox
22
24
  self[:PCP] ||= PCP.new
23
25
  end
24
26
 
27
+ def contacts
28
+ self[:Contacts] = self[:Contacts].map {|contact| contact.is_a?(Redox::Models::Contact) ? contact : Contact.new(contact)}
29
+ end
30
+
25
31
  def add_identifier(type: , value: )
26
32
  self[:Identifiers] << Identifier.new({'ID' => value, 'IDType' => type})
27
33
 
@@ -0,0 +1,20 @@
1
+ module Redox
2
+ module Models
3
+ class Contact < AbstractModel
4
+ property :FirstName, required: false, from: :first_name
5
+ property :MiddleName, required: false, from: :middle_name
6
+ property :LastName, required: false, from: :last_name
7
+ property :RelationToPatient, required: false
8
+ property :EmailAddresses, required: false, default: []
9
+ property :Address, required: false, default: {}
10
+ property :PhoneNumber, required: false, default: {}
11
+ property :Roles, required: false, default: []
12
+
13
+ alias_method :first_name, :FirstName
14
+ alias_method :middle_name, :MiddleName
15
+ alias_method :last_name, :LastName
16
+ alias_method :address, :Address
17
+ alias_method :phone_number, :PhoneNumber
18
+ end
19
+ end
20
+ end
@@ -9,7 +9,7 @@ module Redox
9
9
  property :Sex, required: false, from: :sex
10
10
  property :Race, required: false, from: :race
11
11
  property :IsHispanic, required: false
12
- property :MaritalStatus, required: false, from: :martial_status
12
+ property :MaritalStatus, required: false, from: :marital_status
13
13
  property :IsDeceased, required: false
14
14
  property :DeathDateTime, required: false
15
15
  property :Language, required: false, from: :language
@@ -25,7 +25,7 @@ module Redox
25
25
  alias_method :ssn, :SSN
26
26
  alias_method :sex, :Sex
27
27
  alias_method :race, :Race
28
- alias_method :martial_status, :MaritalStatus
28
+ alias_method :marital_status, :MaritalStatus
29
29
  alias_method :language, :Language
30
30
  alias_method :address, :Address
31
31
  alias_method :phone_number, :PhoneNumber
@@ -0,0 +1,24 @@
1
+ module Redox
2
+ module Models
3
+ class Scheduling < AbstractModel
4
+ property :Visit, required: false, from: :visit, default: Redox::Models::Visit.new
5
+ property :Patient, required: false, from: :patient, default: Redox::Models::Patient.new
6
+ property :AppointmentInfo, required: false, from: :appointment_info, default: []
7
+
8
+ alias_method :patient, :Patient
9
+ alias_method :visit, :Visit
10
+ alias_method :appointment_info, :AppointmentInfo
11
+
12
+ def add_appointment_info(code: nil, codeset: nil, description: nil, value: nil)
13
+ self[:AppointmentInfo] << {
14
+ Code: code,
15
+ Codeset: codeset,
16
+ Description: description,
17
+ Value: value
18
+ }
19
+
20
+ self
21
+ end
22
+ end
23
+ end
24
+ end
@@ -9,11 +9,19 @@ module Redox
9
9
  property :Insurances, from: :insurances, required: false, default: []
10
10
  property :Location, from: :location, required: false, default: DEFAULT_LOCATION
11
11
  property :VisitDateTime, from: :start, required: false
12
+ property :Duration, from: :duration, required: false
12
13
  property :VisitNumber, from: :visit_number, required: false
13
14
  property :AccountNumber, from: :account_number, required: false
15
+ property :Status, from: :status, required: false
16
+ property :Type, from: :type, required: false
17
+ property :Reason, from: :reason, required: false
18
+ property :Equipment, from: :equipment, required: false
19
+ property :CancelReason, from: :cancel_reason, required: false
20
+ property :DischargeDateTime, from: :end, required: false
14
21
 
15
22
  alias_method :insurances, :Insurances
16
23
  alias_method :start, :VisitDateTime
24
+ alias_method :end, :DischargeDateTime
17
25
 
18
26
  def department=(v)
19
27
  self[:Location] ||= DEFAULT_LOCATION
@@ -27,6 +35,12 @@ module Redox
27
35
  self
28
36
  end
29
37
 
38
+ def add_equipment(description: nil, code: nil)
39
+ self[:Equipment] ||= []
40
+ self[:Equipment] << { Description: description, Code: code }
41
+ self
42
+ end
43
+
30
44
  def insurances
31
45
  self[:Insurances] = self[:Insurances].map {|ins| ins.is_a?(Redox::Models::Insurance) ? ins : Insurance.new(ins) }
32
46
  end
@@ -34,7 +48,7 @@ module Redox
34
48
  def to_h
35
49
  result = super.to_h
36
50
 
37
- %w[VisitDateTime].each do |k|
51
+ %w[VisitDateTime DischargeDateTime].each do |k|
38
52
  result[key][k] = Redox::Models.format_datetime(result[key][k])
39
53
  end
40
54
 
@@ -0,0 +1,12 @@
1
+ module Redox
2
+ module Request
3
+ class Media
4
+ CREATE_META = Redox::Models::Meta.new(EventType: 'New', DataModel: 'Media')
5
+
6
+ def self.create(model, meta: Redox::Models::Meta.new)
7
+ meta = CREATE_META.merge(meta)
8
+ return Redox::Models::Model.from_response((RedoxClient.connection.request(body: Redox::Request.build_body(model, meta))))
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,30 @@
1
+ module Redox
2
+ module Request
3
+ class Scheduling
4
+ CREATE_META = Redox::Models::Meta.new(EventType: 'New', DataModel: 'Scheduling')
5
+ CANCEL_META = Redox::Models::Meta.new(EventType: 'Cancel', DataModel: 'Scheduling')
6
+ RESCHEDULE_META = Redox::Models::Meta.new(EventType: 'Reschedule', DataModel: 'Scheduling')
7
+ MODIFICATION_META = Redox::Models::Meta.new(EventType: 'Modification', DataModel: 'Scheduling')
8
+
9
+ def self.create(model, meta: Redox::Models::Meta.new)
10
+ meta = CREATE_META.merge(meta)
11
+ return Redox::Models::Model.from_response((RedoxClient.connection.request(body: Redox::Request.build_body(model, meta))))
12
+ end
13
+
14
+ def self.cancel(model, meta: Redox::Models::Meta.new)
15
+ meta = CANCEL_META.merge(meta)
16
+ return Redox::Models::Model.from_response((RedoxClient.connection.request(body: Redox::Request.build_body(model, meta))))
17
+ end
18
+
19
+ def self.reschedule(model, meta: Redox::Models::Meta.new)
20
+ meta = RESCHEDULE_META.merge(meta)
21
+ return Redox::Models::Model.from_response((RedoxClient.connection.request(body: Redox::Request.build_body(model, meta))))
22
+ end
23
+
24
+ def self.modification(model, meta: Redox::Models::Meta.new)
25
+ meta = MODIFICATION_META.merge(meta)
26
+ return Redox::Models::Model.from_response((RedoxClient.connection.request(body: Redox::Request.build_body(model, meta))))
27
+ end
28
+ end
29
+ end
30
+ end
data/lib/redox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Redox
2
- VERSION = '1.4.0'.freeze
2
+ VERSION = '1.6.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Clark
8
8
  - Mike Crockett
9
9
  - Mike Carr
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-10-13 00:00:00.000000000 Z
13
+ date: 2021-03-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -130,7 +130,7 @@ dependencies:
130
130
  - - "~>"
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0.9'
133
- description:
133
+ description:
134
134
  email:
135
135
  - alexander.clark@weinfuse.com
136
136
  - mike.crockett@weinfuse.com
@@ -148,24 +148,30 @@ files:
148
148
  - lib/redox/authentication.rb
149
149
  - lib/redox/connection.rb
150
150
  - lib/redox/models/financial.rb
151
+ - lib/redox/models/media.rb
152
+ - lib/redox/models/media_upload.rb
151
153
  - lib/redox/models/meta.rb
152
154
  - lib/redox/models/model.rb
153
155
  - lib/redox/models/ordering_provider.rb
154
156
  - lib/redox/models/patient.rb
157
+ - lib/redox/models/patient/contacts.rb
155
158
  - lib/redox/models/patient/demographics.rb
156
159
  - lib/redox/models/patient/identifier.rb
157
160
  - lib/redox/models/patient/insurance.rb
158
161
  - lib/redox/models/patient/p_c_p.rb
159
162
  - lib/redox/models/potential_matches.rb
160
163
  - lib/redox/models/provider.rb
164
+ - lib/redox/models/scheduling.rb
161
165
  - lib/redox/models/transaction.rb
162
166
  - lib/redox/models/visit.rb
163
167
  - lib/redox/redox_exception.rb
164
168
  - lib/redox/request/financial.rb
169
+ - lib/redox/request/media.rb
165
170
  - lib/redox/request/patient_admin.rb
166
171
  - lib/redox/request/patient_search.rb
167
172
  - lib/redox/request/provider.rb
168
173
  - lib/redox/request/request.rb
174
+ - lib/redox/request/scheduling.rb
169
175
  - lib/redox/version.rb
170
176
  - redox.gemspec
171
177
  homepage: https://github.com/WeInfuse/redox
@@ -173,7 +179,7 @@ licenses:
173
179
  - MIT
174
180
  metadata:
175
181
  allowed_push_host: https://rubygems.org
176
- post_install_message:
182
+ post_install_message:
177
183
  rdoc_options: []
178
184
  require_paths:
179
185
  - lib
@@ -188,9 +194,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
194
  - !ruby/object:Gem::Version
189
195
  version: '0'
190
196
  requirements: []
191
- rubyforge_project:
192
- rubygems_version: 2.7.6
193
- signing_key:
197
+ rubygems_version: 3.1.4
198
+ signing_key:
194
199
  specification_version: 4
195
200
  summary: Ruby wrapper for the Redox Engine API
196
201
  test_files: []