change_health 2.2.0 → 3.1.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: 8a1ce76c1da3af060d7c36a7a3f22c9e9bb1920b2db4f0f2cb9060ec777c1854
4
- data.tar.gz: 2e4553b586e4bf8b13db083f423853708132a0686dac5ec27beea6223e740a0d
3
+ metadata.gz: eef3b2530820969a781c893ec5079573073cf31124243bf781d3415186a45cb1
4
+ data.tar.gz: a48072bc0dd1437314eef45596569b6be7e56200c578164b4d8ff0cd98646df8
5
5
  SHA512:
6
- metadata.gz: c15e9b053bdbfbfca3700a3d95971517aa0c07654267cc704ce4d210cc264d6d1f9aab08ccad3c165a59b3d8d56fc82bf4be5c69f6c2155c1127fa4ee5fed5ea
7
- data.tar.gz: 5a83d9c160bef86e5a296fea12335cc56cbac2959e1841e3f9382cee6b902586138be8e8e61328c0d3579afec5f904fa4712a9ccf8e8e7c89613e15ae663f668
6
+ metadata.gz: 2f67e82f2eb5660f767a297aa000cd4028606aab717b0db035b85b3933ad033276cb34bcb5373a5b716cd1bf611fd3b72d26fb3baae80a9d2783b2190a386179
7
+ data.tar.gz: f8e33bf4dece3c99287b0474bdaadf9d3b8ac1d39dccbfb35fc43c979cbb706973c93ae07adaa9202be5e20adb2ba74766b78fa615191fa29caf548526692597
data/CHANGELOG.md CHANGED
@@ -4,18 +4,69 @@ 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
- ## [2.2.0] - [2021-11-04-21]
7
+ ## [3.1.0] - 2021-12-21
8
+ ### Added
9
+ #### Claim Submission
10
+ * ServiceLine - drugIdentification & renderingProvider
11
+ * Subscriber - groupNumber
12
+ * Address model w/ postalCode that is formatted to remove dashes, '-'
13
+ * Note: Using a plain hash for address still works
14
+ * Auto formatting of postal code fields
15
+
16
+ ## [3.0.0] - 2021-12-08
17
+ ### Added
18
+ * Report277Claim - specific to claims from 277 reports
19
+ * Report835Claim - specific to claims from 835 reports
20
+ * Report835ServiceAdjustment & Report835ServiceLine - helper classes for readability of claims from 835 reports
21
+
22
+ ### Changed
23
+ * ReportClaim - removed 277 report unique fields
24
+
25
+ #### Namespace
26
+ | Previous | Current |
27
+ |-|-|
28
+ | ChangeHealth::Models::Error | ChangeHealth::Response::Error |
29
+ | ChangeHealth::Response::Claim::ReportInfoClaimStatus | ChangeHealth::Response::Claim::Report277InfoClaimStatus|
30
+
31
+ #### Methods
32
+ | Previous | Current |
33
+ |-|-|
34
+ | Report277Data#payer_org_name | Report277Data#payer_name |
35
+ | ReportClaim#latest_total_charge_amount | ReportClaim#total_charge_amount |
36
+ | ReportClaim#payer_org_name | ReportClaim#payer_name |
37
+ | ReportClaim#service_begin_date | ReportClaim#service_date_begin |
38
+ | ReportClaim#service_end_date | ReportClaim#service_date_end |
39
+ | ReportClaim#subscriber_first_name | ReportClaim#patient_first_name |
40
+ | ReportClaim#subscriber_last_name | ReportClaim#patient_last_name |
41
+ | ReportClaim#transaction_set_creation_date | ReportClaim#report_creation_date |
42
+
43
+
44
+ ## [2.3.0] - 2021-11-18
45
+ ### Added
46
+ * Report277Data & Report835Data - Specific classes for 277 & 835 reports
47
+ * ReportClaim & ReportInfoClaimStatus - only works for json 277 reports
48
+
49
+ ### Fixed
50
+ * Headers can now be nil for requests
51
+
52
+ ## [2.2.1] - 2021-11-15
53
+ ### Added
54
+ Custom Headers for Reports API and Professional Claims API
55
+ * Report
56
+ * Submission
57
+
58
+ ## [2.2.0] - 2021-11-04
8
59
  ### Added
