change_health 2.3.0 → 3.3.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 +4 -4
- data/CHANGELOG.md +54 -2
- data/README.md +108 -54
- 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/submission.rb +11 -10
- data/lib/change_health/response/claim/report/report_277_claim.rb +44 -0
- data/lib/change_health/response/claim/report/report_277_data.rb +37 -17
- data/lib/change_health/response/claim/report/{report_info_claim_status.rb → report_277_info_claim_status.rb} +2 -1
- data/lib/change_health/response/claim/report/report_835_claim.rb +19 -0
- data/lib/change_health/response/claim/report/report_835_data.rb +131 -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 +9 -38
- 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 +9 -2
- metadata +11 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 771e550998ba619e8f20ad0482df45d2414f106588d674e8764fbe9af1fbd4d7
|
4
|
+
data.tar.gz: 3c35d671b8cecbc38e9d5984756c5af8f0e4c18ed4e86ed2877f30d670ef1146
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ece66009484991d0be79850df3b8327449099b5829c26100ddd0304ec6759be8a12e4bc0e348c044f5d2247cc8f4e923aa4a26dea5f59a008786d5d42f8fb6f
|
7
|
+
data.tar.gz: d598da2e9b5051bfee077aa7da86ed663befc801d68efb6a29a476a5e6655fdeb886f62be843a65316a6e03cd8ef83a2c845d8bad05a70d7cc42fb2d78727369
|
data/CHANGELOG.md
CHANGED
@@ -4,10 +4,58 @@ 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
|
+
# [3.3.0] - 2022-02-11
|
8
|
+
### Added
|
9
|
+
* Report277Claim - 'message' from informationClaimStatuses, clearinghouse_trace_number, patient_account_number, referenced_transaction_trace_number, trading_partner_claim_number
|
10
|
+
* Report835Claim - patient_control_number
|
11
|
+
* ReportClaim - report_name, patient_member_id
|
12
|
+
|
13
|
+
## [3.2.0] - 2021-12-23
|
14
|
+
### Added
|
15
|
+
* Report835HealthCareCheckRemarkCode
|
16
|
+
* Report835Claim - added claim_payment_remark_codes
|
17
|
+
|
18
|
+
## [3.1.0] - 2021-12-21
|
19
|
+
### Added
|
20
|
+
#### Claim Submission
|
21
|
+
* ServiceLine - drugIdentification & renderingProvider
|
22
|
+
* Subscriber - groupNumber
|
23
|
+
* Address model w/ postalCode that is formatted to remove dashes, '-'
|
24
|
+
* Note: Using a plain hash for address still works
|
25
|
+
* Auto formatting of postal code fields
|
26
|
+
|
27
|
+
## [3.0.0] - 2021-12-08
|
28
|
+
### Added
|
29
|
+
* Report277Claim - specific to claims from 277 reports
|
30
|
+
* Report835Claim - specific to claims from 835 reports
|
31
|
+
* Report835ServiceAdjustment & Report835ServiceLine - helper classes for readability of claims from 835 reports
|
32
|
+
|
33
|
+
### Changed
|
34
|
+
* ReportClaim - removed 277 report unique fields
|
35
|
+
|
36
|
+
#### Namespace
|
37
|
+
| Previous | Current |
|
38
|
+
|-|-|
|
39
|
+
| ChangeHealth::Models::Error | ChangeHealth::Response::Error |
|
40
|
+
| ChangeHealth::Response::Claim::ReportInfoClaimStatus | ChangeHealth::Response::Claim::Report277InfoClaimStatus|
|
41
|
+
|
42
|
+
#### Methods
|
43
|
+
| Previous | Current |
|
44
|
+
|-|-|
|
45
|
+
| Report277Data#payer_org_name | Report277Data#payer_name |
|
46
|
+
| ReportClaim#latest_total_charge_amount | ReportClaim#total_charge_amount |
|
47
|
+
| ReportClaim#payer_org_name | ReportClaim#payer_name |
|
48
|
+
| ReportClaim#service_begin_date | ReportClaim#service_date_begin |
|
49
|
+
| ReportClaim#service_end_date | ReportClaim#service_date_end |
|
50
|
+
| ReportClaim#subscriber_first_name | ReportClaim#patient_first_name |
|
51
|
+
| ReportClaim#subscriber_last_name | ReportClaim#patient_last_name |
|
52
|
+
| ReportClaim#transaction_set_creation_date | ReportClaim#report_creation_date |
|
53
|
+
|
54
|
+
|
7
55
|
## [2.3.0] - 2021-11-18
|
8
56
|
### Added
|
9
|
-
* Specific classes for 277 & 835 reports
|
10
|
-
* ReportClaim & ReportInfoClaimStatus- only works for json 277 reports
|
57
|
+
* Report277Data & Report835Data - Specific classes for 277 & 835 reports
|
58
|
+
* ReportClaim & ReportInfoClaimStatus - only works for json 277 reports
|
11
59
|
|
12
60
|
### Fixed
|
13
61
|
* Headers can now be nil for requests
|
@@ -188,6 +236,10 @@ Added the ability to hit professional claim submission API. For more details, se
|
|
188
236
|
- Authentication
|
189
237
|
- Configuration
|
190
238
|
|
239
|
+
[3.3.0]: https://github.com/WeInfuse/change_health/compare/v3.2.0...v3.3.0
|
240
|
+
[3.2.0]: https://github.com/WeInfuse/change_health/compare/v3.1.0...v3.2.0
|
241
|
+
[3.1.0]: https://github.com/WeInfuse/change_health/compare/v3.0.0...v3.1.0
|
242
|
+
[3.0.0]: https://github.com/WeInfuse/change_health/compare/v2.3.0...v3.0.0
|
191
243
|
[2.3.0]: https://github.com/WeInfuse/change_health/compare/v2.2.1...v2.3.0
|
192
244
|
[2.2.1]: https://github.com/WeInfuse/change_health/compare/v2.2.0...v2.2.1
|
193
245
|
[2.2.0]: https://github.com/WeInfuse/change_health/compare/v2.1.0...v2.2.0
|
data/README.md
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
[](https://circleci.com/gh/WeInfuse/change_health)
|
2
2
|
|
3
|
-
|
3
|
+
```
|
4
|
+
____ _ _ _ _ _ _
|
5
|
+
/ ___| |__ __ _ _ __ __ _ ___ | | | | ___ __ _| | |_| |__
|
6
|
+
| | | '_ \ / _` | '_ \ / _` |/ _ \ | |_| |/ _ \/ _` | | __| '_ \
|
7
|
+
| |___| | | | (_| | | | | (_| | __/ | _ | __/ (_| | | |_| | | |
|
8
|
+
\____|_| |_|\__,_|_| |_|\__, |\___| |_| |_|\___|\__,_|_|\__|_| |_|
|
9
|
+
|___/
|
10
|
+
```
|
11
|
+
|
4
12
|
Ruby API wrapper for [Change Health](https://developers.changehealthcare.com/api)
|
5
13
|
|
6
|
-
|
14
|
+
# Installation
|
7
15
|
|
8
16
|
Add this line to your application's Gemfile:
|
9
17
|
|
@@ -19,13 +27,13 @@ Or install it yourself as:
|
|
19
27
|
|
20
28
|
$ gem install change_health
|
21
29
|
|
22
|
-
|
30
|
+
# Usage
|
23
31
|
|
24
|
-
|
32
|
+
## Setup
|
25
33
|
|
26
34
|
Make sure you're [configured](#configuration)!
|
27
35
|
|
28
|
-
|
36
|
+
## Eligibility
|
29
37
|
[Change Healthcare Eligibility Guide](https://developers.changehealthcare.com/eligibilityandclaims/docs)
|
30
38
|
```ruby
|
31
39
|
ChangeHealth::Request::Eligibility.ping # Test your connection
|
@@ -39,7 +47,7 @@ edata = ChangeHealth::Request::Eligibility.new(tradingPartnerServiceId: '000050'
|
|
39
47
|
edata.raw # Raw Hash of JSON response
|
40
48
|
```
|
41
49
|
|
42
|
-
|
50
|
+
### Benefit(s) objects
|
43
51
|
Benefits extends Array and provides a query-like interface.
|
44
52
|
|
45
53
|
Benefit extends Hash and provides helpers for single-benefit.
|
@@ -58,7 +66,7 @@ edata.benefits.where(name: 'Co-Payment', code: 'B', benefitAmount: '30) # Generi
|
|
58
66
|
edata.benefits.find_by(name: 'Co-Payment', code: 'B', benefitAmount: '30) # Generic 'find_by' api returns first object found
|
59
67
|
```
|
60
68
|
|
61
|
-
|
69
|
+
### Response
|
62
70
|
|
63
71
|
Response is EligibilityData object
|
64
72
|
|
@@ -76,7 +84,7 @@ edata.raw == edata.response.parsed_response
|
|
76
84
|
# true
|
77
85
|
```
|
78
86
|
|
79
|
-
|
87
|
+
## Trading Partners
|
80
88
|
```ruby
|
81
89
|
# Query trading partners using a wildcard search
|
82
90
|
# Returns Array of ChangeHealth::Models::TradingPartner Objects
|
@@ -89,7 +97,7 @@ trading_partners.first.service_id
|
|
89
97
|
# "ABC123"
|
90
98
|
```
|
91
99
|
|
92
|
-
|
100
|
+
## Claim Submission
|
93
101
|
[Change Healthcare Claim Submission Guide](https://developers.changehealthcare.com/eligibilityandclaims/docs/professional-claims-v3-getting-started)
|
94
102
|
```ruby
|
95
103
|
ChangeHealth::Request::Claim::Submission.ping # Test your connection
|
@@ -101,12 +109,13 @@ claim_submitter = ChangeHealth::Models::Claim::Submitter.new(
|
|
101
109
|
)
|
102
110
|
|
103
111
|
receiver = { organizationName: "EXTRA HEALTHY INSURANCE"}
|
104
|
-
address =
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
112
|
+
address = ChangeHealth::Models::Claim::Address.new(
|
113
|
+
address1: "123 address1",
|
114
|
+
city: "city1",
|
115
|
+
state: "wa",
|
116
|
+
postalCode: "98101-0000"
|
117
|
+
)
|
118
|
+
|
110
119
|
subscriber = ChangeHealth::Models::Claim::Subscriber.new(
|
111
120
|
member_id: "0000000001",
|
112
121
|
payment_responsibility_level_code: "P",
|
@@ -118,45 +127,45 @@ subscriber = ChangeHealth::Models::Claim::Subscriber.new(
|
|
118
127
|
)
|
119
128
|
provider = ChangeHealth::Models::Claim::Provider.new(
|
120
129
|
address: address,
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
130
|
+
employer_id: "000000000",
|
131
|
+
first_name: "johnone",
|
132
|
+
last_name: "doetwo",
|
133
|
+
npi: "1760854442",
|
134
|
+
provider_type: "BillingProvider"
|
126
135
|
)
|
127
136
|
|
128
137
|
health_care_code_information1 = {
|
129
|
-
|
130
|
-
|
138
|
+
diagnosisTypeCode: "ABK",
|
139
|
+
diagnosisCode: "S93401A"
|
131
140
|
}
|
132
141
|
health_care_code_information2 = {
|
133
|
-
|
134
|
-
|
142
|
+
diagnosisTypeCode: "ABF",
|
143
|
+
diagnosisCode: "S72044G"
|
135
144
|
|
136
145
|
}
|
137
146
|
service_line1 = ChangeHealth::Models::Claim::ServiceLine.new(
|
138
147
|
service_date: "2018-05-14",
|
139
148
|
professional_service: {
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
149
|
+
procedureIdentifier: "HC",
|
150
|
+
lineItemChargeAmount: "25",
|
151
|
+
procedureCode: "E0570",
|
152
|
+
measurementUnit: "UN",
|
153
|
+
serviceUnitCount: "1",
|
154
|
+
compositeDiagnosisCodePointers: {
|
155
|
+
diagnosisCodePointers: ["1","2"]
|
147
156
|
}
|
148
157
|
}
|
149
158
|
)
|
150
159
|
service_line2 = ChangeHealth::Models::Claim::ServiceLine.new(
|
151
160
|
service_date: "20180514",
|
152
161
|
professional_service: {
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
162
|
+
procedureIdentifier: "HC",
|
163
|
+
lineItemChargeAmount: "3.75",
|
164
|
+
procedureCode: "A7003",
|
165
|
+
measurementUnit: "UN",
|
166
|
+
serviceUnitCount: "1",
|
167
|
+
compositeDiagnosisCodePointers: {
|
168
|
+
diagnosisCodePointers: ["1"]
|
160
169
|
}
|
161
170
|
}
|
162
171
|
)
|
@@ -196,10 +205,10 @@ claim_submission_data = claim_submission.submission
|
|
196
205
|
validation = claim_submission.validation
|
197
206
|
```
|
198
207
|
|
199
|
-
|
208
|
+
## Claim Reports
|
200
209
|
[Change Healthcare Claim Responses and Reports Guide](https://developers.changehealthcare.com/eligibilityandclaims/docs/claims-responses-and-reports-getting-started)
|
201
210
|
|
202
|
-
|
211
|
+
### Get Reports
|
203
212
|
```ruby
|
204
213
|
ChangeHealth::Request::Claim::Report.ping # Test your connection
|
205
214
|
|
@@ -226,33 +235,78 @@ reports_edi = report_list.report_names.map {|report_name| ChangeHealth::Request:
|
|
226
235
|
# all reports in edi format
|
227
236
|
```
|
228
237
|
|
229
|
-
|
230
|
-
Currently only works for json 277 reports
|
238
|
+
### Inspect Reports
|
239
|
+
Currently only works for json 277 reports and json 835 reports. Not for EDI reports
|
240
|
+
|
241
|
+
From a report, you can get an array of claims
|
231
242
|
|
232
|
-
|
243
|
+
#### Report 277
|
233
244
|
|
234
245
|
```ruby
|
235
|
-
|
236
|
-
# list of claims in the report
|
246
|
+
report_277_data = ChangeHealth::Request::Claim::Report.get_report("X3000000.AB", as_json_report: true)
|
237
247
|
|
238
|
-
|
239
|
-
claim.payer_org_name
|
248
|
+
report_277_data.payer_name
|
240
249
|
# "PREMERA"
|
241
250
|
|
242
|
-
|
251
|
+
report_277_data.report_creation_date
|
252
|
+
# Tue, 01 Dec 2020
|
253
|
+
|
254
|
+
claim_277 = report_277_data.claims.first
|
255
|
+
claim_277.payer_name
|
256
|
+
# "PREMERA"
|
257
|
+
|
258
|
+
claim_277.report_name
|
259
|
+
# "X3000000.AB"
|
260
|
+
|
261
|
+
claim_277.patient_first_name
|
243
262
|
# "JOHNONE"
|
244
263
|
|
245
|
-
|
264
|
+
claim_277.report_creation_date
|
246
265
|
# Tue, 01 Dec 2020
|
247
266
|
|
248
|
-
|
267
|
+
# Report 277 specific below
|
268
|
+
claim_277.latest_status_category_codes
|
249
269
|
# ["F1"]
|
250
270
|
|
251
|
-
|
271
|
+
claim_277.total_charge_amount
|
252
272
|
# "100"
|
273
|
+
|
274
|
+
claim_277.procedure_codes
|
275
|
+
# ["97161"]
|
276
|
+
```
|
277
|
+
|
278
|
+
#### Report 835
|
279
|
+
|
280
|
+
```ruby
|
281
|
+
report_835_data = ChangeHealth::Request::Claim::Report.get_report("R5000000.XY", as_json_report: true)
|
282
|
+
|
283
|
+
report_835_data.payment_method_code
|
284
|
+
# "ACH"
|
285
|
+
|
286
|
+
report_835_data.total_actual_provider_payment_amount
|
287
|
+
# "2563.13"
|
288
|
+
|
289
|
+
claim_835 = report_835_data.claims.first
|
290
|
+
claim_835.payer_name
|
291
|
+
# "NATIONAL GOVERNMENT SERVICES, INC."
|
292
|
+
|
293
|
+
claim_835.patient_first_name
|
294
|
+
# "JANE"
|
295
|
+
|
296
|
+
claim_835.patient_member_id
|
297
|
+
# "7SL5RA7XR19"
|
298
|
+
|
299
|
+
claim_835.report_creation_date
|
300
|
+
# Wed, 22 Apr 2020
|
301
|
+
|
302
|
+
claim_835.procedure_codes
|
303
|
+
# ["21210", "21026", "21208", "30580"]
|
304
|
+
|
305
|
+
claim_835.service_lines.map(&:line_item_charge_amount)
|
306
|
+
# ["3600", "1890", "1836", "1680"]
|
253
307
|
```
|
254
308
|
|
255
|
-
|
309
|
+
## Configuration
|
256
310
|
|
257
311
|
```ruby
|
258
312
|
ChangeHealth.configure do |c|
|
@@ -263,12 +317,12 @@ ChangeHealth.configure do |c|
|
|
263
317
|
end
|
264
318
|
```
|
265
319
|
|
266
|
-
|
320
|
+
# Development
|
267
321
|
|
268
322
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
269
323
|
|
270
324
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
271
325
|
|
272
|
-
|
326
|
+
# Contributing
|
273
327
|
|
274
328
|
Bug reports and pull requests are welcome on GitHub at https://github.com/WeInfuse/change\_health.
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Models
|
3
|
+
module Claim
|
4
|
+
class Address < Model
|
5
|
+
property :address1, required: false
|
6
|
+
property :address2, required: false
|
7
|
+
property :city, required: false
|
8
|
+
property :postalCode, from: :postal_code, required: false
|
9
|
+
property :state, required: false
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Models
|
3
|
+
module Claim
|
4
|
+
class DrugIdentification < Model
|
5
|
+
property :measurementUnitCode, from: :measurement_unit_code, required: false
|
6
|
+
property :nationalDrugCode, from: :national_drug_code, required: false
|
7
|
+
property :nationalDrugUnitCount, from: :national_drug_unit_count, required: false
|
8
|
+
property :serviceIdQualifier, from: :service_id_qualifier, required: false
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -2,10 +2,10 @@ module ChangeHealth
|
|
2
2
|
module Models
|
3
3
|
module Claim
|
4
4
|
class ServiceLine < Model
|
5
|
-
|
5
|
+
property :drugIdentification, from: :drug_identification, required: false
|
6
6
|
property :serviceDate, from: :service_date, required: false
|
7
7
|
property :professionalService, from: :professional_service, required: false
|
8
|
-
|
8
|
+
property :renderingProvider, from: :rendering_provider, required: false
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -6,6 +6,7 @@ module ChangeHealth
|
|
6
6
|
property :dateOfBirth, from: :date_of_birth, required: false
|
7
7
|
property :firstName, from: :first_name, required: false
|
8
8
|
property :gender, required: false
|
9
|
+
property :groupNumber, from: :group_number, required: false
|
9
10
|
property :lastName, from: :last_name, required: false
|
10
11
|
property :memberId, from: :member_id, required: false
|
11
12
|
property :paymentResponsibilityLevelCode, from: :payment_responsibility_level_code, required: false
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ChangeHealth
|
2
2
|
module Models
|
3
3
|
DATE_FORMAT = '%Y%m%d'
|
4
|
-
DATE_FORMATTER =
|
4
|
+
DATE_FORMATTER = lambda { |d|
|
5
5
|
begin
|
6
6
|
d = Date.parse(d) if d.is_a?(String)
|
7
7
|
rescue ArgumentError
|
@@ -12,37 +12,65 @@ module ChangeHealth
|
|
12
12
|
d
|
13
13
|
}
|
14
14
|
|
15
|
-
PARSE_DATE =
|
15
|
+
PARSE_DATE = lambda { |d|
|
16
16
|
begin
|
17
17
|
d = Date.strptime(d, ChangeHealth::Models::DATE_FORMAT)
|
18
|
-
rescue
|
18
|
+
rescue StandardError
|
19
19
|
end
|
20
20
|
|
21
21
|
d
|
22
22
|
}
|
23
23
|
|
24
|
-
|
24
|
+
POSTAL_CODE_FORMATTER = lambda { |postal_code|
|
25
|
+
begin
|
26
|
+
formatted_postal_code = postal_code&.to_s&.tr('-', '')
|
27
|
+
rescue StandardError
|
28
|
+
end
|
29
|
+
formatted_postal_code || postal_code
|
30
|
+
}
|
31
|
+
|
32
|
+
CONTROL_NUMBER = -> { '%09d' % rand(1_000_000_000) }
|
25
33
|
|
26
34
|
class Model < Hashie::Trash
|
27
35
|
def to_h
|
28
|
-
|
36
|
+
self.class.hashify(self)
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.hashify(model)
|
40
|
+
model.map do |key, value|
|
41
|
+
formatted_value = case value
|
42
|
+
when Hash
|
43
|
+
hashify(model[key])
|
44
|
+
when Array
|
45
|
+
value.map do |element|
|
46
|
+
if element.is_a?(Hash)
|
47
|
+
hashify(element)
|
48
|
+
else # if it's an array of arrays, can't handle it
|
49
|
+
format_value(key, element)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
else
|
53
|
+
format_value(key, value)
|
54
|
+
end
|
55
|
+
[key, formatted_value]
|
56
|
+
end.to_h
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.format_value(key, value)
|
60
|
+
return nil if value == ''
|
29
61
|
|
30
|
-
|
31
|
-
|
32
|
-
result[key] = ChangeHealth::Models::DATE_FORMATTER.call(result[key])
|
33
|
-
end
|
34
|
-
result[key] = nil if value == ""
|
35
|
-
end
|
62
|
+
return ChangeHealth::Models::DATE_FORMATTER.call(value) if key.to_s.downcase.include?('date')
|
63
|
+
return ChangeHealth::Models::POSTAL_CODE_FORMATTER.call(value) if key.to_s.downcase.include?('postalcode')
|
36
64
|
|
37
|
-
|
65
|
+
value
|
38
66
|
end
|
39
67
|
|
40
|
-
def as_json(
|
41
|
-
|
68
|
+
def as_json(_args = {})
|
69
|
+
to_h
|
42
70
|
end
|
43
71
|
|
44
|
-
def to_json
|
45
|
-
|
72
|
+
def to_json(*_args)
|
73
|
+
to_h.to_json
|
46
74
|
end
|
47
75
|
end
|
48
76
|
end
|
@@ -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,44 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Response
|
3
|
+
module Claim
|
4
|
+
class Report277Claim < ReportClaim
|
5
|
+
property :clearinghouse_trace_number, required: false
|
6
|
+
property :info_claim_statuses, required: false
|
7
|
+
property :patient_account_number, required: false
|
8
|
+
property :procedure_codes, required: false
|
9
|
+
property :referenced_transaction_trace_number, required: false
|
10
|
+
property :trading_partner_claim_number, required: false
|
11
|
+
|
12
|
+
def add_info_claim_status(info_claim_status)
|
13
|
+
self[:info_claim_statuses] ||= []
|
14
|
+
self[:info_claim_statuses] << info_claim_status
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_procedure_code(procedure_code)
|
18
|
+
self[:procedure_codes] ||= []
|
19
|
+
self[:procedure_codes] << procedure_code
|
20
|
+
end
|
21
|
+
|
22
|
+
def latest_status_category_codes
|
23
|
+
latest_info_claim_status&.status_category_codes
|
24
|
+
end
|
25
|
+
|
26
|
+
def total_charge_amount
|
27
|
+
latest_info_claim_status&.total_charge_amount
|
28
|
+
end
|
29
|
+
|
30
|
+
def latest_status_info_effective_date
|
31
|
+
latest_info_claim_status&.status_information_effective_date
|
32
|
+
end
|
33
|
+
|
34
|
+
def latest_info_claim_status
|
35
|
+
info_claim_statuses&.select do |info|
|
36
|
+
!info.status_information_effective_date.nil? &&
|
37
|
+
info.status_information_effective_date.is_a?(Date) &&
|
38
|
+
info.status_information_effective_date <= Date.today
|
39
|
+
end&.max_by(&:status_information_effective_date)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -8,23 +8,29 @@ module ChangeHealth
|
|
8
8
|
end
|
9
9
|
|
10
10
|
# Only one payer per report
|
11
|
-
def
|
11
|
+
def payer_name
|
12
12
|
transactions&.first&.dig('payers')&.first&.dig('organizationName')
|
13
13
|
end
|
14
14
|
|
15
|
+
def report_creation_date
|
16
|
+
ChangeHealth::Models::PARSE_DATE.call(transactions&.first&.dig('transactionSetCreationDate'))
|
17
|
+
end
|
18
|
+
|
15
19
|
def claims
|
16
20
|
report_claims = []
|
17
21
|
|
18
22
|
transactions&.each do |transaction|
|
19
|
-
|
23
|
+
report_creation_date = ChangeHealth::Models::PARSE_DATE.call(transaction['transactionSetCreationDate'])
|
20
24
|
transaction['payers']&.each do |payer|
|
21
|
-
|
25
|
+
payer_identification = payer['payerIdentification']
|
26
|
+
payer_name = payer['organizationName']
|
22
27
|
payer['claimStatusTransactions']&.each do |claim_status_txn|
|
23
28
|
claim_status_txn['claimStatusDetails']&.each do |claim_status_detail|
|
24
29
|
service_provider_npi = claim_status_detail.dig('serviceProvider', 'npi')
|
25
30
|
claim_status_detail['patientClaimStatusDetails']&.each do |patient_claim_status_detail|
|
26
|
-
|
27
|
-
|
31
|
+
patient_first_name = patient_claim_status_detail.dig('subscriber', 'firstName')
|
32
|
+
patient_last_name = patient_claim_status_detail.dig('subscriber', 'lastName')
|
33
|
+
patient_member_id = patient_claim_status_detail.dig('subscriber', 'memberId')
|
28
34
|
patient_claim_status_detail['claims']&.each do |claim|
|
29
35
|
procedure_codes = []
|
30
36
|
claim['serviceLines']&.each do |service_line|
|
@@ -33,11 +39,17 @@ module ChangeHealth
|
|
33
39
|
claim_status = claim['claimStatus']
|
34
40
|
next if claim_status.nil?
|
35
41
|
|
36
|
-
|
37
|
-
|
42
|
+
clearinghouse_trace_number = claim_status['clearinghouseTraceNumber']
|
43
|
+
patient_account_number = claim_status['patientAccountNumber']
|
44
|
+
referenced_transaction_trace_number = claim_status['referencedTransactionTraceNumber']
|
45
|
+
trading_partner_claim_number = claim_status['tradingPartnerClaimNumber']
|
46
|
+
|
47
|
+
service_date_begin = ChangeHealth::Models::PARSE_DATE.call(claim_status['claimServiceBeginDate'] || claim_status['claimServiceDate'])
|
48
|
+
service_date_end = ChangeHealth::Models::PARSE_DATE.call(claim_status['claimServiceEndDate'] || claim_status['claimServiceDate'])
|
38
49
|
|
39
50
|
info_claim_statuses = []
|
40
51
|
claim_status['informationClaimStatuses']&.each do |info_claim_status|
|
52
|
+
message = info_claim_status['message']
|
41
53
|
status_information_effective_date = ChangeHealth::Models::PARSE_DATE.call(info_claim_status['statusInformationEffectiveDate'])
|
42
54
|
total_charge_amount = info_claim_status['totalClaimChargeAmount']
|
43
55
|
|
@@ -46,22 +58,30 @@ module ChangeHealth
|
|
46
58
|
status_category_codes << info_status['healthCareClaimStatusCategoryCode']
|
47
59
|
end
|
48
60
|
|
49
|
-
info_claim_statuses <<
|
61
|
+
info_claim_statuses << Report277InfoClaimStatus.new(
|
62
|
+
message: message,
|
50
63
|
status_category_codes: status_category_codes,
|
51
64
|
total_charge_amount: total_charge_amount,
|
52
65
|
status_information_effective_date: status_information_effective_date
|
53
66
|
)
|
54
67
|
end
|
55
|
-
report_claims <<
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
68
|
+
report_claims << Report277Claim.new(
|
69
|
+
clearinghouse_trace_number: clearinghouse_trace_number,
|
70
|
+
info_claim_statuses: info_claim_statuses,
|
71
|
+
patient_account_number: patient_account_number,
|
72
|
+
patient_first_name: patient_first_name,
|
73
|
+
patient_last_name: patient_last_name,
|
74
|
+
patient_member_id: patient_member_id,
|
75
|
+
payer_identification: payer_identification,
|
76
|
+
payer_name: payer_name,
|
61
77
|
procedure_codes: procedure_codes,
|
62
|
-
|
63
|
-
|
64
|
-
|
78
|
+
referenced_transaction_trace_number: referenced_transaction_trace_number,
|
79
|
+
report_creation_date: report_creation_date,
|
80
|
+
report_name: report_name,
|
81
|
+
service_date_begin: service_date_begin,
|
82
|
+
service_date_end: service_date_end,
|
83
|
+
service_provider_npi: service_provider_npi,
|
84
|
+
trading_partner_claim_number: trading_partner_claim_number
|
65
85
|
)
|
66
86
|
end
|
67
87
|
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module ChangeHealth
|
2
2
|
module Response
|
3
3
|
module Claim
|
4
|
-
class
|
4
|
+
class Report277InfoClaimStatus < Hashie::Trash
|
5
|
+
property :message, required: false
|
5
6
|
property :status_category_codes, required: false
|
6
7
|
property :total_charge_amount, required: false
|
7
8
|
property :status_information_effective_date, required: false
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Response
|
3
|
+
module Claim
|
4
|
+
class Report835Claim < ReportClaim
|
5
|
+
property :claim_payment_remark_codes, required: false
|
6
|
+
property :patient_control_number, required: false
|
7
|
+
property :payer_claim_control_number, required: false
|
8
|
+
property :payment_method_code, required: false
|
9
|
+
property :service_lines, required: false
|
10
|
+
property :total_actual_provider_payment_amount, required: false
|
11
|
+
property :total_charge_amount, required: false
|
12
|
+
|
13
|
+
def procedure_codes
|
14
|
+
service_lines&.map(&:adjudicated_procedure_code)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,7 +1,138 @@
|
|
1
1
|
module ChangeHealth
|
2
2
|
module Response
|
3
3
|
module Claim
|
4
|
+
# Methods only return meaningful data for json reports
|
4
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_control_number = payment_info.dig('claimPaymentInfo', 'patientControlNumber')
|
41
|
+
patient_first_name = payment_info.dig('patientName', 'firstName')
|
42
|
+
patient_last_name = payment_info.dig('patientName', 'lastName')
|
43
|
+
patient_member_id = payment_info.dig('patientName', 'memberId')
|
44
|
+
payer_claim_control_number = payment_info.dig('claimPaymentInfo', 'payerClaimControlNumber')
|
45
|
+
service_provider_npi = payment_info.dig('renderingProvider', 'npi')
|
46
|
+
total_charge_amount = payment_info.dig('claimPaymentInfo', 'totalClaimChargeAmount')
|
47
|
+
|
48
|
+
claim_payment_remark_codes = []
|
49
|
+
claim_payment_remark_codes_index = 1
|
50
|
+
while payment_info.dig('outpatientAdjudication',
|
51
|
+
"claimPaymentRemarkCode#{claim_payment_remark_codes_index}")
|
52
|
+
claim_payment_remark_codes << payment_info.dig('outpatientAdjudication',
|
53
|
+
"claimPaymentRemarkCode#{claim_payment_remark_codes_index}")
|
54
|
+
claim_payment_remark_codes_index += 1
|
55
|
+
end
|
56
|
+
|
57
|
+
service_date_begin = nil
|
58
|
+
service_date_end = nil
|
59
|
+
service_lines = []
|
60
|
+
payment_info['serviceLines']&.each do |service_line|
|
61
|
+
service_line_date = ChangeHealth::Models::PARSE_DATE.call(service_line['serviceDate'])
|
62
|
+
if service_date_begin.nil? || service_line_date < service_date_begin
|
63
|
+
service_date_begin = service_line_date
|
64
|
+
end
|
65
|
+
service_date_end = service_line_date if service_date_end.nil? || service_date_end < service_line_date
|
66
|
+
|
67
|
+
adjudicated_procedure_code = service_line.dig('servicePaymentInformation', 'adjudicatedProcedureCode')
|
68
|
+
allowed_actual = service_line.dig('serviceSupplementalAmounts', 'allowedActual')
|
69
|
+
line_item_charge_amount = service_line.dig('servicePaymentInformation', 'lineItemChargeAmount')
|
70
|
+
line_item_provider_payment_amount = service_line.dig('servicePaymentInformation',
|
71
|
+
'lineItemProviderPaymentAmount')
|
72
|
+
|
73
|
+
service_adjustments = []
|
74
|
+
service_line['serviceAdjustments']&.each do |service_adjustment|
|
75
|
+
adjustments = {}
|
76
|
+
service_adjustment_index = 1
|
77
|
+
while service_adjustment["adjustmentReasonCode#{service_adjustment_index}"]
|
78
|
+
adjustment_reason = service_adjustment["adjustmentReasonCode#{service_adjustment_index}"]
|
79
|
+
adjustment_amount = service_adjustment["adjustmentAmount#{service_adjustment_index}"]
|
80
|
+
adjustments[adjustment_reason] = adjustment_amount
|
81
|
+
service_adjustment_index += 1
|
82
|
+
end
|
83
|
+
|
84
|
+
claim_adjustment_group_code = service_adjustment['claimAdjustmentGroupCode']
|
85
|
+
|
86
|
+
service_adjustments << Report835ServiceAdjustment.new(
|
87
|
+
adjustments: adjustments,
|
88
|
+
claim_adjustment_group_code: claim_adjustment_group_code
|
89
|
+
)
|
90
|
+
end
|
91
|
+
|
92
|
+
health_care_check_remark_codes = []
|
93
|
+
service_line['healthCareCheckRemarkCodes']&.each do |health_care_check_remark_code|
|
94
|
+
health_care_check_remark_codes << Report835HealthCareCheckRemarkCode.new(
|
95
|
+
code_list_qualifier_code: health_care_check_remark_code['codeListQualifierCode'],
|
96
|
+
code_list_qualifier_code_value: health_care_check_remark_code['codeListQualifierCodeValue'],
|
97
|
+
remark_code: health_care_check_remark_code['remarkCode']
|
98
|
+
)
|
99
|
+
end
|
100
|
+
|
101
|
+
service_lines << Report835ServiceLine.new(
|
102
|
+
adjudicated_procedure_code: adjudicated_procedure_code,
|
103
|
+
allowed_actual: allowed_actual,
|
104
|
+
line_item_charge_amount: line_item_charge_amount,
|
105
|
+
line_item_provider_payment_amount: line_item_provider_payment_amount,
|
106
|
+
service_adjustments: service_adjustments,
|
107
|
+
health_care_check_remark_codes: health_care_check_remark_codes
|
108
|
+
)
|
109
|
+
end
|
110
|
+
|
111
|
+
report_claims << Report835Claim.new(
|
112
|
+
claim_payment_remark_codes: claim_payment_remark_codes,
|
113
|
+
patient_control_number: patient_control_number,
|
114
|
+
patient_first_name: patient_first_name,
|
115
|
+
patient_last_name: patient_last_name,
|
116
|
+
patient_member_id: patient_member_id,
|
117
|
+
payer_claim_control_number: payer_claim_control_number,
|
118
|
+
payer_identification: payer_identification,
|
119
|
+
payer_name: payer_name,
|
120
|
+
payment_method_code: payment_method_code,
|
121
|
+
report_creation_date: report_creation_date,
|
122
|
+
report_name: report_name,
|
123
|
+
service_date_begin: service_date_begin,
|
124
|
+
service_date_end: service_date_end,
|
125
|
+
service_lines: service_lines,
|
126
|
+
service_provider_npi: service_provider_npi,
|
127
|
+
total_actual_provider_payment_amount: total_actual_provider_payment_amount,
|
128
|
+
total_charge_amount: total_charge_amount
|
129
|
+
)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
report_claims
|
135
|
+
end
|
5
136
|
end
|
6
137
|
end
|
7
138
|
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
|
@@ -2,45 +2,16 @@ module ChangeHealth
|
|
2
2
|
module Response
|
3
3
|
module Claim
|
4
4
|
class ReportClaim < Hashie::Trash
|
5
|
-
property :
|
6
|
-
property :
|
5
|
+
property :patient_first_name, required: false
|
6
|
+
property :patient_last_name, required: false
|
7
|
+
property :patient_member_id, required: false
|
8
|
+
property :payer_identification, required: false
|
9
|
+
property :payer_name, required: false
|
10
|
+
property :report_creation_date, required: false
|
11
|
+
property :report_name, required: false
|
12
|
+
property :service_date_begin, required: false
|
13
|
+
property :service_date_end, required: false
|
7
14
|
property :service_provider_npi, required: false
|
8
|
-
property :subscriber_first_name, required: false
|
9
|
-
property :subscriber_last_name, required: false
|
10
|
-
property :procedure_codes, required: false
|
11
|
-
property :service_begin_date, required: false
|
12
|
-
property :service_end_date, required: false
|
13
|
-
property :info_claim_statuses, required: false
|
14
|
-
|
15
|
-
def add_procedure_code(procedure_code)
|
16
|
-
self[:procedure_codes] ||= []
|
17
|
-
self[:procedure_codes] << procedure_code
|
18
|
-
end
|
19
|
-
|
20
|
-
def add_info_claim_status(info_claim_status)
|
21
|
-
self[:info_claim_statuses] ||= []
|
22
|
-
self[:info_claim_statuses] << info_claim_status
|
23
|
-
end
|
24
|
-
|
25
|
-
def latest_status_category_codes
|
26
|
-
latest_info_claim_status&.status_category_codes
|
27
|
-
end
|
28
|
-
|
29
|
-
def latest_total_charge_amount
|
30
|
-
latest_info_claim_status&.total_charge_amount
|
31
|
-
end
|
32
|
-
|
33
|
-
def latest_status_info_effective_date
|
34
|
-
latest_info_claim_status&.status_information_effective_date
|
35
|
-
end
|
36
|
-
|
37
|
-
def latest_info_claim_status
|
38
|
-
info_claim_statuses&.select do |info|
|
39
|
-
!info.status_information_effective_date.nil? &&
|
40
|
-
info.status_information_effective_date.is_a?(Date) &&
|
41
|
-
info.status_information_effective_date <= Date.today
|
42
|
-
end&.max_by(&:status_information_effective_date)
|
43
|
-
end
|
44
15
|
end
|
45
16
|
end
|
46
17
|
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,6 +21,7 @@ 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'
|
@@ -27,7 +29,12 @@ require 'change_health/response/claim/report/report_data'
|
|
27
29
|
require 'change_health/response/claim/report/report_277_data'
|
28
30
|
require 'change_health/response/claim/report/report_835_data'
|
29
31
|
require 'change_health/response/claim/report/report_claim'
|
30
|
-
require 'change_health/response/claim/report/
|
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'
|
31
38
|
require 'change_health/response/eligibility/eligibility_benefit'
|
32
39
|
require 'change_health/response/eligibility/eligibility_benefits'
|
33
40
|
require 'change_health/response/eligibility/eligibility_data'
|
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.3.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:
|
11
|
+
date: 2022-02-11 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,23 +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
|
165
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
|
166
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
|
167
174
|
- lib/change_health/response/claim/report/report_claim.rb
|
168
175
|
- lib/change_health/response/claim/report/report_data.rb
|
169
|
-
- lib/change_health/response/claim/report/report_info_claim_status.rb
|
170
176
|
- lib/change_health/response/claim/report/report_list_data.rb
|
171
177
|
- lib/change_health/response/claim/submission/submission_data.rb
|
172
178
|
- lib/change_health/response/eligibility/eligibility_benefit.rb
|
173
179
|
- lib/change_health/response/eligibility/eligibility_benefits.rb
|
174
180
|
- lib/change_health/response/eligibility/eligibility_data.rb
|
181
|
+
- lib/change_health/response/error.rb
|
175
182
|
- lib/change_health/response/response_data.rb
|
176
183
|
- lib/change_health/response/trading_partner/trading_partner_data.rb
|
177
184
|
- lib/change_health/response/trading_partner/trading_partners_data.rb
|