daisybill_api 0.1.7 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2a1f4166c3e80286a4b8c3f8f7ef6d42d5807715992a74b309b560f097947190
|
|
4
|
+
data.tar.gz: b0161ff134cde2d86b21dadb0559c555e22209bad6fc4d901d02ce8aed4f6505
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5c81cd8aa12bdedf45d778b7c8806504c351515b1f3baacc57dc672d3687fb492af1ce08a1fe095edba6e2658fc8610f940155dffba05856ac4400968cd2d4b8
|
|
7
|
+
data.tar.gz: 11441b0b74e9a9c418c2a5b91be0730c55f46cf8434488d24545ef7c355e0daee510ab8b0c87d506e2e16cc11033ed3cb3e24ed61c62bf1d0c84ee516c3ff678
|
|
@@ -25,11 +25,15 @@ module DaisybillApi
|
|
|
25
25
|
def initialize(method, path, params = {})
|
|
26
26
|
DaisybillApi.logger.info "#{method.to_s.upcase} #{path}"
|
|
27
27
|
DaisybillApi.logger.debug params.inspect
|
|
28
|
-
|
|
28
|
+
if method == :get
|
|
29
|
+
url = DaisybillApi::Data::Url.build(path, params).to_s
|
|
30
|
+
else
|
|
31
|
+
url = DaisybillApi::Data::Url.build(path).to_s
|
|
32
|
+
end
|
|
29
33
|
data = {
|
|
30
34
|
method: method,
|
|
31
35
|
url: url,
|
|
32
|
-
payload: params,
|
|
36
|
+
payload: method == :get ? nil : params,
|
|
33
37
|
headers: {
|
|
34
38
|
"Authorization" => "Bearer #{DaisybillApi.configuration.api_token}",
|
|
35
39
|
"User-Agent" => "DaisyBill_API/#{DaisybillApi::VERSION}",
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
require "webmock/rspec"
|
|
3
|
+
|
|
4
|
+
describe DaisybillApi::Data::Client, "GET request params handling" do
|
|
5
|
+
before do
|
|
6
|
+
DaisybillApi.configure do |config|
|
|
7
|
+
config.api_token = "test-token"
|
|
8
|
+
config.host = "go.daisybill.com"
|
|
9
|
+
config.port = 443
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
let(:response_body) { { "payers" => [{ "id" => 1, "name" => "Test Payer" }] }.to_json }
|
|
14
|
+
|
|
15
|
+
describe "GET requests" do
|
|
16
|
+
it "does not include a request body" do
|
|
17
|
+
stub = stub_request(:get, %r{go.daisybill.com/api/v1/claims_administrators/2985/payers})
|
|
18
|
+
.with { |request| request.body.nil? || request.body.empty? }
|
|
19
|
+
.to_return(status: 200, body: response_body, headers: { "Content-Type" => "application/json" })
|
|
20
|
+
|
|
21
|
+
DaisybillApi::Data::Client.new(:get, "/claims_administrators/2985/payers", { claims_administrator_id: 2985 })
|
|
22
|
+
|
|
23
|
+
expect(stub).to have_been_requested
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "sends params as query string parameters" do
|
|
27
|
+
stub = stub_request(:get, %r{go.daisybill.com/api/v1/claims_administrators/2985/payers})
|
|
28
|
+
.with(query: hash_including("claims_administrator_id" => "2985"))
|
|
29
|
+
.to_return(status: 200, body: response_body, headers: { "Content-Type" => "application/json" })
|
|
30
|
+
|
|
31
|
+
DaisybillApi::Data::Client.new(:get, "/claims_administrators/2985/payers", { claims_administrator_id: 2985 })
|
|
32
|
+
|
|
33
|
+
expect(stub).to have_been_requested
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
describe "POST requests" do
|
|
38
|
+
let(:post_response_body) { { "id" => 1, "name" => "Test" }.to_json }
|
|
39
|
+
|
|
40
|
+
it "sends params as a request body" do
|
|
41
|
+
stub = stub_request(:post, %r{go.daisybill.com/api/v1/patients})
|
|
42
|
+
.with { |request| !request.body.nil? && !request.body.empty? }
|
|
43
|
+
.to_return(status: 201, body: post_response_body, headers: { "Content-Type" => "application/json" })
|
|
44
|
+
|
|
45
|
+
params = { patient: { first_name: "John", last_name: "Smith" } }
|
|
46
|
+
DaisybillApi::Data::Client.new(:post, "/patients", params)
|
|
47
|
+
|
|
48
|
+
expect(stub).to have_been_requested
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
metadata
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: daisybill_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Liscio
|
|
8
8
|
- Eugene Surzhko
|
|
9
9
|
- Joe Leo
|
|
10
|
-
autorequire:
|
|
10
|
+
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2026-03-24 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: activemodel
|
|
@@ -46,14 +46,14 @@ dependencies:
|
|
|
46
46
|
requirements:
|
|
47
47
|
- - "~>"
|
|
48
48
|
- !ruby/object:Gem::Version
|
|
49
|
-
version: '
|
|
49
|
+
version: '2.0'
|
|
50
50
|
type: :development
|
|
51
51
|
prerelease: false
|
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
53
53
|
requirements:
|
|
54
54
|
- - "~>"
|
|
55
55
|
- !ruby/object:Gem::Version
|
|
56
|
-
version: '
|
|
56
|
+
version: '2.0'
|
|
57
57
|
- !ruby/object:Gem::Dependency
|
|
58
58
|
name: ffaker
|
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -72,14 +72,14 @@ dependencies:
|
|
|
72
72
|
name: rake
|
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
|
74
74
|
requirements:
|
|
75
|
-
- - "
|
|
75
|
+
- - ">="
|
|
76
76
|
- !ruby/object:Gem::Version
|
|
77
77
|
version: '10.0'
|
|
78
78
|
type: :development
|
|
79
79
|
prerelease: false
|
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
|
81
81
|
requirements:
|
|
82
|
-
- - "
|
|
82
|
+
- - ">="
|
|
83
83
|
- !ruby/object:Gem::Version
|
|
84
84
|
version: '10.0'
|
|
85
85
|
- !ruby/object:Gem::Dependency
|
|
@@ -130,28 +130,28 @@ dependencies:
|
|
|
130
130
|
requirements:
|
|
131
131
|
- - "~>"
|
|
132
132
|
- !ruby/object:Gem::Version
|
|
133
|
-
version: '
|
|
133
|
+
version: '6.3'
|
|
134
134
|
type: :development
|
|
135
135
|
prerelease: false
|
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
|
137
137
|
requirements:
|
|
138
138
|
- - "~>"
|
|
139
139
|
- !ruby/object:Gem::Version
|
|
140
|
-
version: '
|
|
140
|
+
version: '6.3'
|
|
141
141
|
- !ruby/object:Gem::Dependency
|
|
142
142
|
name: webmock
|
|
143
143
|
requirement: !ruby/object:Gem::Requirement
|
|
144
144
|
requirements:
|
|
145
145
|
- - "~>"
|
|
146
146
|
- !ruby/object:Gem::Version
|
|
147
|
-
version: '
|
|
147
|
+
version: '3.25'
|
|
148
148
|
type: :development
|
|
149
149
|
prerelease: false
|
|
150
150
|
version_requirements: !ruby/object:Gem::Requirement
|
|
151
151
|
requirements:
|
|
152
152
|
- - "~>"
|
|
153
153
|
- !ruby/object:Gem::Version
|
|
154
|
-
version: '
|
|
154
|
+
version: '3.25'
|
|
155
155
|
- !ruby/object:Gem::Dependency
|
|
156
156
|
name: yard
|
|
157
157
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -229,6 +229,7 @@ files:
|
|
|
229
229
|
- lib/daisybill_api/models/user.rb
|
|
230
230
|
- lib/daisybill_api/version.rb
|
|
231
231
|
- spec/daisybill_api/configuration_spec.rb
|
|
232
|
+
- spec/daisybill_api/data/client_get_request_params_spec.rb
|
|
232
233
|
- spec/daisybill_api/data/client_spec.rb
|
|
233
234
|
- spec/daisybill_api/data/rest_client/payload_spec.rb
|
|
234
235
|
- spec/daisybill_api/data/url_spec.rb
|
|
@@ -269,7 +270,7 @@ homepage: https://www.daisybill.com
|
|
|
269
270
|
licenses:
|
|
270
271
|
- MIT
|
|
271
272
|
metadata: {}
|
|
272
|
-
post_install_message:
|
|
273
|
+
post_install_message:
|
|
273
274
|
rdoc_options: []
|
|
274
275
|
require_paths:
|
|
275
276
|
- lib
|
|
@@ -284,45 +285,46 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
284
285
|
- !ruby/object:Gem::Version
|
|
285
286
|
version: '0'
|
|
286
287
|
requirements: []
|
|
287
|
-
rubygems_version: 3.
|
|
288
|
-
signing_key:
|
|
288
|
+
rubygems_version: 3.4.19
|
|
289
|
+
signing_key:
|
|
289
290
|
specification_version: 4
|
|
290
291
|
summary: ActiveRecord style wrapper for DaisyBill's API
|
|
291
292
|
test_files:
|
|
292
293
|
- spec/daisybill_api/configuration_spec.rb
|
|
293
|
-
- spec/daisybill_api/
|
|
294
|
+
- spec/daisybill_api/data/client_get_request_params_spec.rb
|
|
295
|
+
- spec/daisybill_api/data/client_spec.rb
|
|
296
|
+
- spec/daisybill_api/data/rest_client/payload_spec.rb
|
|
297
|
+
- spec/daisybill_api/data/url_spec.rb
|
|
294
298
|
- spec/daisybill_api/ext/attributes/attribute_spec.rb
|
|
299
|
+
- spec/daisybill_api/ext/attributes/type_castings_spec.rb
|
|
295
300
|
- spec/daisybill_api/ext/links/link_spec.rb
|
|
296
301
|
- spec/daisybill_api/ext/pageable_collection_spec.rb
|
|
302
|
+
- spec/daisybill_api/models/address_spec.rb
|
|
303
|
+
- spec/daisybill_api/models/attachment_spec.rb
|
|
304
|
+
- spec/daisybill_api/models/bill_mailing_address_spec.rb
|
|
305
|
+
- spec/daisybill_api/models/bill_payment_spec.rb
|
|
306
|
+
- spec/daisybill_api/models/bill_spec.rb
|
|
307
|
+
- spec/daisybill_api/models/bill_submission_spec.rb
|
|
308
|
+
- spec/daisybill_api/models/billing_provider_spec.rb
|
|
309
|
+
- spec/daisybill_api/models/claim_number_verification_spec.rb
|
|
310
|
+
- spec/daisybill_api/models/claims_administrator_spec.rb
|
|
297
311
|
- spec/daisybill_api/models/contact_spec.rb
|
|
312
|
+
- spec/daisybill_api/models/disputed_service_spec.rb
|
|
313
|
+
- spec/daisybill_api/models/employer_spec.rb
|
|
314
|
+
- spec/daisybill_api/models/error_report_spec.rb
|
|
315
|
+
- spec/daisybill_api/models/injury_spec.rb
|
|
316
|
+
- spec/daisybill_api/models/paper_eor_spec.rb
|
|
317
|
+
- spec/daisybill_api/models/patient_spec.rb
|
|
318
|
+
- spec/daisybill_api/models/payer_spec.rb
|
|
319
|
+
- spec/daisybill_api/models/pharmacy_bill_spec.rb
|
|
320
|
+
- spec/daisybill_api/models/place_of_service_spec.rb
|
|
298
321
|
- spec/daisybill_api/models/prescribing_provider_spec.rb
|
|
299
|
-
- spec/daisybill_api/models/claims_administrator_spec.rb
|
|
300
322
|
- spec/daisybill_api/models/referring_provider_spec.rb
|
|
301
|
-
- spec/daisybill_api/models/
|
|
302
|
-
- spec/daisybill_api/models/bill_spec.rb
|
|
323
|
+
- spec/daisybill_api/models/remittance_spec.rb
|
|
303
324
|
- spec/daisybill_api/models/rendering_provider_spec.rb
|
|
304
325
|
- spec/daisybill_api/models/request_for_second_review_spec.rb
|
|
305
|
-
- spec/daisybill_api/models/claim_number_verification_spec.rb
|
|
306
|
-
- spec/daisybill_api/models/payer_spec.rb
|
|
307
|
-
- spec/daisybill_api/models/task_spec.rb
|
|
308
|
-
- spec/daisybill_api/models/billing_provider_spec.rb
|
|
309
|
-
- spec/daisybill_api/models/bill_payment_spec.rb
|
|
310
|
-
- spec/daisybill_api/models/attachment_spec.rb
|
|
311
|
-
- spec/daisybill_api/models/error_report_spec.rb
|
|
312
|
-
- spec/daisybill_api/models/pharmacy_bill_spec.rb
|
|
313
|
-
- spec/daisybill_api/models/employer_spec.rb
|
|
314
|
-
- spec/daisybill_api/models/patient_spec.rb
|
|
315
|
-
- spec/daisybill_api/models/bill_submission_spec.rb
|
|
316
|
-
- spec/daisybill_api/models/service_line_item_spec.rb
|
|
317
326
|
- spec/daisybill_api/models/service_line_item_payment_spec.rb
|
|
318
|
-
- spec/daisybill_api/models/
|
|
319
|
-
- spec/daisybill_api/models/
|
|
327
|
+
- spec/daisybill_api/models/service_line_item_spec.rb
|
|
328
|
+
- spec/daisybill_api/models/task_spec.rb
|
|
320
329
|
- spec/daisybill_api/models/user_spec.rb
|
|
321
|
-
- spec/daisybill_api/models/remittance_spec.rb
|
|
322
|
-
- spec/daisybill_api/models/injury_spec.rb
|
|
323
|
-
- spec/daisybill_api/models/address_spec.rb
|
|
324
|
-
- spec/daisybill_api/models/bill_mailing_address_spec.rb
|
|
325
|
-
- spec/daisybill_api/data/client_spec.rb
|
|
326
|
-
- spec/daisybill_api/data/url_spec.rb
|
|
327
|
-
- spec/daisybill_api/data/rest_client/payload_spec.rb
|
|
328
330
|
- spec/daisybill_api_spec.rb
|