change_health 4.13.1 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cefa3385bd0fc12684684383de2de39c4e0ef4ff67972ba9c81d1bc7a8345a01
4
- data.tar.gz: 1c193080064802e59829060d926cdf3fd144d8db81699d48637138dc124acbdd
3
+ metadata.gz: 3cbaca8f7e482861192f0e0a7daa78bc124394839a92af7e8dc2a96b3f9f671e
4
+ data.tar.gz: 67661d3425dd13d95dfa718a274296b991b545f4014670116874718312d9a06a
5
5
  SHA512:
6
- metadata.gz: '08bee260e0a46761bf3dc1d25242613397a1128bd3015659aa31adc116e553699412aec0c539f92e3b87afacca3c4e66a173deebd260bfd8d3ae1886a092d1de'
7
- data.tar.gz: 6404f63ab7ccd33e3ec8d5009ecb086b8e06abc1c5d3d55a4687baa85c126e95474a1641b3c0656af7cee549d71ff8def2d8e160166624055a2f70858b4be7b1
6
+ metadata.gz: 1efdce11cbf9bf405c50e28d951b9a2490037604c55c177b5e8a50095cf67ccacf49a76791c661941b75f1ac153b71faffd8a3eab7cd7bca66847af7d025ca80
7
+ data.tar.gz: b81ad2344d269195e7fc92c33206126b03dfab3e871f081efc090ebf05143b257d5bb59be85f4efedc9ad8cf06c9a12d4b52c4c56083c66be08615069c032a89
data/CHANGELOG.md CHANGED
@@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
7
 
8
+ # [5.0.0] - 2022-08-24
9
+
10
+ ### Changed
11
+
12
+ Endpoint for trading_partner request has changed.
13
+
14
+ * **breaking:** removed medical_eligibility_enabled from trading_partners_data
15
+ * **breaking:** removed medical_eligibility_service_id from trading_partner_data
16
+ * **breaking:** removed medical_eligibility_service from trading_partner_data
17
+ * **breaking:** removed services from trading_partner_data
18
+ * updated endpoint on trading_partner
19
+ * updated params on trading_partner to only return Eligibility service types
20
+ * updated mapping on trading_partner_data for new response from endpoint
21
+ * updated tests
22
+
23
+
24
+ # [4.14.0] - 2023-08-24
25
+
26
+ ### Added
27
+
28
+ * ChangeHealth::Models::Claim::ClaimDateInformation
29
+
30
+ ### Deprecated
31
+
32
+ * ChangeHealth::Models::DATE_FORMATTER -> ChangeHealth::Models.date_formatter
33
+
8
34
  # [4.13.1] - 2023-08-23
9
35
 
10
36
  ### Fixed
@@ -525,6 +551,8 @@ Added the ability to hit professional claim submission API. For more details, se
525
551
  * Authentication
526
552
  * Configuration
527
553
 
554
+ [5.0.0]: https://github.com/WeInfuse/change_health/compare/v4.14.0...v5.0.0
555
+ [4.14.0]: https://github.com/WeInfuse/change_health/compare/v4.13.1...v4.14.0
528
556
  [4.13.1]: https://github.com/WeInfuse/change_health/compare/v4.13.0...v4.13.1
529
557
  [4.13.0]: https://github.com/WeInfuse/change_health/compare/v4.12.0...v4.13.0
530
558
  [4.12.0]: https://github.com/WeInfuse/change_health/compare/v4.11.0...v4.12.0
@@ -0,0 +1,13 @@
1
+ module ChangeHealth
2
+ module Models
3
+ module Claim
4
+ class ClaimDateInformation < Model
5
+ property :admissionDateAndHour, from: :admission_date_and_hour
6
+ property :dischargeHour, from: :discharge_hour
7
+ property :repricerReceivedDate, from: :repricer_received_date
8
+ property :statementBeginDate, from: :statement_begin_date
9
+ property :statementEndDate, from: :statement_end_date
10
+ end
11
+ end
12
+ end
13
+ end
@@ -6,6 +6,7 @@ module ChangeHealth
6
6
  property :benefitsAssignmentCertificationIndicator, from: :benefits_assignment_certification_indicator
