dzero 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: '0889c270bd2f9cfe9505d504101d12addeb55162'
4
- data.tar.gz: f96d26194929d27ffcfd78366337c9e47c1bf762
3
+ metadata.gz: 91c519267d243dd10f7fa2e2d62c307af17fb92b
4
+ data.tar.gz: 4b09ee6f1f93e3377bc37f1fbdb95e1f80239297
5
5
  SHA512:
6
- metadata.gz: 1d53f684c5ea68a1b1fdc2024d2dec97eeb1d2f12d97cff2eb05289a9f75af3321c04f6420b813233fc6cc56415842279fd87deca179395d8dd66bbb7eb67c43
7
- data.tar.gz: ad88b00ad20a467bedd3b40270b2c19bfee2bab6cc828f4f4df6f0ba93a21a63d67194d4ad31cf457706c36b6c34b363acc04a35ea3e0c5b95d0e4a92b16af91
6
+ metadata.gz: 0ef3aa04774b0abb4ccfe7f19b2cbc3ad84477b6eedf7af7404b33468ce2dffdcaf7295c950503e274c525746d9430862be5665b61e4b5755329e057ff702ace
7
+ data.tar.gz: 49fafb8d418d465888d2b9ff065b00e155df5bb887462c878a97e7d079919efa2c4d3d2c9143b464b29238e9fc2b6d2679b6234a2f53f734396f3d8106b2b85c
data/lib/dzero/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DZero
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -0,0 +1,27 @@
1
+ FactoryBot.define do
2
+ factory :request, class: ::DZero::Transmissions::Request do
3
+ bin_number { '999999' }
4
+ version { 'D0' }
5
+ transaction_code { 'B1' }
6
+ transaction_count { '1' }
7
+ service_provider_id_qualifier { '01' }
8
+ service_provider_id { '1111111111' }
9
+ date_of_service { Date.today.strftime('%m%d%Y') }
10
+ segments { [] }
11
+
12
+ initialize_with do
13
+ ::DZero::Transmissions::Request.new(
14
+ header: {
15
+ bin_number: attributes[:bin_number],
16
+ version: attributes[:version],
17
+ transaction_code: attributes[:transaction_code],
18
+ transaction_count: attributes[:transaction_count],
19
+ service_provider_id_qualifier: attributes[:service_provider_id_qualifier],
20
+ service_provider_id: attributes[:service_provider_id],
21
+ date_of_service: attributes[:date_of_service]
22
+ },
23
+ segments: segments
24
+ )
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ FactoryBot.define do
2
+ factory :response, class: ::DZero::Transmissions::Request do
3
+ version { 'D0' }
4
+ transaction_code { 'B1' }
5
+ transaction_count { '1' }
6
+ header_response_status { 'A' }
7
+ service_provider_id_qualifier { '01' }
8
+ service_provider_id { '1111111111' }
9
+ date_of_service { Date.today.strftime('%m%d%Y') }
10
+ segments { [] }
11
+
12
+ initialize_with do
13
+ ::DZero::Transmissions::Response.new(
14
+ header: {
15
+ version: attributes[:version],
16
+ transaction_code: attributes[:transaction_code],
17
+ transaction_count: attributes[:transaction_count],
18
+ header_response_status: attributes[:header_response_status],
19
+ service_provider_id_qualifier: attributes[:service_provider_id_qualifier],
20
+ service_provider_id: attributes[:service_provider_id],
21
+ date_of_service: attributes[:date_of_service]
22
+ },
23
+ segments: segments
24
+ )
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,71 @@
1
+ FactoryBot.define do
2
+ factory :segment, class: DZero::Segments::Base do
3
+ hash { {} }
4
+
5
+ initialize_with do
6
+ DZero::Segments::Base.build(attributes[:base_hash].merge(attributes[:hash]))
7
+ end
8
+ end
9
+
10
+ factory :insurance_segment, class: DZero::Segments::Insurance do
11
+ hash { {} }
12
+ base_hash do
13
+ {
14
+ cardholder_id: "TEST", # Cardholder ID
15
+ cardholder_first_name: "AUSTIN", # Cardholder first name
16
+ cardholder_last_name: "PIVARNIK", # Cardholder last name
17
+ }
18
+ end
19
+
20
+ initialize_with do
21
+ DZero::Segments::Insurance.build(attributes[:base_hash].merge(attributes[:hash]))
22
+ end
23
+ end
24
+
25
+ factory :patient_segment, class: DZero::Segments::Patient do
26
+ hash { {} }
27
+ base_hash do
28
+ {
29
+ date_of_birth: Date.strptime('19001225', '%Y%m%d').strftime('%Y%m%d'), # Patient DOB
30
+ patient_first_name: 'AUSTIN', # PATIENT FIRST NAME
31
+ patient_last_name: 'PIVARNIK', # PATIENT LAST NAME
32
+ patient_street_address: '9 BRIARCROFT AVE', # PATIENT STREET ADDRESS
33
+ patient_city: 'TRUMBULL', # PATIENT CITY ADDRESS
34
+ patient_state_or_province: 'CT', # PATIENT STATE ADDRESS
35
+ patient_zip_postal_code: '06611', # PATIENT ZIP CODE
36
+ patient_phone_number: '2035555555', # PATIENT PHONE NUMBER
37
+ }
38
+ end
39
+
40
+ initialize_with do
41
+ DZero::Segments::Patient.build(attributes[:base_hash].merge(attributes[:hash]))
42
+ end
43
+ end
44
+
45
+ factory :claim_segment, class: DZero::Segments::Claim do
46
+ hash { {} }
47
+ base_hash do
48
+ {
49
+ prescription_reference_number_qualifier: "1", # PRESCRIPTION/SERVICE REFERENCE NUMBER QUALIFIER (Must be exactly this value: "1")
50
+ prescription_reference_number: "417083741803748", # UNIQUE PRESCRIPTION/SERVICE REFERENCE NUMBER (RX_NUMBER + FILL_NUMBER),
51
+ product_service_id: Erx::Processors::B1CreateOrder::NDC_1, # Product/Service ID
52
+ fill_number: '0'
53
+ }
54
+ end
55
+
56
+ initialize_with do
57
+ DZero::Segments::Claim.build(attributes[:base_hash].merge(attributes[:hash]))
58
+ end
59
+ end
60
+
61
+ factory :pricing_segment, class: DZero::Segments::Pricing do
62
+ hash { {} }
63
+ base_hash do
64
+ {}
65
+ end
66
+
67
+ initialize_with do
68
+ DZero::Segments::Pricing.build(attributes[:base_hash].merge(attributes[:hash]))
69
+ end
70
+ end
71
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dzero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin
@@ -160,6 +160,9 @@ files:
160
160
  - lib/dzero/utils/rejection_codes.rb
161
161
  - lib/dzero/utils/validator.rb
162
162
  - lib/dzero/version.rb
163
+ - spec/factories/request.rb
164
+ - spec/factories/response.rb
165
+ - spec/factories/segment.rb
163
166
  homepage: https://github.com/apiv/dzero
164
167
  licenses: []
165
168
  metadata: {}