pokitdok-ruby 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.travis.yml +8 -0
- data/Gemfile +21 -0
- data/Gemfile.lock +140 -0
- data/Guardfile +18 -0
- data/LICENSE.txt +21 -0
- data/README.md +80 -0
- data/Rakefile +59 -0
- data/VERSION +1 -0
- data/lib/pokitdok.rb +167 -0
- data/pokitdok-ruby.gemspec +114 -0
- data/spec/fixtures/claim.json +116 -0
- data/spec/fixtures/enrollment.json +81 -0
- data/spec/fixtures/sample.270 +131 -0
- data/spec/pokitdok_spec.rb +168 -0
- data/spec/spec_helper.rb +44 -0
- data/spec/vcr_setup.rb +11 -0
- data/vcr_cassettes/activities.yml +512 -0
- data/vcr_cassettes/auth.yml +41 -0
- data/vcr_cassettes/claims.yml +99 -0
- data/vcr_cassettes/eligibility.yml +131 -0
- data/vcr_cassettes/enrollment.yml +85 -0
- data/vcr_cassettes/files.yml +57 -0
- data/vcr_cassettes/insurance_prices.yml +42 -0
- data/vcr_cassettes/payers.yml +163 -0
- data/vcr_cassettes/providers.yml +526 -0
- metadata +309 -0
@@ -0,0 +1,114 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: pokitdok-ruby 0.2.3 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "pokitdok-ruby"
|
9
|
+
s.version = "0.2.3"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
13
|
+
s.authors = ["John Riney"]
|
14
|
+
s.date = "2014-06-03"
|
15
|
+
s.description = "Gem for easy access to the PokitDok Platform APIs."
|
16
|
+
s.email = "john.riney@pokitdok.com"
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.md"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
".travis.yml",
|
24
|
+
"Gemfile",
|
25
|
+
"Gemfile.lock",
|
26
|
+
"Guardfile",
|
27
|
+
"LICENSE.txt",
|
28
|
+
"README.md",
|
29
|
+
"Rakefile",
|
30
|
+
"VERSION",
|
31
|
+
"lib/pokitdok.rb",
|
32
|
+
"pokitdok-ruby.gemspec",
|
33
|
+
"spec/fixtures/claim.json",
|
34
|
+
"spec/fixtures/enrollment.json",
|
35
|
+
"spec/fixtures/sample.270",
|
36
|
+
"spec/pokitdok_spec.rb",
|
37
|
+
"spec/spec_helper.rb",
|
38
|
+
"spec/vcr_setup.rb",
|
39
|
+
"vcr_cassettes/activities.yml",
|
40
|
+
"vcr_cassettes/auth.yml",
|
41
|
+
"vcr_cassettes/claims.yml",
|
42
|
+
"vcr_cassettes/eligibility.yml",
|
43
|
+
"vcr_cassettes/enrollment.yml",
|
44
|
+
"vcr_cassettes/files.yml",
|
45
|
+
"vcr_cassettes/insurance_prices.yml",
|
46
|
+
"vcr_cassettes/payers.yml",
|
47
|
+
"vcr_cassettes/providers.yml"
|
48
|
+
]
|
49
|
+
s.homepage = "http://github.com/pokitdok/pokitdok-ruby"
|
50
|
+
s.licenses = ["MIT"]
|
51
|
+
s.rubygems_version = "2.2.2"
|
52
|
+
s.summary = "Gem for easy access to the PokitDok Platform APIs"
|
53
|
+
|
54
|
+
if s.respond_to? :specification_version then
|
55
|
+
s.specification_version = 4
|
56
|
+
|
57
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
58
|
+
s.add_runtime_dependency(%q<oauth2>, ["~> 0.9"])
|
59
|
+
s.add_runtime_dependency(%q<multipart-post>, ["~> 2.0"])
|
60
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
61
|
+
s.add_development_dependency(%q<minitest>, ["~> 5.3"])
|
62
|
+
s.add_development_dependency(%q<mocha>, ["~> 1.0"])
|
63
|
+
s.add_development_dependency(%q<simplecov>, ["~> 0.8"])
|
64
|
+
s.add_development_dependency(%q<rubocop>, ["~> 0.20"])
|
65
|
+
s.add_development_dependency(%q<rdoc>, ["~> 4.1"])
|
66
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0"])
|
67
|
+
s.add_development_dependency(%q<ansi>, ["~> 1.4"])
|
68
|
+
s.add_development_dependency(%q<minitest-reporters>, ["~> 1.0"])
|
69
|
+
s.add_development_dependency(%q<vcr>, ["~> 2.9"])
|
70
|
+
s.add_development_dependency(%q<webmock>, ["~> 1.17"])
|
71
|
+
s.add_development_dependency(%q<guard>, ["~> 2.6"])
|
72
|
+
s.add_development_dependency(%q<guard-minitest>, ["~> 2.2"])
|
73
|
+
s.add_development_dependency(%q<terminal-notifier-guard>, ["~> 1.5"])
|
74
|
+
s.add_development_dependency(%q<guard-rubocop>, ["~> 1.0"])
|
75
|
+
else
|
76
|
+
s.add_dependency(%q<oauth2>, ["~> 0.9"])
|
77
|
+
s.add_dependency(%q<multipart-post>, ["~> 2.0"])
|
78
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
79
|
+
s.add_dependency(%q<minitest>, ["~> 5.3"])
|
80
|
+
s.add_dependency(%q<mocha>, ["~> 1.0"])
|
81
|
+
s.add_dependency(%q<simplecov>, ["~> 0.8"])
|
82
|
+
s.add_dependency(%q<rubocop>, ["~> 0.20"])
|
83
|
+
s.add_dependency(%q<rdoc>, ["~> 4.1"])
|
84
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
85
|
+
s.add_dependency(%q<ansi>, ["~> 1.4"])
|
86
|
+
s.add_dependency(%q<minitest-reporters>, ["~> 1.0"])
|
87
|
+
s.add_dependency(%q<vcr>, ["~> 2.9"])
|
88
|
+
s.add_dependency(%q<webmock>, ["~> 1.17"])
|
89
|
+
s.add_dependency(%q<guard>, ["~> 2.6"])
|
90
|
+
s.add_dependency(%q<guard-minitest>, ["~> 2.2"])
|
91
|
+
s.add_dependency(%q<terminal-notifier-guard>, ["~> 1.5"])
|
92
|
+
s.add_dependency(%q<guard-rubocop>, ["~> 1.0"])
|
93
|
+
end
|
94
|
+
else
|
95
|
+
s.add_dependency(%q<oauth2>, ["~> 0.9"])
|
96
|
+
s.add_dependency(%q<multipart-post>, ["~> 2.0"])
|
97
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
98
|
+
s.add_dependency(%q<minitest>, ["~> 5.3"])
|
99
|
+
s.add_dependency(%q<mocha>, ["~> 1.0"])
|
100
|
+
s.add_dependency(%q<simplecov>, ["~> 0.8"])
|
101
|
+
s.add_dependency(%q<rubocop>, ["~> 0.20"])
|
102
|
+
s.add_dependency(%q<rdoc>, ["~> 4.1"])
|
103
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
104
|
+
s.add_dependency(%q<ansi>, ["~> 1.4"])
|
105
|
+
s.add_dependency(%q<minitest-reporters>, ["~> 1.0"])
|
106
|
+
s.add_dependency(%q<vcr>, ["~> 2.9"])
|
107
|
+
s.add_dependency(%q<webmock>, ["~> 1.17"])
|
108
|
+
s.add_dependency(%q<guard>, ["~> 2.6"])
|
109
|
+
s.add_dependency(%q<guard-minitest>, ["~> 2.2"])
|
110
|
+
s.add_dependency(%q<terminal-notifier-guard>, ["~> 1.5"])
|
111
|
+
s.add_dependency(%q<guard-rubocop>, ["~> 1.0"])
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
@@ -0,0 +1,116 @@
|
|
1
|
+
{
|
2
|
+
"app_transaction_id": "00000000001",
|
3
|
+
"billing_provider": {
|
4
|
+
"address_line_1": "418 FARMS DR",
|
5
|
+
"city": "BURLINGTON",
|
6
|
+
"entity_identifier": "Billing Provider",
|
7
|
+
"entity_type": "Non-Person",
|
8
|
+
"id_code": "1730240128",
|
9
|
+
"id_type": "NPI",
|
10
|
+
"last_org_name": "KATIE BRADFORD",
|
11
|
+
"postal_code": "018033744",
|
12
|
+
"provider_code": "Billing",
|
13
|
+
"provider_id_code": "133V00000X",
|
14
|
+
"provider_id_type": "Provider Taxonomy Code",
|
15
|
+
"ref": [
|
16
|
+
{
|
17
|
+
"id_code": "587654321",
|
18
|
+
"id_type": "Employee Identification Number"
|
19
|
+
}
|
20
|
+
],
|
21
|
+
"state": "MA"
|
22
|
+
},
|
23
|
+
"claim": {
|
24
|
+
"assignment_code": "Assigned",
|
25
|
+
"benefit_assignment_code": "Yes",
|
26
|
+
"claim_frequency_code": "1",
|
27
|
+
"claim_total_amount": {
|
28
|
+
"amount": "40.0",
|
29
|
+
"currency": "USD"
|
30
|
+
},
|
31
|
+
"dates": [
|
32
|
+
{
|
33
|
+
"date_qualifier": "Onset of Symptom or Illness",
|
34
|
+
"date_value": "04/15/2014"
|
35
|
+
}
|
36
|
+
],
|
37
|
+
"facility_code_qualifier": "B",
|
38
|
+
"facility_code_value": "11",
|
39
|
+
"health_care_codes": [
|
40
|
+
{
|
41
|
+
"health_care_code_1": "BK:0340",
|
42
|
+
"health_care_code_2": "BF:V7389"
|
43
|
+
}
|
44
|
+
],
|
45
|
+
"information_release_code": "Informed Consent",
|
46
|
+
"patient_control_number": "26462967",
|
47
|
+
"provider_signature_on_file": "Y",
|
48
|
+
"ref": [
|
49
|
+
{
|
50
|
+
"id_code": "1234567890",
|
51
|
+
"id_type": "Claim Number"
|
52
|
+
}
|
53
|
+
],
|
54
|
+
"service_lines": [
|
55
|
+
{
|
56
|
+
"dates": [
|
57
|
+
{
|
58
|
+
"date_qualifier": "Service Date",
|
59
|
+
"date_value": "04/16/2014"
|
60
|
+
}
|
61
|
+
],
|
62
|
+
"medical_charge_amount": {
|
63
|
+
"amount": "40.0",
|
64
|
+
"currency": "USD"
|
65
|
+
},
|
66
|
+
"medical_diagnosis_code": "1",
|
67
|
+
"medical_procedure_identifier": "HC:99213",
|
68
|
+
"medical_service_quantity": "1.0",
|
69
|
+
"medical_service_unit": "Unit"
|
70
|
+
}
|
71
|
+
]
|
72
|
+
},
|
73
|
+
"payer": {
|
74
|
+
"entity_identifier": "Payer",
|
75
|
+
"entity_type": "Non-Person",
|
76
|
+
"id_code": "HPHC",
|
77
|
+
"id_type": "Payor Identification",
|
78
|
+
"last_org_name": "HARVARD PILGRIM HEALTH CARE"
|
79
|
+
},
|
80
|
+
"receiver": {
|
81
|
+
"entity_identifier": "Receiver",
|
82
|
+
"entity_type": "Non-Person",
|
83
|
+
"id_code": "HPHC",
|
84
|
+
"id_type": "ETIN",
|
85
|
+
"last_org_name": "HPHC"
|
86
|
+
},
|
87
|
+
"submitter": {
|
88
|
+
"entity_identifier": "Submitter",
|
89
|
+
"entity_type": "Non-Person",
|
90
|
+
"id_code": "123456789",
|
91
|
+
"id_type": "ETIN",
|
92
|
+
"last_org_name": "ACME, INC."
|
93
|
+
},
|
94
|
+
"subscriber": {
|
95
|
+
"address_line_1": "123 MAIN ST",
|
96
|
+
"birth_date": "Sat May 1 00:00:00 1943",
|
97
|
+
"city": "BURLINGTON",
|
98
|
+
"claim_filing_code": "Health Maintenance Organization",
|
99
|
+
"entity_identifier": "Subscriber",
|
100
|
+
"entity_type": "Person",
|
101
|
+
"first_name": "TED",
|
102
|
+
"gender_code": "Male",
|
103
|
+
"group_number": "12312-A",
|
104
|
+
"id_code": "HP123456700",
|
105
|
+
"id_type": "Member ID",
|
106
|
+
"is_patient": true,
|
107
|
+
"last_org_name": "SMITH",
|
108
|
+
"payer_responsibility": "Primary",
|
109
|
+
"postal_code": "01803",
|
110
|
+
"relationship_code": "Self",
|
111
|
+
"state": "MA"
|
112
|
+
},
|
113
|
+
"trading_partner_id": "MOCKPAYER",
|
114
|
+
"transaction_purpose_code": "Original",
|
115
|
+
"transaction_type": "Reporting"
|
116
|
+
}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
{
|
2
|
+
"action": "Change",
|
3
|
+
"client_id": "x12parse",
|
4
|
+
"correlation_id": "123456789",
|
5
|
+
"deleted": false,
|
6
|
+
"dependents": [],
|
7
|
+
"insert_dt": "Wed Mar 26 22:18:47 2014",
|
8
|
+
"payer": {
|
9
|
+
"tax_id": "654456654"
|
10
|
+
},
|
11
|
+
"purpose": "Original",
|
12
|
+
"reference_number": "12456",
|
13
|
+
"sponsor": {
|
14
|
+
"tax_id": "999888777"
|
15
|
+
},
|
16
|
+
"subscriber": {
|
17
|
+
"address": {
|
18
|
+
"city": "CAMP HILL",
|
19
|
+
"county": "CUMBERLAND",
|
20
|
+
"line": "100 MARKET ST",
|
21
|
+
"line2": "APT 3G",
|
22
|
+
"postal_code": "17011",
|
23
|
+
"state": "PA"
|
24
|
+
},
|
25
|
+
"benefit_status": "Active",
|
26
|
+
"benefits": [
|
27
|
+
{
|
28
|
+
"begin_date": "Sat Jun 1 00:00:00 1996",
|
29
|
+
"benefit_type": "Health",
|
30
|
+
"coordination_of_benefits": [
|
31
|
+
{
|
32
|
+
"group_or_policy_number": "890111",
|
33
|
+
"payer_responsibility": "Primary",
|
34
|
+
"status": "Unknown"
|
35
|
+
}
|
36
|
+
],
|
37
|
+
"late_enrollment": false,
|
38
|
+
"maintenance_type": "Addition"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"begin_date": "Sat Jun 1 00:00:00 1996",
|
42
|
+
"benefit_type": "Dental",
|
43
|
+
"late_enrollment": false,
|
44
|
+
"maintenance_type": "Addition"
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"begin_date": "Sat Jun 1 00:00:00 1996",
|
48
|
+
"benefit_type": "Vision",
|
49
|
+
"late_enrollment": false,
|
50
|
+
"maintenance_type": "Addition"
|
51
|
+
}
|
52
|
+
],
|
53
|
+
"birth_date": "Fri Aug 16 00:00:00 1940",
|
54
|
+
"contacts": [
|
55
|
+
{
|
56
|
+
"communication_number2": "7172341240",
|
57
|
+
"communication_type2": "Work Phone Number",
|
58
|
+
"primary_communication_number": "7172343334",
|
59
|
+
"primary_communication_type": "Home Phone Number"
|
60
|
+
}
|
61
|
+
],
|
62
|
+
"eligibility_begin_date": "Thu May 23 00:00:00 1996",
|
63
|
+
"employment_status": "Full-time",
|
64
|
+
"first_name": "JOHN",
|
65
|
+
"gender": "Male",
|
66
|
+
"group_or_policy_number": "123456001",
|
67
|
+
"handicapped": false,
|
68
|
+
"last_name": "DOE",
|
69
|
+
"maintenance_reason": "Active",
|
70
|
+
"maintenance_type": "Addition",
|
71
|
+
"member_id": "123456789",
|
72
|
+
"middle_name": "P",
|
73
|
+
"relationship": "Self",
|
74
|
+
"ssn": "123456789",
|
75
|
+
"subscriber_number": "123456789",
|
76
|
+
"substance_abuse": false,
|
77
|
+
"tobacco_use": false
|
78
|
+
},
|
79
|
+
"trading_partner_id": "MOCKPAYER",
|
80
|
+
"update_dt": "Wed Mar 26 22:18:47 2014"
|
81
|
+
}
|
@@ -0,0 +1,131 @@
|
|
1
|
+
ISA*00* *00* *30*SENDER *30*RECEIVER *140305*1953*^*00501*000000905*0*T*:~
|
2
|
+
GS*HS*SENDER_ID*RECEIVER_ID*20140305*1953*CONTROL_ID*X*005010X279A1~
|
3
|
+
ST*270*0001*005010X279A1~
|
4
|
+
BHT*0022*13*813785794*20140305*1953~
|
5
|
+
HL*1**20*1~
|
6
|
+
NM1*PR*2*MOCKPAYER*****PI*MOCKPAYER~
|
7
|
+
HL*2*1*21*1~
|
8
|
+
NM1*1P*2*Wuckert Inc*****XX*581603684~
|
9
|
+
HL*3*2*22*0~
|
10
|
+
TRN*1*181399807*9324422845~
|
11
|
+
NM1*IL*1*Tromp*Jerod****MI*545943979~
|
12
|
+
DMG*D8*19960507~
|
13
|
+
DTP*291*D8*20140305~
|
14
|
+
EQ*30~
|
15
|
+
HL*4*2*22*0~
|
16
|
+
TRN*1*611822238*9324422845~
|
17
|
+
NM1*IL*1*Walker*Hassan****MI*773415451~
|
18
|
+
DMG*D8*19960613~
|
19
|
+
DTP*291*D8*20140305~
|
20
|
+
EQ*30~
|
21
|
+
HL*5*2*22*0~
|
22
|
+
TRN*1*530994264*9324422845~
|
23
|
+
NM1*IL*1*Johns*Cathrine****MI*505837362~
|
24
|
+
DMG*D8*19881001~
|
25
|
+
DTP*291*D8*20140305~
|
26
|
+
EQ*30~
|
27
|
+
HL*6*2*22*0~
|
28
|
+
TRN*1*145769779*9324422845~
|
29
|
+
NM1*IL*1*Durgan*Stephon****MI*204791243~
|
30
|
+
DMG*D8*19830509~
|
31
|
+
DTP*291*D8*20140305~
|
32
|
+
EQ*30~
|
33
|
+
HL*7*2*22*0~
|
34
|
+
TRN*1*853276515*9324422845~
|
35
|
+
NM1*IL*1*Erdman*Bartholome****MI*994176438~
|
36
|
+
DMG*D8*19930513~
|
37
|
+
DTP*291*D8*20140305~
|
38
|
+
EQ*30~
|
39
|
+
HL*8*2*22*0~
|
40
|
+
TRN*1*392506326*9324422845~
|
41
|
+
NM1*IL*1*Padberg*Kaci****MI*331914222~
|
42
|
+
DMG*D8*19920730~
|
43
|
+
DTP*291*D8*20140305~
|
44
|
+
EQ*30~
|
45
|
+
HL*9*2*22*0~
|
46
|
+
TRN*1*669106647*9324422845~
|
47
|
+
NM1*IL*1*Donnelly*Kyleigh****MI*461763996~
|
48
|
+
DMG*D8*19890712~
|
49
|
+
DTP*291*D8*20140305~
|
50
|
+
EQ*30~
|
51
|
+
HL*10*2*22*0~
|
52
|
+
TRN*1*915888295*9324422845~
|
53
|
+
NM1*IL*1*Monahan*Jimmie****MI*315531994~
|
54
|
+
DMG*D8*19950414~
|
55
|
+
DTP*291*D8*20140305~
|
56
|
+
EQ*30~
|
57
|
+
HL*11*2*22*0~
|
58
|
+
TRN*1*924598474*9324422845~
|
59
|
+
NM1*IL*1*Bednar*Markus****MI*674957204~
|
60
|
+
DMG*D8*19780109~
|
61
|
+
DTP*291*D8*20140305~
|
62
|
+
EQ*30~
|
63
|
+
HL*12*2*22*0~
|
64
|
+
TRN*1*218563674*9324422845~
|
65
|
+
NM1*IL*1*McCullough*Leland****MI*789318226~
|
66
|
+
DMG*D8*19800202~
|
67
|
+
DTP*291*D8*20140305~
|
68
|
+
EQ*30~
|
69
|
+
HL*13*2*22*0~
|
70
|
+
TRN*1*764225581*9324422845~
|
71
|
+
NM1*IL*1*Macejkovic*Norwood****MI*605486216~
|
72
|
+
DMG*D8*19890726~
|
73
|
+
DTP*291*D8*20140305~
|
74
|
+
EQ*30~
|
75
|
+
HL*14*2*22*0~
|
76
|
+
TRN*1*843675248*9324422845~
|
77
|
+
NM1*IL*1*Ortiz*Keyon****MI*178470414~
|
78
|
+
DMG*D8*19920126~
|
79
|
+
DTP*291*D8*20140305~
|
80
|
+
EQ*30~
|
81
|
+
HL*15*2*22*0~
|
82
|
+
TRN*1*575530276*9324422845~
|
83
|
+
NM1*IL*1*Doyle*Olin****MI*727454392~
|
84
|
+
DMG*D8*19890922~
|
85
|
+
DTP*291*D8*20140305~
|
86
|
+
EQ*30~
|
87
|
+
HL*16*2*22*0~
|
88
|
+
TRN*1*583253119*9324422845~
|
89
|
+
NM1*IL*1*Doyle*Greg****MI*302952193~
|
90
|
+
DMG*D8*19890228~
|
91
|
+
DTP*291*D8*20140305~
|
92
|
+
EQ*30~
|
93
|
+
HL*17*2*22*0~
|
94
|
+
TRN*1*494693024*9324422845~
|
95
|
+
NM1*IL*1*Brekke*Nathanial****MI*228065686~
|
96
|
+
DMG*D8*19910131~
|
97
|
+
DTP*291*D8*20140305~
|
98
|
+
EQ*30~
|
99
|
+
HL*18*2*22*0~
|
100
|
+
TRN*1*654387679*9324422845~
|
101
|
+
NM1*IL*1*Herzog*Jayme****MI*653618078~
|
102
|
+
DMG*D8*19871017~
|
103
|
+
DTP*291*D8*20140305~
|
104
|
+
EQ*30~
|
105
|
+
HL*19*2*22*0~
|
106
|
+
TRN*1*864981376*9324422845~
|
107
|
+
NM1*IL*1*Ebert*Heaven****MI*548879156~
|
108
|
+
DMG*D8*19930416~
|
109
|
+
DTP*291*D8*20140305~
|
110
|
+
EQ*30~
|
111
|
+
HL*20*2*22*0~
|
112
|
+
TRN*1*618055454*9324422845~
|
113
|
+
NM1*IL*1*Cummerata*Hector****MI*688306042~
|
114
|
+
DMG*D8*19780613~
|
115
|
+
DTP*291*D8*20140305~
|
116
|
+
EQ*30~
|
117
|
+
HL*21*2*22*0~
|
118
|
+
TRN*1*608414882*9324422845~
|
119
|
+
NM1*IL*1*Kerluke*Enola****MI*687416329~
|
120
|
+
DMG*D8*19960902~
|
121
|
+
DTP*291*D8*20140305~
|
122
|
+
EQ*30~
|
123
|
+
HL*22*2*22*0~
|
124
|
+
TRN*1*568364627*9324422845~
|
125
|
+
NM1*IL*1*Wehner*Alyce****MI*728313788~
|
126
|
+
DMG*D8*19701130~
|
127
|
+
DTP*291*D8*20140305~
|
128
|
+
EQ*30~
|
129
|
+
SE*127*0001~
|
130
|
+
GE*1*CONTROL_ID~
|
131
|
+
IEA*1*000000905~
|
@@ -0,0 +1,168 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
CLIENT_ID = '4nhMZTpLxBxmiocveVb5'
|
6
|
+
CLIENT_SECRET = 'HUIpG9fFf9Qku9mh0lO50SPSDiju3D9Cjx17oeCN'
|
7
|
+
POKITDOK_TEST_URL = 'http://localhost:5002/api/v3'
|
8
|
+
|
9
|
+
def check_meta_and_data(result)
|
10
|
+
refute_empty result['meta']
|
11
|
+
refute_empty result['data']
|
12
|
+
end
|
13
|
+
|
14
|
+
describe PokitDok do
|
15
|
+
describe 'Authenticated functions' do
|
16
|
+
before do
|
17
|
+
PokitDok::PokitDok.any_instance.stubs(:api_url)
|
18
|
+
.returns(POKITDOK_TEST_URL)
|
19
|
+
VCR.use_cassette 'auth' do
|
20
|
+
@pokitdok = PokitDok::PokitDok.new(CLIENT_ID, CLIENT_SECRET)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'should instantiate with a client id and client secret' do
|
25
|
+
refute_nil(@pokitdok, 'New PokitDok was nil.')
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should authenticate on a new connection' do
|
29
|
+
refute_nil @pokitdok.client
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should refresh the connection if it expires' do
|
33
|
+
skip 'Not implemented'
|
34
|
+
end
|
35
|
+
|
36
|
+
describe 'Activities endpoint' do
|
37
|
+
it 'should expose the activities endpoint' do
|
38
|
+
VCR.use_cassette 'activities' do
|
39
|
+
@activities = @pokitdok.activities
|
40
|
+
end
|
41
|
+
|
42
|
+
check_meta_and_data @activities
|
43
|
+
refute_empty @activities['data']
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe 'Cash Prices endpoint' do
|
48
|
+
it 'is unimplemented' do
|
49
|
+
proc { @pokitdok.cash_prices }.must_raise(NotImplementedError)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe 'Claims endpoint' do
|
54
|
+
it 'should expose the claims endpoint' do
|
55
|
+
query = JSON.parse(IO.read('spec/fixtures/claim.json'))
|
56
|
+
VCR.use_cassette 'claims' do
|
57
|
+
@claim = @pokitdok.claims(query)
|
58
|
+
end
|
59
|
+
|
60
|
+
check_meta_and_data @claim
|
61
|
+
refute_empty @claim['data']
|
62
|
+
@claim['data']['units_of_work'].must_equal 1
|
63
|
+
assert_nil @claim['errors']
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
describe 'Claims Status endpoint' do
|
68
|
+
it 'is unimplemented' do
|
69
|
+
proc { @pokitdok.claim_status }.must_raise(NotImplementedError)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
describe 'Deductible endpoint' do
|
74
|
+
it 'is unimplemented' do
|
75
|
+
proc { @pokitdok.deductible }.must_raise(NotImplementedError)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
describe 'Eligibility endpoint' do
|
80
|
+
it 'should expose the eligibility endpoint' do
|
81
|
+
@eligibility_query = {
|
82
|
+
trading_partner_id: 'MOCKPAYER',
|
83
|
+
member_id: 'W34237875729',
|
84
|
+
provider_id: '1467560003',
|
85
|
+
provider_name: 'AYA-AY',
|
86
|
+
provider_first_name: 'JEROME',
|
87
|
+
provider_type: 'Person',
|
88
|
+
member_name: 'JOHN DOE',
|
89
|
+
member_birth_date: '05-21-1975',
|
90
|
+
service_types: ['Health Benefit Plan Coverage']
|
91
|
+
}
|
92
|
+
|
93
|
+
VCR.use_cassette 'eligibility' do
|
94
|
+
@eligibility = @pokitdok.eligibility(@eligibility_query)
|
95
|
+
end
|
96
|
+
|
97
|
+
check_meta_and_data @eligibility
|
98
|
+
refute_nil @eligibility['data']
|
99
|
+
assert_nil @eligibility['data']['errors']
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
describe 'Enrollment endpoint' do
|
104
|
+
it 'should expose the enrollment endpoint' do
|
105
|
+
query = JSON.parse(IO.read('spec/fixtures/enrollment.json'))
|
106
|
+
|
107
|
+
VCR.use_cassette 'enrollment' do
|
108
|
+
@enrollment = @pokitdok.enrollment(query)
|
109
|
+
end
|
110
|
+
|
111
|
+
check_meta_and_data @enrollment
|
112
|
+
@enrollment['data']['units_of_work'].must_equal 1
|
113
|
+
assert_nil @enrollment['data']['errors']
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
describe 'Files endpoint' do
|
118
|
+
it 'should expose the files endpoint' do
|
119
|
+
VCR.use_cassette 'files' do
|
120
|
+
@response = @pokitdok.files('MOCKPAYER',
|
121
|
+
'spec/fixtures/sample.270')
|
122
|
+
end
|
123
|
+
|
124
|
+
check_meta_and_data @response
|
125
|
+
refute_nil @response
|
126
|
+
# TODO: should get back an activity id
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
describe 'Insurance Prices endpoint' do
|
131
|
+
it 'should expose the insurance prices endpoint' do
|
132
|
+
VCR.use_cassette 'insurance_prices' do
|
133
|
+
@prices = @pokitdok.insurance_prices(zip_code: '54321',
|
134
|
+
cpt_code: '12345')
|
135
|
+
end
|
136
|
+
|
137
|
+
check_meta_and_data @prices
|
138
|
+
refute_empty @prices['data']
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
describe 'Payers endpoint' do
|
143
|
+
it 'should expose the payers endpoint' do
|
144
|
+
VCR.use_cassette 'payers' do
|
145
|
+
@payers = @pokitdok.payers(state: 'CA')
|
146
|
+
end
|
147
|
+
|
148
|
+
check_meta_and_data @payers
|
149
|
+
refute_nil @payers['data']
|
150
|
+
@payers['data'].size.must_equal 36
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
describe 'Providers endpoint' do
|
155
|
+
it 'should expose the providers endpoint' do
|
156
|
+
query = { state: 'CA' }
|
157
|
+
|
158
|
+
VCR.use_cassette 'providers' do
|
159
|
+
@providers = @pokitdok.providers(query)
|
160
|
+
end
|
161
|
+
|
162
|
+
check_meta_and_data @providers
|
163
|
+
refute_nil @providers['data']
|
164
|
+
@providers['data'].size.must_equal 20
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|