7
7
  property :claimChargeAmount, from: :claim_charge_amount
8
8
  property :claimCodeInformation, from: :claim_code_information
9
+ property :claimDateInformation, from: :claim_date_information
9
10
  property :claimFilingCode, from: :claim_filing_code
10
11
  property :claimFrequencyCode, from: :claim_frequency_code
11
12
  property :claimNote, from: :claim_note
@@ -1,16 +1,36 @@
1
1
  module ChangeHealth
2
2
  module Models
3
- DATE_FORMAT = '%Y%m%d'
4
- DATE_FORMATTER = lambda { |d|
3
+ DATE_FORMAT = '%Y%m%d'.freeze
4
+ DATE_HOUR_FORMAT = '%Y%m%d%H%M'.freeze
5
+ HOUR_FORMAT = '%H%M'.freeze
6
+
7
+ # Deprecated should use date_formatter instead
8
+ DATE_FORMATTER = lambda { |date|
9
+ time_formatter(date, DATE_FORMAT)
10
+ }
11
+
12
+ def self.date_formatter(date)
13
+ time_formatter(date, DATE_FORMAT)
14
+ end
15
+
16
+ def self.date_hour_formatter(date_hour)
17
+ time_formatter(date_hour, DATE_HOUR_FORMAT)
18
+ end
19
+
20
+ def self.hour_formatter(hour)
21
+ time_formatter(hour, HOUR_FORMAT)
22
+ end
23
+
24
+ def self.time_formatter(time, format)
5
25
  begin
6
- d = Date.parse(d) if d.is_a?(String)
26
+ time = Time.parse(time) if time.is_a?(String)
7
27
  rescue ArgumentError
8
28
  end
9
29
 
10
- d = d.strftime(ChangeHealth::Models::DATE_FORMAT) if d.respond_to?(:strftime)
30
+ time = time.strftime(format) if time.respond_to?(:strftime)
11
31
 
12
- d
13
- }
32
+ time
33
+ end
14
34
 
