change_health 4.13.0 → 4.14.0

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: 369372608bc547068695c882655d21b9d249a00eaa51a912b7ba0c6159f6628f
4
- data.tar.gz: ece346e7ee7c13b3a1ef2f69c225a9e0fbde53dec4d94e196d329ffaf1efde09
3
+ metadata.gz: ad7028df0b8a556723c941162273ae8a9fda1c83a01dcc41939678afd631290f
4
+ data.tar.gz: ae98a767647dd4ec1ec9803a547dee055c31336ef2f16829f59e23763c34c965
5
5
  SHA512:
6
- metadata.gz: 4ced59a268373fad1839bf5d7d40da3dc1f923182c75209a3e6301e031af87f05d40582e86f795c72d58948d2ec2df89882953f2068fcd1bd054dbc7f11dc197
7
- data.tar.gz: 06a39794c53381304bdce97210e939b6fdbc6054e093d36f75f5a8f03b3fa7cf1ca21d88c5afbf37bb34d029561cc5aebe086c2433618ebb62b0fc94016a7c2f
6
+ metadata.gz: a8cecec460c7308627ea61d7f83ad6822a2e9f72ac2259c32083f6895409c5817c989ba0ec644fc01cebaf80009b9542600c1eafa26c92743098fd337d5dc01c
7
+ data.tar.gz: 81fa3d7abb6763b96c6f3f2752d9cf93d2332d09994260cae131c0601640bf778eb1be7c9258d114af17f11f00cf4bcef4c42d099fa7d927bf2cc099f748ce39
data/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ 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
+ # [4.14.0] - 2023-08-24
9
+
10
+ ### Added
11
+
12
+ * ChangeHealth::Models::Claim::ClaimDateInformation
13
+
14
+ ### Deprecated
15
+
16
+ * ChangeHealth::Models::DATE_FORMATTER -> ChangeHealth::Models.date_formatter
17
+
18
+ # [4.13.1] - 2023-08-23
19
+
20
+ ### Fixed
21
+
22
+ Added institional claim submission specific headers so that institutional claims that required headers will go through in production
23
+
8
24
  # [4.13.0] - 2023-08-11
9
25
 
10
26
  ### Added
@@ -519,6 +535,8 @@ Added the ability to hit professional claim submission API. For more details, se
519
535
  * Authentication
520
536
  * Configuration
521
537
 
538
+ [4.14.0]: https://github.com/WeInfuse/change_health/compare/v4.13.1...v4.14.0
539
+ [4.13.1]: https://github.com/WeInfuse/change_health/compare/v4.13.0...v4.13.1
522
540
  [4.13.0]: https://github.com/WeInfuse/change_health/compare/v4.12.0...v4.13.0
523
541
  [4.12.0]: https://github.com/WeInfuse/change_health/compare/v4.11.0...v4.12.0
524
542
  [4.11.0]: https://github.com/WeInfuse/change_health/compare/v4.10.1...v4.11.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
@@ -36,17 +36,25 @@ module ChangeHealth
36
36
  def submission(is_professional: true)
37
37
  endpoint = is_professional ? PROFESSIONAL_ENDPOINT : INSTITUTIONAL_ENDPOINT
38
38
  endpoint += SUBMISSION_SUFFIX
39
- ChangeHealth::Response::Claim::SubmissionData.new(response: ChangeHealth::Connection.new.request(
40
- endpoint: endpoint, body: to_h, headers: professional_headers
41
- ))
39
+ ChangeHealth::Response::Claim::SubmissionData.new(
40
+ response: ChangeHealth::Connection.new.request(
41
+ endpoint: endpoint,
42
+ body: to_h,
43
+ headers: is_professional ? professional_headers : institutional_headers
44
+ )
45
+ )
42
46
  end
43
47
 
44
48
  def validation(is_professional: true)
45
49
  endpoint = is_professional ? PROFESSIONAL_ENDPOINT : INSTITUTIONAL_ENDPOINT
46
50
  endpoint += VALIDATION_SUFFIX
47
- ChangeHealth::Response::Claim::SubmissionData.new(response: ChangeHealth::Connection.new.request(
48
- endpoint: endpoint, body: to_h, headers: professional_headers
49
- ))
51
+ ChangeHealth::Response::Claim::SubmissionData.new(
52
+ response: ChangeHealth::Connection.new.request(
53
+ endpoint: endpoint,
54
+ body: to_h,
55
+ headers: is_professional ? professional_headers : institutional_headers
56
+ )
57
+ )
50
58
  end
51
59
 
52
60
  def self.health_check(is_professional: true)
@@ -62,12 +70,23 @@ module ChangeHealth
62
70
  def professional_headers
63
71
  return unless self[:headers]
64
72
 
65
- extra_headers = {}
66
- extra_headers['X-CHC-ClaimSubmission-SubmitterId'] = self[:headers][:submitter_id]
67
- extra_headers['X-CHC-ClaimSubmission-BillerId'] = self[:headers][:biller_id]
68
- extra_headers['X-CHC-ClaimSubmission-Username'] = self[:headers][:username]
69
- extra_headers['X-CHC-ClaimSubmission-Pwd'] = self[:headers][:password]
70
- extra_headers
73
+ {
74
+ 'X-CHC-ClaimSubmission-BillerId' => self[:headers][:biller_id],
75
+ 'X-CHC-ClaimSubmission-Pwd' => self[:headers][:password],
76
+ 'X-CHC-ClaimSubmission-SubmitterId' => self[:headers][:submitter_id],
77
+ 'X-CHC-ClaimSubmission-Username' => self[:headers][:username]
78
+ }
79
+ end
80
+
81
+ def institutional_headers
82
+ return unless self[:headers]
83
+
84
+ {
85
+ 'X-CHC-InstitutionalClaims-BillerId' => self[:headers][:biller_id],
86
+ 'X-CHC-InstitutionalClaims-Pwd' => self[:headers][:password],
87
+ 'X-CHC-InstitutionalClaims-SubmitterId' => self[:headers][:submitter_id],
88
+ 'X-CHC-InstitutionalClaims-Username' => self[:headers][:username]
89
+ }
71
90
  end
72
91
  end
73
92
  end
@@ -1,3 +1,3 @@
1
1
  module ChangeHealth
2
- VERSION = '4.13.0'.freeze
2
+ VERSION = '4.14.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.0
4
+ version: 4.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Crockett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-14 00:00:00.000000000 Z
11
+ date: 2023-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -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