trizetto-api 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6df121190be3fbb4983fc36e4864672f63e6d8c5
4
+ data.tar.gz: f88c0595014114ef36f32ea4557bfc69914e9463
5
+ SHA512:
6
+ metadata.gz: 68a2927c711b81b8be339e1778275150a0b1021350eeee765401221468a01f590362368e821f9766a0ee5cf0355f6bc6154f30ae22e8895f0a7c169085239b05
7
+ data.tar.gz: 663f796bee4042a478ca13e5db2b3080ff28f390219253725ff88841a591b132b597ff808875c411756eb00a8a55d62097f910b7497e9b5ba7471cdd328b08cd
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ before_install: gem install bundler -v 1.16.0
@@ -0,0 +1,10 @@
1
+ ## 0.1.1 (January 11, 2018) ##
2
+
3
+ * Initial implementation of 5 Trizetto API endpoints: Eligibility check with
4
+ CORE II, Eligibility check via web service, ping the service, download the
5
+ payer list, and get a document link to an enrollment form.
6
+ * Current implementation is just a thin wrapper - you will have to parse the result
7
+ * No X12 serialization/deserization yet - you must craft and decode X12 messages
8
+ to use the eligibility API
9
+ * The payer list endpoint seems to either timeout or error on the Trizetto Server
10
+
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at john.naegle@goodmeasures.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in trizetto-api.gemspec
6
+ gemspec
@@ -0,0 +1,74 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ trizetto-api (0.1.1)
5
+ savon (~> 2.0)
6
+ savon-multipart (~> 2.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ akami (1.3.1)
12
+ gyoku (>= 0.4.0)
13
+ nokogiri
14
+ builder (3.2.3)
15
+ diff-lcs (1.3)
16
+ gyoku (1.3.1)
17
+ builder (>= 2.1.2)
18
+ httpi (2.4.2)
19
+ rack
20
+ socksify
21
+ mail (2.5.5)
22
+ mime-types (~> 1.16)
23
+ treetop (~> 1.4.8)
24
+ mime-types (1.25.1)
25
+ mini_portile2 (2.3.0)
26
+ nokogiri (1.8.1)
27
+ mini_portile2 (~> 2.3.0)
28
+ nori (2.6.0)
29
+ polyglot (0.3.5)
30
+ rack (2.0.3)
31
+ rake (10.5.0)
32
+ rspec (3.7.0)
33
+ rspec-core (~> 3.7.0)
34
+ rspec-expectations (~> 3.7.0)
35
+ rspec-mocks (~> 3.7.0)
36
+ rspec-core (3.7.1)
37
+ rspec-support (~> 3.7.0)
38
+ rspec-expectations (3.7.0)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.7.0)
41
+ rspec-mocks (3.7.0)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.7.0)
44
+ rspec-support (3.7.0)
45
+ savon (2.11.2)
46
+ akami (~> 1.2)
47
+ builder (>= 2.1.2)
48
+ gyoku (~> 1.2)
49
+ httpi (~> 2.3)
50
+ nokogiri (>= 1.4.0)
51
+ nori (~> 2.4)
52
+ wasabi (~> 3.4)
53
+ savon-multipart (2.1.1)
54
+ mail (~> 2.5.4)
55
+ savon (~> 2)
56
+ socksify (1.7.1)
57
+ treetop (1.4.15)
58
+ polyglot
59
+ polyglot (>= 0.3.1)
60
+ wasabi (3.5.0)
61
+ httpi (~> 2.0)
62
+ nokogiri (>= 1.4.2)
63
+
64
+ PLATFORMS
65
+ ruby
66
+
67
+ DEPENDENCIES
68
+ bundler (~> 1.16)
69
+ rake (~> 10.0)
70
+ rspec (~> 3.0)
71
+ trizetto-api!
72
+
73
+ BUNDLED WITH
74
+ 1.16.0
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 John Naegle
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,122 @@
1
+ # Trizetto::Api
2
+
3
+ Ruby wrapper for Trizetto APIs
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'trizetto-api'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install trizetto-api
20
+
21
+ ## Usage
22
+
23
+ ### Use the CORE2 API with an X12 payload to check eligibility in realtime
24
+
25
+ ```ruby
26
+
27
+ require 'trizetto/api'
28
+
29
+ Trizetto::Api.configure do |config|
30
+ config.username = 'Not the real username'
31
+ config.password = 'Super Top Secret'
32
+ end
33
+
34
+
35
+ client = Trizetto::Api::Eligibility::Core2.new
36
+ client.check_eligibility(payload: x12_message)
37
+ ```
38
+
39
+ ### Use the Eligibility Web Service with an XML payload to check eligibility in realtime
40
+
41
+ ```ruby
42
+ require 'trizetto/api'
43
+
44
+ Trizetto::Api.configure do |config|
45
+ config.username = 'Not the real username'
46
+ config.password = 'Super Top Secret'
47
+ end
48
+
49
+
50
+ client = Trizetto::Api::Eligibility::WebService.new({
51
+ pretty_print_xml: true,
52
+ log: true,
53
+ log_level: :debug,
54
+ })
55
+ response = client.do_inquiry({
56
+ 'ProviderLastName': 'BLUE CROSS BLUE SHIELD OF MASSACHUSETTS',
57
+ 'NPI': 'YOUR NPI HERE',
58
+ 'InsuredFirstName': 'Mickey',
59
+ 'InsuredLastName': 'Mouse',
60
+ 'InsuredDob': '19281118',
61
+ 'GediPayerId': 'N4222',
62
+ })
63
+ ```
64
+
65
+
66
+ ### Ping the Payer List endpoint to see if it is up
67
+
68
+ ```ruby
69
+ require 'trizetto/api'
70
+
71
+ Trizetto::Api.configure do |config|
72
+ config.username = 'Not the real username'
73
+ config.password = 'Super Top Secret'
74
+ end
75
+
76
+ client = Trizetto::Api::PayerList::WebService.new({
77
+ pretty_print_xml: true,
78
+ log: true,
79
+ log_level: :debug,
80
+ })
81
+
82
+ response = client.ping
83
+ ```
84
+
85
+ ### Fetch the Payer List
86
+
87
+ ```ruby
88
+ require 'trizetto/api'
89
+
90
+ Trizetto::Api.configure do |config|
91
+ config.username = 'Not the real username'
92
+ config.password = 'Super Top Secret'
93
+ end
94
+
95
+ client = Trizetto::Api::PayerList::WebService.new({
96
+ pretty_print_xml: true,
97
+ log: true,
98
+ log_level: :debug,
99
+ read_timeout: 60*5 # 5 minutes
100
+ })
101
+
102
+ response = client.payer_list
103
+
104
+ ```
105
+
106
+ ## Development
107
+
108
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
109
+
110
+ 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).
111
+
112
+ ## Contributing
113
+
114
+ Bug reports and pull requests are welcome on GitHub at https://github.com/GoodMeasuresLLC/trizetto-api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
115
+
116
+ ## License
117
+
118
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
119
+
120
+ ## Code of Conduct
121
+
122
+ Everyone interacting in the Trizetto::Api project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/GoodMeasuresLLC/trizetto-api/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "trizetto/api"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,6 @@
1
+ require "trizetto/api/version"
2
+ require "trizetto/api/configuration"
3
+ require "trizetto/api/web_service"
4
+
5
+ require "trizetto/api/eligibility"
6
+ require "trizetto/api/payer_list/web_service"
@@ -0,0 +1,25 @@
1
+ module Trizetto
2
+ module Api
3
+ class << self
4
+ attr_accessor :configuration
5
+ end
6
+
7
+ def self.configure
8
+ self.configuration ||= Configuration.new
9
+ yield(configuration)
10
+ end
11
+
12
+ class Configuration
13
+ attr_accessor :username
14
+ attr_accessor :password
15
+ attr_accessor :eligibility_core2_endpoint
16
+ attr_accessor :eligibiltiy_webservice_endpoint
17
+ attr_accessor :payer_list_webservice_endpoint
18
+ def initialize
19
+ @eligibility_core2_endpoint = "https://api.gatewayedi.com/v2/CORE_CAQH/soap"
20
+ @eligibiltiy_webservice_endpoint = "https://services.gatewayedi.com/eligibility/service.asmx"
21
+ @payer_list_webservice_endpoint = "https://services.gatewayedi.com/PayerList/PayerList.asmx"
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,3 @@
1
+ require "trizetto/api/eligibility/core2"
2
+ require "trizetto/api/eligibility/web_service"
3
+
@@ -0,0 +1,98 @@
1
+ require 'savon-multipart'
2
+
3
+ module Trizetto
4
+ module Api
5
+ module Eligibility
6
+
7
+ # Ruby Wrapper for the CORE II Eligibility API
8
+ #
9
+ # Performs a real-time eligibility check using the CORE II SOAP API. This
10
+ # API provides an X12/270 request and receives an X12/271 response.
11
+ #
12
+ # As of right now, you have to generate the correct X12/271 payload.
13
+ #
14
+ # See Also
15
+ #
16
+ # - Eligibility 270/271 Companion Guide: https://mytools.gatewayedi.com/webcontent/Eligibility_Companion_Guide.pdf
17
+ #
18
+ class Core2
19
+ def initialize(options={})
20
+ @client = Savon.client({
21
+ # We use a local WSDL for 1) speed and 2) the remote wsdl had a target
22
+ # namespace that Savon consumed (SOAP UI did not). I changed
23
+ # targetNamespace in the WSDL to "http://www.caqh.org/SOAP/WSDL/CORERule2.2.0.xsd"
24
+ # from "http://www.caqh.org/SOAP/WSDL/". With that one simple change,
25
+ # Savon is able to generate a SOAP requests that Trizetto accepts.
26
+ # without that, you get back a 500 error and no information giving
27
+ # insite into the error.
28
+ wsdl: File.join( File.dirname(__FILE__), 'core2.wsdl' ),
29
+
30
+ endpoint: Trizetto::Api.configuration.eligibility_core2_endpoint,
31
+
32
+ # Digest authentication is not supported :(
33
+ wsse_auth: [Trizetto::Api.configuration.username, Trizetto::Api.configuration.password],
34
+
35
+ # SOAP Version 1 sends the wrong content type header and you get back a 415 response
36
+ soap_version: 2,
37
+
38
+ # API maybe case sensitive - im not sure
39
+ convert_request_keys_to: :camelcase,
40
+
41
+ # This removes the namespace prefix in the request body nodes
42
+ # <CORE-XSD:PayloadType>X12_270_Request_005010X279A1</CORE-XSD:PayloadType>
43
+ # becomes:
44
+ # <PayloadType>X12_270_Request_005010X279A1</PayloadType>
45
+ # Without this option, you get back erros like: Payload Type Required
46
+ element_form_default: :unqualified,
47
+
48
+ # Lots of PHI, so lets not log anything
49
+ log: false,
50
+
51
+ # We get back multipart responses. You have to tell Savon that its
52
+ # multipart, it doesn't just figure it out
53
+ multipart: true,
54
+
55
+ }.merge(options))
56
+ end
57
+
58
+
59
+ # TODO: Understand the X12 format and allow options to be passed in, then generate the X12 message
60
+ #
61
+ # Required Field:
62
+ # +ProviderLastName+ - Provider Last Name/Organization Name
63
+ # +NPI+ - National Provider Identifier
64
+ #
65
+ # Situational Fields:
66
+ #
67
+ # +ProviderFirstName+ - Provider First Name
68
+ # +InsuredFirstName+ - Subscriber First Name
69
+ # +InsuredLastName+ - Subscriber Last Name
70
+ # +InsuranceNum+ - Subscriber Id
71
+ # +InsuredDob+ - Subscriber DOB
72
+ # +InsuredGender+ - Subscriber Gender
73
+ # +DependentFirstName+ - Dependent First Name
74
+ # +DependentLastName+ - Dependent Last Name
75
+ # +DependentDob+ - Dependent DOB
76
+ # +DependentGender+ - Dependent Gender
77
+ #
78
+ # Note: Some payers require additional information than those listed above. Please refer to the
79
+ # companion guide for the additional parameters required by few payers. A valid inquiry submitted
80
+ # to those payers must also account for the additional payer specific parameters. “InsuranceNum,” in
81
+ # particular, is not a required field for all transactions, but is required by almost all payers.
82
+ #
83
+ def check_eligibility(options = {})
84
+ @client.call(:real_time_transaction, message: {
85
+ 'PayloadType': 'X12_270_Request_005010X279A1',
86
+ 'ProcessingMode': 'RealTime',
87
+ 'PayloadID': SecureRandom.uuid,
88
+ 'TimeStamp': Time.now.utc.xmlschema,
89
+ 'SenderID': Trizetto::Api.configuration.username,
90
+ 'ReceiverID': 'GATEWAY EDI',
91
+ 'CORERuleVersion': '2.2.0',
92
+ 'Payload': options[:payload]
93
+ });
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end