15
35
  PARSE_DATE = lambda { |d|
16
36
  begin
@@ -59,7 +79,12 @@ module ChangeHealth
59
79
  def self.format_value(key, value)
60
80
  return nil if value == ''
61
81
 
62
- return ChangeHealth::Models::DATE_FORMATTER.call(value) if key.to_s.downcase.include?('date')
82
+ return ChangeHealth::Models.date_hour_formatter(value) if key.to_s.downcase.include?('dateandhour')
83
+
84
+ return ChangeHealth::Models.hour_formatter(value) if key.to_s.downcase.include?('hour')
85
+
86
+ return ChangeHealth::Models.date_formatter(value) if key.to_s.downcase.include?('date')
87
+
63
88
  return ChangeHealth::Models::POSTAL_CODE_FORMATTER.call(value) if key.to_s.downcase.include?('postalcode')
64
89
 
65
90
  value
@@ -1,17 +1,17 @@
1
1
  module ChangeHealth
2
2
  module Request
3
3
  class TradingPartner < Hashie::Trash
4
- ENDPOINT = '/tradingpartners/v7/partners'.freeze
4
+ ENDPOINT = '/medicalnetwork/payerfinder/v1/payers'.freeze
5
5
 
6
6
  def self.query(term)
7
7
  params = {
8
- query: term,
9
- serviceName: 'medicalEligibility',
10
- strictFilters: true
8
+ businessName: term,
9
+ serviceName: 'Eligibility'
11
10
  }
11
+
12
12
  response = ChangeHealth::Connection.new.request(endpoint: ENDPOINT, verb: :get, query: params)
13
- trading_partners_data = ChangeHealth::Response::TradingPartnersData.new(response).medical_eligibility_enabled
14
- trading_partners_data.map {|partner| ChangeHealth::Models::TradingPartner.new(name: partner.name, service_id: partner.medical_eligibility_service_id) }
13
+ trading_partners_data = ChangeHealth::Response::TradingPartnersData.new(response['payers'])
14
+ trading_partners_data.map { |partner| ChangeHealth::Models::TradingPartner.new(name: partner.name, service_id: partner.service_id) }
15
15
  end
16
16
  end
17
17
  end
@@ -6,21 +6,15 @@ module ChangeHealth
6
6
  end
7
7
 
8
8
  def name
9
- @raw.dig('tradingPartnerName')
9
+ @raw['businessName']
10
10
  end
11
11
 
12
- def services
13
- @raw.dig('clearingHouses', 'legacyExchange')
12
+ def service_id
13
+ @raw['serviceId']
14
14
  end
15
15
 
16
- def medical_eligibility_service
17
- return nil unless services
18
- services.detect {|service| service.dig('serviceName') == 'medicalEligibility' }
19
- end
20
-
21
- def medical_eligibility_service_id
22
- return nil unless medical_eligibility_service
23
- medical_eligibility_service.dig('serviceConnections', 'direct', 'serviceId')
16
+ def service_name
17
+ @raw['serviceName']
24
18
  end
25
19
  end
26
20
  end
@@ -2,11 +2,7 @@ module ChangeHealth
2
2
  module Response
3
3
  class TradingPartnersData < Array
4
4
  def initialize(trading_partners)
5
- super(trading_partners.map {|trading_partner| ChangeHealth::Response::TradingPartnerData.new(trading_partner) })
6
- end
7
-
8
- def medical_eligibility_enabled
9
- self.reject {|partner| nil == partner.medical_eligibility_service_id }
5
+ super(trading_partners.map { |trading_partner| ChangeHealth::Response::TradingPartnerData.new(trading_partner) })
10
6
  end
11
7
  end
12
8
  end
@@ -1,3 +1,3 @@
1
1
  module ChangeHealth
2
- VERSION = '4.13.1'.freeze
2
+ VERSION = '5.0.0'.freeze
3
3
  end
data/lib/change_health.rb CHANGED
@@ -8,6 +8,7 @@ require 'change_health/extensions'
8
8
  require 'change_health/models/model'
9
9
  require 'change_health/models/claim/submission/address'
10
10
  require 'change_health/models/claim/submission/claim_code_information'
11
+ require 'change_health/models/claim/submission/claim_date_information'
11
12
  require 'change_health/models/claim/submission/claim_information'
12
13
  require 'change_health/models/claim/submission/claim_supplemental_information'
13
14
  require 'change_health/models/claim/submission/contact_information'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: change_health
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.13.1
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Crockett
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-23 00:00:00.000000000 Z
11
+ date: 2023-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -128,7 +128,7 @@ dependencies:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0.9'
131
- description:
131
+ description:
132
132
  email:
133
133
  - mike.crockett@weinfuse.com
134
134
  executables: []
@@ -149,6 +149,7 @@ files:
149
149
  - lib/change_health/extensions.rb
150
150
  - lib/change_health/models/claim/submission/address.rb
151
151
  - lib/change_health/models/claim/submission/claim_code_information.rb
152
+ - lib/change_health/models/claim/submission/claim_date_information.rb
152
153
  - lib/change_health/models/claim/submission/claim_information.rb
153
154
  - lib/change_health/models/claim/submission/claim_supplemental_information.rb
154
155
  - lib/change_health/models/claim/submission/contact_information.rb
@@ -204,7 +205,7 @@ licenses:
204
205
  - MIT
205
206
  metadata:
206
207
  allowed_push_host: https://rubygems.org
207
- post_install_message:
208
+ post_install_message:
208
209
  rdoc_options: []
209
210
  require_paths:
210
211
  - lib
@@ -219,8 +220,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
220
  - !ruby/object:Gem::Version
220
221
  version: '0'
221
222
  requirements: []
222
- rubygems_version: 3.1.6
223
- signing_key:
223
+ rubygems_version: 3.4.10
224
+ signing_key:
224
225
  specification_version: 4
225
226
  summary: Ruby wrapper for the ChangeHealth API
226
227
  test_files: []