change_health 2.2.1 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +77 -22
- data/README.md +123 -47
- data/lib/change_health/connection.rb +4 -3
- data/lib/change_health/models/claim/submission/address.rb +13 -0
- data/lib/change_health/models/claim/submission/drug_identification.rb +12 -0
- data/lib/change_health/models/claim/submission/service_line.rb +2 -2
- data/lib/change_health/models/claim/submission/subscriber.rb +1 -0
- data/lib/change_health/models/model.rb +44 -16
- data/lib/change_health/request/report.rb +17 -9
- data/lib/change_health/request/submission.rb +11 -10
- data/lib/change_health/response/claim/report/report_277_claim.rb +40 -0
- data/lib/change_health/response/claim/report/report_277_data.rb +84 -0
- data/lib/change_health/response/claim/report/report_277_info_claim_status.rb +16 -0
- data/lib/change_health/response/claim/report/report_835_claim.rb +18 -0
- data/lib/change_health/response/claim/report/report_835_data.rb +134 -0
- data/lib/change_health/response/claim/report/report_835_health_care_check_remark_code.rb +11 -0
- data/lib/change_health/response/claim/report/report_835_service_adjustment.rb +15 -0
- data/lib/change_health/response/claim/report/report_835_service_line.rb +14 -0
- data/lib/change_health/response/claim/report/report_claim.rb +16 -0
- data/lib/change_health/{models → response}/error.rb +8 -7
- data/lib/change_health/response/response_data.rb +3 -3
- data/lib/change_health/version.rb +1 -1
- data/lib/change_health.rb +15 -4
- metadata +15 -5
@@ -14,18 +14,26 @@ module ChangeHealth
|
|
14
14
|
return if report_name.nil? || report_name.empty?
|
15
15
|
final_headers = ChangeHealth::Request::Claim::Report.report_headers(headers)
|
16
16
|
|
17
|
+
report_type = ChangeHealth::Response::Claim::ReportData.report_type(report_name)
|
18
|
+
return if report_type.nil?
|
19
|
+
|
17
20
|
individual_report_endpoint = ENDPOINT + '/' + report_name
|
18
|
-
if as_json_report
|
19
|
-
# https://developers.changehealthcare.com/eligibilityandclaims/docs/what-file-types-does-this-api-get-from-the-mailbox
|
20
|
-
report_type = ChangeHealth::Response::Claim::ReportData.report_type(report_name)
|
21
|
-
return if report_type.nil?
|
22
21
|
|
23
|
-
|
24
|
-
|
22
|
+
# https://developers.changehealthcare.com/eligibilityandclaims/docs/what-file-types-does-this-api-get-from-the-mailbox
|
23
|
+
individual_report_endpoint += '/' + report_type if as_json_report
|
25
24
|
|
26
|
-
ChangeHealth::
|
27
|
-
|
28
|
-
|
25
|
+
response = ChangeHealth::Connection.new.request(endpoint: individual_report_endpoint, verb: :get, headers: final_headers)
|
26
|
+
if ChangeHealth::Response::Claim::ReportData.is_277?(report_name)
|
27
|
+
ChangeHealth::Response::Claim::Report277Data
|
28
|
+
.new(report_name,
|
29
|
+
as_json_report,
|
30
|
+
response: response)
|
31
|
+
else
|
32
|
+
ChangeHealth::Response::Claim::Report835Data
|
33
|
+
.new(report_name,
|
34
|
+
as_json_report,
|
35
|
+
response: response)
|
36
|
+
end
|
29
37
|
end
|
30
38
|
|
31
39
|
def self.health_check
|
@@ -2,7 +2,6 @@ module ChangeHealth
|
|
2
2
|
module Request
|
3
3
|
module Claim
|
4
4
|
class Submission < Hashie::Trash
|
5
|
-
|
6
5
|
ENDPOINT = '/medicalnetwork/professionalclaims/v3'.freeze
|
7
6
|
HEALTH_CHECK_ENDPOINT = ENDPOINT + '/healthcheck'.freeze
|
8
7
|
SUBMISSION_ENDPOINT = ENDPOINT + '/submission'.freeze
|
@@ -25,11 +24,15 @@ module ChangeHealth
|
|
25
24
|
end
|
26
25
|
|
27
26
|
def submission
|
28
|
-
ChangeHealth::Response::Claim::SubmissionData.new(response: ChangeHealth::Connection.new.request(
|
27
|
+
ChangeHealth::Response::Claim::SubmissionData.new(response: ChangeHealth::Connection.new.request(
|
28
|
+
endpoint: SUBMISSION_ENDPOINT, body: to_h, headers: professional_headers
|
29
|
+
))
|
29
30
|
end
|
30
31
|
|
31
32
|
def validation
|
32
|
-
ChangeHealth::Response::Claim::SubmissionData.new(response: ChangeHealth::Connection.new.request(
|
33
|
+
ChangeHealth::Response::Claim::SubmissionData.new(response: ChangeHealth::Connection.new.request(
|
34
|
+
endpoint: VALIDATION_ENDPOINT, body: to_h, headers: professional_headers
|
35
|
+
))
|
33
36
|
end
|
34
37
|
|
35
38
|
def self.health_check
|
@@ -37,19 +40,17 @@ module ChangeHealth
|
|
37
40
|
end
|
38
41
|
|
39
42
|
def self.ping
|
40
|
-
|
43
|
+
health_check
|
41
44
|
end
|
42
45
|
|
43
46
|
def professional_headers
|
44
47
|
if self[:headers]
|
45
48
|
extra_headers = {}
|
46
|
-
extra_headers[
|
47
|
-
extra_headers[
|
48
|
-
extra_headers[
|
49
|
-
extra_headers[
|
49
|
+
extra_headers['X-CHC-ClaimSubmission-SubmitterId'] = self[:headers][:submitter_id]
|
50
|
+
extra_headers['X-CHC-ClaimSubmission-BillerId'] = self[:headers][:biller_id]
|
51
|
+
extra_headers['X-CHC-ClaimSubmission-Username'] = self[:headers][:username]
|
52
|
+
extra_headers['X-CHC-ClaimSubmission-Pwd'] = self[:headers][:password]
|
50
53
|
extra_headers
|
51
|
-
else
|
52
|
-
nil
|
53
54
|
end
|
54
55
|
end
|
55
56
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Response
|
3
|
+
module Claim
|
4
|
+
class Report277Claim < ReportClaim
|
5
|
+
property :info_claim_statuses, required: false
|
6
|
+
property :procedure_codes, required: false
|
7
|
+
|
8
|
+
def add_info_claim_status(info_claim_status)
|
9
|
+
self[:info_claim_statuses] ||= []
|
10
|
+
self[:info_claim_statuses] << info_claim_status
|
11
|
+
end
|
12
|
+
|
13
|
+
def add_procedure_code(procedure_code)
|
14
|
+
self[:procedure_codes] ||= []
|
15
|
+
self[:procedure_codes] << procedure_code
|
16
|
+
end
|
17
|
+
|
18
|
+
def latest_status_category_codes
|
19
|
+
latest_info_claim_status&.status_category_codes
|
20
|
+
end
|
21
|
+
|
22
|
+
def total_charge_amount
|
23
|
+
latest_info_claim_status&.total_charge_amount
|
24
|
+
end
|
25
|
+
|
26
|
+
def latest_status_info_effective_date
|
27
|
+
latest_info_claim_status&.status_information_effective_date
|
28
|
+
end
|
29
|
+
|
30
|
+
def latest_info_claim_status
|
31
|
+
info_claim_statuses&.select do |info|
|
32
|
+
!info.status_information_effective_date.nil? &&
|
33
|
+
info.status_information_effective_date.is_a?(Date) &&
|
34
|
+
info.status_information_effective_date <= Date.today
|
35
|
+
end&.max_by(&:status_information_effective_date)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Response
|
3
|
+
module Claim
|
4
|
+
# Methods only return meaningful data for json reports
|
5
|
+
class Report277Data < ChangeHealth::Response::Claim::ReportData
|
6
|
+
def transactions
|
7
|
+
@raw['transactions']
|
8
|
+
end
|
9
|
+
|
10
|
+
# Only one payer per report
|
11
|
+
def payer_name
|
12
|
+
transactions&.first&.dig('payers')&.first&.dig('organizationName')
|
13
|
+
end
|
14
|
+
|
15
|
+
def report_creation_date
|
16
|
+
ChangeHealth::Models::PARSE_DATE.call(transactions&.first&.dig('transactionSetCreationDate'))
|
17
|
+
end
|
18
|
+
|
19
|
+
def claims
|
20
|
+
report_claims = []
|
21
|
+
|
22
|
+
transactions&.each do |transaction|
|
23
|
+
report_creation_date = ChangeHealth::Models::PARSE_DATE.call(transaction['transactionSetCreationDate'])
|
24
|
+
transaction['payers']&.each do |payer|
|
25
|
+
payer_identification = payer['payerIdentification']
|
26
|
+
payer_name = payer['organizationName']
|
27
|
+
payer['claimStatusTransactions']&.each do |claim_status_txn|
|
28
|
+
claim_status_txn['claimStatusDetails']&.each do |claim_status_detail|
|
29
|
+
service_provider_npi = claim_status_detail.dig('serviceProvider', 'npi')
|
30
|
+
claim_status_detail['patientClaimStatusDetails']&.each do |patient_claim_status_detail|
|
31
|
+
patient_first_name = patient_claim_status_detail.dig('subscriber', 'firstName')
|
32
|
+
patient_last_name = patient_claim_status_detail.dig('subscriber', 'lastName')
|
33
|
+
patient_claim_status_detail['claims']&.each do |claim|
|
34
|
+
procedure_codes = []
|
35
|
+
claim['serviceLines']&.each do |service_line|
|
36
|
+
procedure_codes << service_line.dig('service', 'procedureCode')
|
37
|
+
end
|
38
|
+
claim_status = claim['claimStatus']
|
39
|
+
next if claim_status.nil?
|
40
|
+
|
41
|
+
service_date_begin = ChangeHealth::Models::PARSE_DATE.call(claim_status['claimServiceBeginDate'] || claim_status['claimServiceDate'])
|
42
|
+
service_date_end = ChangeHealth::Models::PARSE_DATE.call(claim_status['claimServiceEndDate'] || claim_status['claimServiceDate'])
|
43
|
+
|
44
|
+
info_claim_statuses = []
|
45
|
+
claim_status['informationClaimStatuses']&.each do |info_claim_status|
|
46
|
+
status_information_effective_date = ChangeHealth::Models::PARSE_DATE.call(info_claim_status['statusInformationEffectiveDate'])
|
47
|
+
total_charge_amount = info_claim_status['totalClaimChargeAmount']
|
48
|
+
|
49
|
+
status_category_codes = []
|
50
|
+
info_claim_status['informationStatuses']&.each do |info_status|
|
51
|
+
status_category_codes << info_status['healthCareClaimStatusCategoryCode']
|
52
|
+
end
|
53
|
+
|
54
|
+
info_claim_statuses << Report277InfoClaimStatus.new(
|
55
|
+
status_category_codes: status_category_codes,
|
56
|
+
total_charge_amount: total_charge_amount,
|
57
|
+
status_information_effective_date: status_information_effective_date
|
58
|
+
)
|
59
|
+
end
|
60
|
+
report_claims << Report277Claim.new(
|
61
|
+
info_claim_statuses: info_claim_statuses,
|
62
|
+
patient_first_name: patient_first_name,
|
63
|
+
patient_last_name: patient_last_name,
|
64
|
+
payer_identification: payer_identification,
|
65
|
+
payer_name: payer_name,
|
66
|
+
procedure_codes: procedure_codes,
|
67
|
+
report_creation_date: report_creation_date,
|
68
|
+
service_date_begin: service_date_begin,
|
69
|
+
service_date_end: service_date_end,
|
70
|
+
service_provider_npi: service_provider_npi
|
71
|
+
)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
report_claims
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Response
|
3
|
+
module Claim
|
4
|
+
class Report277InfoClaimStatus < Hashie::Trash
|
5
|
+
property :status_category_codes, required: false
|
6
|
+
property :total_charge_amount, required: false
|
7
|
+
property :status_information_effective_date, required: false
|
8
|
+
|
9
|
+
def add_status_category_code(status_category_code)
|
10
|
+
self[:status_category_codes] ||= []
|
11
|
+
self[:status_category_codes] << status_category_code
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Response
|
3
|
+
module Claim
|
4
|
+
class Report835Claim < ReportClaim
|
5
|
+
property :claim_payment_remark_codes, required: false
|
6
|
+
property :payer_claim_control_number, required: false
|
7
|
+
property :payment_method_code, required: false
|
8
|
+
property :service_lines, required: false
|
9
|
+
property :total_actual_provider_payment_amount, required: false
|
10
|
+
property :total_charge_amount, required: false
|
11
|
+
|
12
|
+
def procedure_codes
|
13
|
+
service_lines&.map(&:adjudicated_procedure_code)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,134 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Response
|
3
|
+
module Claim
|
4
|
+
# Methods only return meaningful data for json reports
|
5
|
+
class Report835Data < ChangeHealth::Response::Claim::ReportData
|
6
|
+
def transactions
|
7
|
+
@raw['transactions']
|
8
|
+
end
|
9
|
+
|
10
|
+
# Only one payer per report
|
11
|
+
def payer_name
|
12
|
+
transactions&.first&.dig('payer')&.dig('name')
|
13
|
+
end
|
14
|
+
|
15
|
+
def payment_method_code
|
16
|
+
transactions&.first&.dig('financialInformation', 'paymentMethodCode')
|
17
|
+
end
|
18
|
+
|
19
|
+
def report_creation_date
|
20
|
+
ChangeHealth::Models::PARSE_DATE.call(transactions&.first&.dig('productionDate'))
|
21
|
+
end
|
22
|
+
|
23
|
+
def total_actual_provider_payment_amount
|
24
|
+
transactions&.first&.dig('financialInformation', 'totalActualProviderPaymentAmount')
|
25
|
+
end
|
26
|
+
|
27
|
+
def claims
|
28
|
+
report_claims = []
|
29
|
+
|
30
|
+
transactions&.each do |transaction|
|
31
|
+
payment_method_code = transaction.dig('financialInformation', 'paymentMethodCode')
|
32
|
+
payer_name = transaction.dig('payer', 'name')
|
33
|
+
payer_identification = transaction.dig('payer', 'payerIdentificationNumber')
|
34
|
+
report_creation_date = ChangeHealth::Models::PARSE_DATE.call(transaction['productionDate'])
|
35
|
+
total_actual_provider_payment_amount = transaction.dig('financialInformation',
|
36
|
+
'totalActualProviderPaymentAmount')
|
37
|
+
|
38
|
+
transaction['detailInfo']&.each do |detail_info|
|
39
|
+
detail_info['paymentInfo']&.each do |payment_info|
|
40
|
+
patient_first_name = payment_info.dig('patientName', 'firstName')
|
41
|
+
patient_last_name = payment_info.dig('patientName', 'lastName')
|
42
|
+
service_provider_npi = payment_info.dig('renderingProvider', 'npi')
|
43
|
+
total_charge_amount = payment_info.dig('claimPaymentInfo', 'totalClaimChargeAmount')
|
44
|
+
payer_claim_control_number = payment_info.dig('claimPaymentInfo', 'payerClaimControlNumber')
|
45
|
+
|
46
|
+
claim_payment_remark_codes = []
|
47
|
+
claim_payment_remark_codes_index = 1
|
48
|
+
while payment_info.dig('outpatientAdjudication',
|
49
|
+
"claimPaymentRemarkCode#{claim_payment_remark_codes_index}")
|
50
|
+
claim_payment_remark_codes << payment_info.dig('outpatientAdjudication',
|
51
|
+
"claimPaymentRemarkCode#{claim_payment_remark_codes_index}")
|
52
|
+
claim_payment_remark_codes_index += 1
|
53
|
+
end
|
54
|
+
|
55
|
+
service_date_begin = nil
|
56
|
+
service_date_end = nil
|
57
|
+
service_lines = []
|
58
|
+
payment_info['serviceLines']&.each do |service_line|
|
59
|
+
service_line_date = ChangeHealth::Models::PARSE_DATE.call(service_line['serviceDate'])
|
60
|
+
if service_date_begin.nil? || service_line_date < service_date_begin
|
61
|
+
service_date_begin = service_line_date
|
62
|
+
end
|
63
|
+
service_date_end = service_line_date if service_date_end.nil? || service_date_end < service_line_date
|
64
|
+
|
65
|
+
adjudicated_procedure_code = service_line.dig('servicePaymentInformation', 'adjudicatedProcedureCode')
|
66
|
+
allowed_actual = service_line.dig('serviceSupplementalAmounts', 'allowedActual')
|
67
|
+
line_item_charge_amount = service_line.dig('servicePaymentInformation', 'lineItemChargeAmount')
|
68
|
+
line_item_provider_payment_amount = service_line.dig('servicePaymentInformation',
|
69
|
+
'lineItemProviderPaymentAmount')
|
70
|
+
|
71
|
+
service_adjustments = []
|
72
|
+
service_line['serviceAdjustments']&.each do |service_adjustment|
|
73
|
+
adjustments = {}
|
74
|
+
service_adjustment_index = 1
|
75
|
+
while service_adjustment["adjustmentReasonCode#{service_adjustment_index}"]
|
76
|
+
adjustment_reason = service_adjustment["adjustmentReasonCode#{service_adjustment_index}"]
|
77
|
+
adjustment_amount = service_adjustment["adjustmentAmount#{service_adjustment_index}"]
|
78
|
+
adjustments[adjustment_reason] = adjustment_amount
|
79
|
+
service_adjustment_index += 1
|
80
|
+
end
|
81
|
+
|
82
|
+
claim_adjustment_group_code = service_adjustment['claimAdjustmentGroupCode']
|
83
|
+
|
84
|
+
service_adjustments << Report835ServiceAdjustment.new(
|
85
|
+
adjustments: adjustments,
|
86
|
+
claim_adjustment_group_code: claim_adjustment_group_code
|
87
|
+
)
|
88
|
+
end
|
89
|
+
|
90
|
+
health_care_check_remark_codes = []
|
91
|
+
service_line['healthCareCheckRemarkCodes']&.each do |health_care_check_remark_code|
|
92
|
+
health_care_check_remark_codes << Report835HealthCareCheckRemarkCode.new(
|
93
|
+
code_list_qualifier_code: health_care_check_remark_code['codeListQualifierCode'],
|
94
|
+
code_list_qualifier_code_value: health_care_check_remark_code['codeListQualifierCodeValue'],
|
95
|
+
remark_code: health_care_check_remark_code['remarkCode']
|
96
|
+
)
|
97
|
+
end
|
98
|
+
|
99
|
+
service_lines << Report835ServiceLine.new(
|
100
|
+
adjudicated_procedure_code: adjudicated_procedure_code,
|
101
|
+
allowed_actual: allowed_actual,
|
102
|
+
line_item_charge_amount: line_item_charge_amount,
|
103
|
+
line_item_provider_payment_amount: line_item_provider_payment_amount,
|
104
|
+
service_adjustments: service_adjustments,
|
105
|
+
health_care_check_remark_codes: health_care_check_remark_codes
|
106
|
+
)
|
107
|
+
end
|
108
|
+
|
109
|
+
report_claims << Report835Claim.new(
|
110
|
+
claim_payment_remark_codes: claim_payment_remark_codes,
|
111
|
+
patient_first_name: patient_first_name,
|
112
|
+
patient_last_name: patient_last_name,
|
113
|
+
payer_claim_control_number: payer_claim_control_number,
|
114
|
+
payer_identification: payer_identification,
|
115
|
+
payer_name: payer_name,
|
116
|
+
payment_method_code: payment_method_code,
|
117
|
+
report_creation_date: report_creation_date,
|
118
|
+
service_date_begin: service_date_begin,
|
119
|
+
service_date_end: service_date_end,
|
120
|
+
service_lines: service_lines,
|
121
|
+
service_provider_npi: service_provider_npi,
|
122
|
+
total_actual_provider_payment_amount: total_actual_provider_payment_amount,
|
123
|
+
total_charge_amount: total_charge_amount
|
124
|
+
)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
report_claims
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Response
|
3
|
+
module Claim
|
4
|
+
class Report835HealthCareCheckRemarkCode < Hashie::Trash
|
5
|
+
property :code_list_qualifier_code, required: false
|
6
|
+
property :code_list_qualifier_code_value, required: false
|
7
|
+
property :remark_code, required: false
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Response
|
3
|
+
module Claim
|
4
|
+
class Report835ServiceAdjustment < Hashie::Trash
|
5
|
+
property :adjustments, required: false
|
6
|
+
property :claim_adjustment_group_code, required: false
|
7
|
+
|
8
|
+
def add_adjustment(adjustment)
|
9
|
+
self[:adjustments] ||= []
|
10
|
+
self[:adjustments] << adjustment
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Response
|
3
|
+
module Claim
|
4
|
+
class Report835ServiceLine < Hashie::Trash
|
5
|
+
property :adjudicated_procedure_code, required: false
|
6
|
+
property :allowed_actual, required: false
|
7
|
+
property :health_care_check_remark_codes, required: false
|
8
|
+
property :line_item_charge_amount, required: false
|
9
|
+
property :line_item_provider_payment_amount, required: false
|
10
|
+
property :service_adjustments, required: false
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Response
|
3
|
+
module Claim
|
4
|
+
class ReportClaim < Hashie::Trash
|
5
|
+
property :patient_first_name, required: false
|
6
|
+
property :patient_last_name, required: false
|
7
|
+
property :payer_identification, required: false
|
8
|
+
property :payer_name, required: false
|
9
|
+
property :report_creation_date, required: false
|
10
|
+
property :service_date_begin, required: false
|
11
|
+
property :service_date_end, required: false
|
12
|
+
property :service_provider_npi, required: false
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,13 +1,12 @@
|
|
1
1
|
module ChangeHealth
|
2
|
-
|
3
|
-
module Models
|
2
|
+
module Response
|
4
3
|
class Error
|
5
4
|
attr_reader :data
|
6
5
|
|
7
6
|
SIMPLE_RETRY_CODES = %w[
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
42
|
8
|
+
80
|
9
|
+
].freeze
|
11
10
|
|
12
11
|
NO_RESUBMIT_MESSAGES = [
|
13
12
|
'resubmission not allowed',
|
@@ -40,7 +39,9 @@ module ChangeHealth
|
|
40
39
|
|
41
40
|
def retryable?
|
42
41
|
represents_down? ||
|
43
|
-
(code? && SIMPLE_RETRY_CODES.include?(code) && followupAction? && NO_RESUBMIT_MESSAGES.none?
|
42
|
+
(code? && SIMPLE_RETRY_CODES.include?(code) && followupAction? && NO_RESUBMIT_MESSAGES.none? do |msg|
|
43
|
+
followupAction.downcase.include?(msg)
|
44
|
+
end)
|
44
45
|
end
|
45
46
|
|
46
47
|
%w[field description code followupAction location].each do |method_name|
|
@@ -48,7 +49,7 @@ module ChangeHealth
|
|
48
49
|
false == send(method_name).nil?
|
49
50
|
end
|
50
51
|
|
51
|
-
define_method(
|
52
|
+
define_method(method_name.to_s) do
|
52
53
|
@data[method_name]
|
53
54
|
end
|
54
55
|
end
|
@@ -16,13 +16,13 @@ module ChangeHealth
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def errors?
|
19
|
-
|
19
|
+
errors.is_a?(Array) && false == errors.empty?
|
20
20
|
end
|
21
21
|
|
22
22
|
def errors
|
23
23
|
errors = @raw.dig('errors') || []
|
24
24
|
|
25
|
-
errors.flatten.map {|error| ChangeHealth::
|
25
|
+
errors.flatten.map { |error| ChangeHealth::Response::Error.new(error) }
|
26
26
|
end
|
27
27
|
|
28
28
|
def recommend_retry?
|
@@ -34,7 +34,7 @@ module ChangeHealth
|
|
34
34
|
|
35
35
|
return false if error_codes.empty?
|
36
36
|
|
37
|
-
|
37
|
+
error_codes.all?(&:retryable?)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
data/lib/change_health.rb
CHANGED
@@ -5,9 +5,10 @@ require 'change_health/authentication'
|
|
5
5
|
require 'change_health/change_health_exception'
|
6
6
|
require 'change_health/connection'
|
7
7
|
require 'change_health/extensions'
|
8
|
-
require 'change_health/models/error'
|
9
8
|
require 'change_health/models/model'
|
9
|
+
require 'change_health/models/claim/submission/address'
|
10
10
|
require 'change_health/models/claim/submission/claim_information'
|
11
|
+
require 'change_health/models/claim/submission/drug_identification'
|
11
12
|
require 'change_health/models/claim/submission/provider'
|
12
13
|
require 'change_health/models/claim/submission/service_line'
|
13
14
|
require 'change_health/models/claim/submission/submitter'
|
@@ -20,10 +21,20 @@ require 'change_health/request/eligibility'
|
|
20
21
|
require 'change_health/request/submission'
|
21
22
|
require 'change_health/request/report'
|
22
23
|
require 'change_health/request/trading_partner'
|
24
|
+
require 'change_health/response/error'
|
23
25
|
require 'change_health/response/response_data'
|
24
26
|
require 'change_health/response/claim/submission/submission_data'
|
25
27
|
require 'change_health/response/claim/report/report_list_data'
|
26
28
|
require 'change_health/response/claim/report/report_data'
|
29
|
+
require 'change_health/response/claim/report/report_277_data'
|
30
|
+
require 'change_health/response/claim/report/report_835_data'
|
31
|
+
require 'change_health/response/claim/report/report_claim'
|
32
|
+
require 'change_health/response/claim/report/report_277_claim'
|
33
|
+
require 'change_health/response/claim/report/report_277_info_claim_status'
|
34
|
+
require 'change_health/response/claim/report/report_835_claim'
|
35
|
+
require 'change_health/response/claim/report/report_835_health_care_check_remark_code'
|
36
|
+
require 'change_health/response/claim/report/report_835_service_adjustment'
|
37
|
+
require 'change_health/response/claim/report/report_835_service_line'
|
27
38
|
require 'change_health/response/eligibility/eligibility_benefit'
|
28
39
|
require 'change_health/response/eligibility/eligibility_benefits'
|
29
40
|
require 'change_health/response/eligibility/eligibility_data'
|
@@ -45,11 +56,11 @@ module ChangeHealth
|
|
45
56
|
end
|
46
57
|
|
47
58
|
def api_endpoint
|
48
|
-
|
59
|
+
Connection.base_uri
|
49
60
|
end
|
50
61
|
|
51
62
|
def to_h
|
52
|
-
|
63
|
+
{
|
53
64
|
client_id: @client_id,
|
54
65
|
client_secret: @client_secret,
|
55
66
|
grant_type: @grant_type,
|
@@ -63,7 +74,7 @@ module ChangeHealth
|
|
63
74
|
self.grant_type = h[:grant_type]
|
64
75
|
self.api_endpoint = h[:api_endpoint]
|
65
76
|
|
66
|
-
|
77
|
+
self
|
67
78
|
end
|
68
79
|
end
|
69
80
|
|
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
|
+
version: 3.2.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: 2021-
|
11
|
+
date: 2021-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -147,7 +147,9 @@ files:
|
|
147
147
|
- lib/change_health/change_health_exception.rb
|
148
148
|
- lib/change_health/connection.rb
|
149
149
|
- lib/change_health/extensions.rb
|
150
|
+
- lib/change_health/models/claim/submission/address.rb
|
150
151
|
- lib/change_health/models/claim/submission/claim_information.rb
|
152
|
+
- lib/change_health/models/claim/submission/drug_identification.rb
|
151
153
|
- lib/change_health/models/claim/submission/provider.rb
|
152
154
|
- lib/change_health/models/claim/submission/service_line.rb
|
153
155
|
- lib/change_health/models/claim/submission/submitter.rb
|
@@ -155,19 +157,28 @@ files:
|
|
155
157
|
- lib/change_health/models/eligibility/encounter.rb
|
156
158
|
- lib/change_health/models/eligibility/provider.rb
|
157
159
|
- lib/change_health/models/eligibility/subscriber.rb
|
158
|
-
- lib/change_health/models/error.rb
|
159
160
|
- lib/change_health/models/model.rb
|
160
161
|
- lib/change_health/models/trading_partner/trading_partner.rb
|
161
162
|
- lib/change_health/request/eligibility.rb
|
162
163
|
- lib/change_health/request/report.rb
|
163
164
|
- lib/change_health/request/submission.rb
|
164
165
|
- lib/change_health/request/trading_partner.rb
|
166
|
+
- lib/change_health/response/claim/report/report_277_claim.rb
|
167
|
+
- lib/change_health/response/claim/report/report_277_data.rb
|
168
|
+
- lib/change_health/response/claim/report/report_277_info_claim_status.rb
|
169
|
+
- lib/change_health/response/claim/report/report_835_claim.rb
|
170
|
+
- lib/change_health/response/claim/report/report_835_data.rb
|
171
|
+
- lib/change_health/response/claim/report/report_835_health_care_check_remark_code.rb
|
172
|
+
- lib/change_health/response/claim/report/report_835_service_adjustment.rb
|
173
|
+
- lib/change_health/response/claim/report/report_835_service_line.rb
|
174
|
+
- lib/change_health/response/claim/report/report_claim.rb
|
165
175
|
- lib/change_health/response/claim/report/report_data.rb
|
166
176
|
- lib/change_health/response/claim/report/report_list_data.rb
|
167
177
|
- lib/change_health/response/claim/submission/submission_data.rb
|
168
178
|
- lib/change_health/response/eligibility/eligibility_benefit.rb
|
169
179
|
- lib/change_health/response/eligibility/eligibility_benefits.rb
|
170
180
|
- lib/change_health/response/eligibility/eligibility_data.rb
|
181
|
+
- lib/change_health/response/error.rb
|
171
182
|
- lib/change_health/response/response_data.rb
|
172
183
|
- lib/change_health/response/trading_partner/trading_partner_data.rb
|
173
184
|
- lib/change_health/response/trading_partner/trading_partners_data.rb
|
@@ -192,8 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
203
|
- !ruby/object:Gem::Version
|
193
204
|
version: '0'
|
194
205
|
requirements: []
|
195
|
-
|
196
|
-
rubygems_version: 2.7.6
|
206
|
+
rubygems_version: 3.1.6
|
197
207
|
signing_key:
|
198
208
|
specification_version: 4
|
199
209
|
summary: Ruby wrapper for the ChangeHealth API
|