9
60
  Ability to hit [Claim Responses and Reports](https://developers.changehealthcare.com/eligibilityandclaims/docs/claims-responses-and-reports-getting-started)
10
61
  * Report
11
62
  * ReportListData
12
63
  * ReportData
13
64
 
14
- ## [2.1.0] - [2021-10-12]
65
+ ## [2.1.0] - 2021-10-12
15
66
  ### Changed
16
67
  Model#to_h enhanced to change empty values AKA "" to nil. Reason: If a field is empty, Change Healthcare responds with an error - `Invalid value. Item must not be blank value.`. If the empty field is optional, Change Healthcare will accept the field as nil without error. If the empty field is required, Change Healthcare will return an error if the value is empty or nil.
17
68
 
18
- ## [2.0.0] - [2021-10-08]
69
+ ## [2.0.0] - 2021-10-08
19
70
  ### Added
20
71
  #### Models
21
72
  * ResponseData - for responses from calling change healthcare api used by EligibilityData and SubmissionData
@@ -46,50 +97,50 @@ Added the ability to hit professional claim submission API. For more details, se
46
97
  ### Fixed
47
98
  * Eligibility#add_dependent actually works
48
99
 
49
- ## [1.0.3] - [2021-04-26]
100
+ ## [1.0.3] - 2021-04-26
50
101
  ### Added
51
102
  - Model::Error#represents_down? - adds ability to distinguish error representing down state
52
103
  - Model::Error#retryable? - retryable when down
53
104
  - EligibilityData#recommend_retry? - recommend retry when down
54
105
 
55
- ## [1.0.2] - [2021-04-06]
106
+ ## [1.0.2] - 2021-04-06
56
107
  ### Added
57
108
  - EligibilityData#recommend_retry? - fix a bug in the search statement
58
109
 
59
- ## [1.0.1] - [2021-03-24]
110
+ ## [1.0.1] - 2021-03-24
60
111
  ### Added
61
112
  - EligibilityData#plan_status - adds ability to select instead of find
62
113
  - EligibilityData#inactive? active? - use new plan_status select
63
114
 
64
- ## [1.0.0] - [2021-03-17]
115
+ ## [1.0.0] - 2021-03-17
65
116
  ### Added
66
117
  - Model::Error - help with error codes
67
118
  - EligibilityData#recommend_retry? - if it looks like you can retry the exact same request
68
119
  - EligibilityData#inactive? - looks for plan status 6
69
120
 
70
- ## [0.15.0] - [2020-06-12]
121
+ ## [0.15.0] - 2020-06-12
71
122
  ### Added
72
123
  - Extensions - InNetworkMissing for plans that don't provide in network indicators.
73
124
 
74
125
  ### Fixed
75
126
  - Bug where active codes with no service codes cause exception.
76
127
 
77
- ## [0.14.0] - [2020-05-07]
128
+ ## [0.14.0] - 2020-05-07
78
129
  ### Added
79
130
  - Extensions - mixins for common overrides
80
131
 
81
- ## [0.13.0] - [2020-05-05]
132
+ ## [0.13.0] - 2020-05-05
82
133
  ### Changed
83
134
  - Removed `alias_method` for `where` helpers so you can override a single method
84
135
  - Added type Year to Date type 24
85
136
  - Added type Day type 7
86
137
 
87
- ## [0.12.0] - [2020-04-30]
138
+ ## [0.12.0] - 2020-04-30
88
139
  ### Added
89
140
  - EligibilityData#errors
90
141
  - EligibilityData#errors?
91
142
 
92
- ## [0.11.0] - [2020-04-24]
143
+ ## [0.11.0] - 2020-04-24
93
144
  ### Added
94
145
  - EligibilityData#medicare?
95
146
  - EligibilityData#plan\_id
@@ -104,7 +155,7 @@ Added the ability to hit professional claim submission API. For more details, se
104
155
  - EligibilityData initialize now checks for sub-classes of EligibilityBenefits with trading partner responds to `factory` to choose sub-class
105
156
  - EligibilityBenefits initializes `self.class` type in case it's a subclass
106
157
 
107
- ## [0.10.0] - [2020-04-09]
158
+ ## [0.10.0] - 2020-04-09
108
159
  ### Added
109
160
  - Add Trading Partner API querying capability
110
161
  - Request::TradingPartner
@@ -112,7 +163,7 @@ Added the ability to hit professional claim submission API. For more details, se
112
163
  - Response::TradingPartnersData
113
164
  - Models::TradingPartner
114
165
 
115
- ## [0.9.0] - [2020-04-08]
166
+ ## [0.9.0] - 2020-04-08
116
167
  ### Added
117
168
  - Added EligibilityBenefit#medicare?
118
169
  - Added EligibilityData#medicare?
@@ -121,20 +172,20 @@ Added the ability to hit professional claim submission API. For more details, se
121
172
  - EligibilityBenefit(s)#individual returns true for medicare in benefit and queries that look for 'IND'
122
173
  - EligibilityBenefit(s)#in\_network returns true for medicare in benefit and queries that look for 'Y'
123
174
 
124
- ## [0.8.0] - [2020-04-04]
175
+ ## [0.8.0] - 2020-04-04
125
176
  ### Changed
126
177
  - Attempt to serialize all properties with 'date' in the name to ChangeHealth date format
127
178
 
128
- ## [0.7.0] - [2020-04-03]
179
+ ## [0.7.0] - 2020-04-03
129
180
  ### Changed
130
181
  - Fixed bug in serializing date on subscriber and encounter
131
182
 
132
- ## [0.6.0] - [2020-04-02]
183
+ ## [0.6.0] - 2020-04-02
133
184
  ### Changed
134
185
  - Added Indifferent Access to hashes
135
186
  - Fixed bug with Authentication endpoint
136
187
 
137
- ## [0.5.0] - [2020-03-11]
188
+ ## [0.5.0] - 2020-03-11
138
189
  ### Added
139
190
  - EligibilityBenefit Deductible information
140
191
  - EligibilityBenefit benefits date information
@@ -146,17 +197,17 @@ Added the ability to hit professional claim submission API. For more details, se
146
197
  ### Changed
147
198
  - Broke EligibilityBenefit and EligibilityBenefits into separate files
148
199
 
149
- ## [0.4.0] - [2020-03-10]
200
+ ## [0.4.0] - 2020-03-10
150
201
  ### Added
151
202
  - EligibilityBenefit(s) Employee information
152
203
  - EligibilityData plan date information
153
204
  - EligibilityData eligibility, plan and service date helpers on date info
154
205
 
155
- ## [0.3.0] - [2020-03-09]
206
+ ## [0.3.0] - 2020-03-09
156
207
  ### Added
157
208
  - Production endpoint
158
209
 
159
- ## [0.0.2] - [2020-03-09]
210
+ ## [0.0.2] - 2020-03-09
160
211
  ### Added
161
212
  - EligibilityData
162
213
  - EligibilityBenefit
@@ -174,6 +225,10 @@ Added the ability to hit professional claim submission API. For more details, se
174
225
  - Authentication
175
226
  - Configuration
176
227
 
228
+ [3.1.0]: https://github.com/WeInfuse/change_health/compare/v3.0.0...v3.1.0
229
+ [3.0.0]: https://github.com/WeInfuse/change_health/compare/v2.3.0...v3.0.0
230
+ [2.3.0]: https://github.com/WeInfuse/change_health/compare/v2.2.1...v2.3.0
231
+ [2.2.1]: https://github.com/WeInfuse/change_health/compare/v2.2.0...v2.2.1
177
232
  [2.2.0]: https://github.com/WeInfuse/change_health/compare/v2.1.0...v2.2.0
178
233
  [2.1.0]: https://github.com/WeInfuse/change_health/compare/v2.0.0...v2.1.0
179
234
  [2.0.0]: https://github.com/WeInfuse/change_health/compare/v1.0.3...v2.0.0
data/README.md CHANGED
@@ -1,9 +1,17 @@
1
1
  [![CircleCI](https://circleci.com/gh/WeInfuse/change_health.svg?style=svg)](https://circleci.com/gh/WeInfuse/change_health)
2
2
 
3
- # Change Health
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
- ## Installation
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
- ## Usage
30
+ # Usage
23
31
 
24
- ### Setup
32
+ ## Setup
25
33
 
26
34
  Make sure you're [configured](#configuration)!
27
35
 
28
- ### Eligibility
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
- #### Benefit(s) objects
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
- #### Response
69
+ ### Response
62
70
 
63
71
  Response is EligibilityData object
64
72
 
@@ -67,16 +75,16 @@ edata.response
67
75
  #<HTTParty::Response:0x7fa354c1fbe8>
68
76
 
69
77
  edata.response.ok?
70
- true
78
+ # true
71
79
 
72
80
  edata.individual_oop_remaining(service_code: '30')
73
- 1344.88
81
+ # 1344.88
74
82
 
75
83
  edata.raw == edata.response.parsed_response
76
- true
84
+ # true
77
85
  ```
78
86
 
79
- ### Trading Partners
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
- ### Claim Submission
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
- "address1": "123 address1",
106
- "city": "city1",
107
- "state": "wa",
108
- "postalCode": "981010000"
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
- employer_id: "000000000",
122
- first_name: "johnone",
123
- last_name: "doetwo",
124
- npi: "1760854442",
125
- provider_type: "BillingProvider"
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
- "diagnosisTypeCode": "ABK",
130
- "diagnosisCode": "S93401A"
138
+ diagnosisTypeCode: "ABK",
139
+ diagnosisCode: "S93401A"
131
140
  }
132
141
  health_care_code_information2 = {
133
- "diagnosisTypeCode": "ABF",
134
- "diagnosisCode": "S72044G"
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
- "procedureIdentifier": "HC",
141
- "lineItemChargeAmount": "25",
142
- "procedureCode": "E0570",
143
- "measurementUnit": "UN",
144
- "serviceUnitCount": "1",
145
- "compositeDiagnosisCodePointers": {
146
- "diagnosisCodePointers": ["1","2"]
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
- "procedureIdentifier": "HC",
154
- "lineItemChargeAmount": "3.75",
155
- "procedureCode": "A7003",
156
- "measurementUnit": "UN",
157
- "serviceUnitCount": "1",
158
- "compositeDiagnosisCodePointers": {
159
- "diagnosisCodePointers": ["1"]
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
  )
@@ -174,6 +183,12 @@ claim_information = ChangeHealth::Models::Claim::ClaimInformation.new(
174
183
  service_lines: [service_line1, service_line2]
175
184
  )
176
185
 
186
+ professional_headers = {
187
+ submitter_id: '111000',
188
+ biller_id: '000111',
189
+ username: '222333hey',
190
+ password: 'builder1'
191
+ }
177
192
 
178
193
  claim_submission = ChangeHealth::Request::Claim::Submission.new(
179
194
  trading_partner_service_id: "9496",
@@ -181,52 +196,127 @@ claim_submission = ChangeHealth::Request::Claim::Submission.new(
181
196
  receiver: receiver,
182
197
  subscriber: subscriber,
183
198
  providers: [provider],
184
- claim_information: claim_information
199
+ claim_information: claim_information,
200
+ headers: professional_headers
185
201
  )
186
202
 
187
203
  claim_submission_data = claim_submission.submission
204
+
205
+ validation = claim_submission.validation
188
206
  ```
189
207
 
190
- ### Claim Reports
208
+ ## Claim Reports
191
209
  [Change Healthcare Claim Responses and Reports Guide](https://developers.changehealthcare.com/eligibilityandclaims/docs/claims-responses-and-reports-getting-started)
210
+
211
+ ### Get Reports
192
212
  ```ruby
193
213
  ChangeHealth::Request::Claim::Report.ping # Test your connection
194
214
 
195
- report_list = ChangeHealth::Request::Claim::Report.report_list
215
+ report_headers = {
216
+ username: '111000john',
217
+ password: 'WeInfuse1'
218
+ }
219
+
220
+ report_list = ChangeHealth::Request::Claim::Report.report_list(headers: report_headers)
196
221
 
197
222
  report_list.report_names
198
223
  # ["X3000000.XX", "R5000000.XY", "R5000000.XX", "X3000000.AB", "X3000000.AC", "X3000000.ZZ", "R5000000.XZ", "R5000000.YZ", "R5000000.WA", "R5000000.WB", "R5000000.WC"]
199
224
 
200
- report1_edi = ChangeHealth::Request::Claim::Report.get_report(report_list.report_names.first, as_json_report: false)
225
+ report0_edi = ChangeHealth::Request::Claim::Report.get_report(report_list.report_names.first, as_json_report: false)
201
226
  # Report in edi format
202
227
 
203
- report1_json = ChangeHealth::Request::Claim::Report.get_report(report_list.report_names.first, as_json_report: true)
228
+ report0_json = ChangeHealth::Request::Claim::Report.get_report(report_list.report_names.first, as_json_report: true)
204
229
  # Report in json format
205
230
 
206
- reports_json = report_list.report_names.map {|report_name| ChangeHealth::Request::Claim::Report.get_report(report_name)}
231
+ reports_json = report_list.report_names.map {|report_name| ChangeHealth::Request::Claim::Report.get_report(report_name, headers: report_headers)}
207
232
  # all reports in json format
208
233
 
209
- reports_edi = report_list.report_names.map {|report_name| ChangeHealth::Request::Claim::Report.get_report(report_name, as_json_report: false)}
234
+ reports_edi = report_list.report_names.map {|report_name| ChangeHealth::Request::Claim::Report.get_report(report_name, as_json_report: false, headers: report_headers)}
210
235
  # all reports in edi format
211
236
  ```
212
237
 
213
- ### Configuration
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
242
+
243
+ #### Report 277
244
+
245
+ ```ruby
246
+ report_277_data = ChangeHealth::Request::Claim::Report.get_report("X3000000.AB", as_json_report: true)
247
+
248
+ report_277_data.payer_name
249
+ # "PREMERA"
250
+
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.patient_first_name
259
+ # "JOHNONE"
260
+
261
+ claim_277.report_creation_date
262
+ # Tue, 01 Dec 2020
263
+
264
+ # Report 277 specific below
265
+ claim_277.latest_status_category_codes
266
+ # ["F1"]
267
+
268
+ claim_277.total_charge_amount
269
+ # "100"
270
+
271
+ claim_277.procedure_codes
272
+ # ["97161"]
273
+ ```
274
+
275
+ #### Report 835
276
+
277
+ ```ruby
278
+ report_835_data = ChangeHealth::Request::Claim::Report.get_report("R5000000.XY", as_json_report: true)
279
+
280
+ report_835_data.payment_method_code
281
+ # "ACH"
282
+
283
+ report_835_data.total_actual_provider_payment_amount
284
+ # "2563.13"
285
+
286
+ claim_835 = report_835_data.claims.first
287
+ claim_835.payer_name
288
+ # "NATIONAL GOVERNMENT SERVICES, INC."
289
+
290
+ claim_835.patient_first_name
291
+ # "JANE"
292
+
293
+ claim_835.report_creation_date
294
+ # Wed, 22 Apr 2020
295
+
296
+ claim_835.procedure_codes
297
+ # ["21210", "21026", "21208", "30580"]
298
+
299
+ claim_835.service_lines.map(&:line_item_charge_amount)
300
+ # ["3600", "1890", "1836", "1680"]
301
+ ```
302
+
303
+ ## Configuration
214
304
 
215
305
  ```ruby
216
306
  ChangeHealth.configure do |c|
217
307
  c.client_id = ENV['CHANGE_HEALTH_CLIENT_ID']
218
308
  c.client_secret = ENV['CHANGE_HEALTH_SECRET']
219
- c.grant_type = 'bob' # Defaults to client_credentials
220
- c.api_endpoint = 'http://hello.com' # Defaults to Change Health Sandbox endpoint
309
+ c.grant_type = 'client_credentials' # Defaults to client_credentials
310
+ c.api_endpoint = 'https://sandbox.apigw.changehealthcare.com' # Defaults to Change Health Sandbox endpoint
221
311
  end
222
312
  ```
223
313
 
224
- ## Development
314
+ # Development
225
315
 
226
316
  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.
227
317
 
228
318
  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).
229
319
 
230
- ## Contributing
320
+ # Contributing
231
321
 
232
322
  Bug reports and pull requests are welcome on GitHub at https://github.com/WeInfuse/change\_health.
@@ -13,11 +13,12 @@ module ChangeHealth
13
13
 
14
14
  format :json
15
15
 
16
- def request(endpoint: , query: nil, body: nil, headers: {}, auth: true, verb: :post)
16
+ def request(endpoint:, query: nil, body: nil, headers: {}, auth: true, verb: :post)
17
17
  body = body.to_json if body.is_a?(Hash)
18
+ headers = {} if headers.nil?
18
19
  headers = auth_header.merge(headers) if auth
19
20
 
20
- self.class.send("#{verb}", endpoint, query: query, body: body, headers: headers)
21
+ self.class.send(verb.to_s, endpoint, query: query, body: body, headers: headers)
21
22
  end
22
23
 
23
24
  private
@@ -25,7 +26,7 @@ module ChangeHealth
25
26
  def auth_header
26
27
  @auth ||= Authentication.new
27
28
 
28
- return @auth.authenticate.access_header
29
+ @auth.authenticate.access_header
29
30
  end
30
31
  end
31
32
  end
@@ -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