Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack Level Too Deep in do_inquiry_response.rb #1

Open
bopritchard-admin opened this issue Oct 31, 2018 · 7 comments
Open

Stack Level Too Deep in do_inquiry_response.rb #1

bopritchard-admin opened this issue Oct 31, 2018 · 7 comments

Comments

@bopritchard-admin
Copy link

First off, I love the gem. Has saved me a world of work.
Works wonderfully up until Trizetto responds with a data failure of some sort.

For instance, if I pass an invalid NPI, when I go to render the response I get a
"SystemStackError (stack level too deep):" error.

I traced it back to do_inquiry_response.rb#137
Maybe it has something to do with rejectable and rejection

This make any sense? do you have any insight on it?
Thanks

@johnnaegle
Copy link
Contributor

Can you strip out PHI of the response XML and share it? I can investigate from there.

@bopritchard-admin
Copy link
Author

bopritchard-admin commented Nov 1, 2018

I really appreciate you looking at this. Is this what you needed?

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <DoInquiryResponse xmlns="GatewayEDI.WebServices">
      <DoInquiryResult>
        <ResponseAsXml>&lt;eligibilityresponse&gt;&lt;infosource&gt;&lt;transactionid&gt;d74036e36641228c7f11800b9ae493&lt;/transactionid&gt;&lt;payername&gt;AETNA
          INC&lt;/payername&gt;&lt;payerid&gt;953402799&lt;/payerid&gt;&lt;/infosource&gt;&lt;inforeceiver&gt;&lt;rejection&gt;&lt;rejectreason&gt;Invalid/Missing Provider Identification&lt;/rejectreason&gt;&lt;followupaction&gt;Please Correct and
          Resubmit&lt;/followupaction&gt;&lt;/rejection&gt;&lt;providername&gt;&lt;last&gt;KNIGHTDALE FAMILY
          MEDICINE&lt;/last&gt;&lt;/providername&gt;&lt;npi&gt;1154305549&lt;/npi&gt;&lt;/inforeceiver&gt;&lt;subscriber&gt;&lt;trace_number&gt;1319724445&lt;/trace_number&gt;&lt;trace_id&gt;99Trizetto&lt;/trace_id&gt;&lt;date&gt;&lt;datequalifier&gt;Service&lt;/datequalifier&gt;&lt;date-of-service&gt;20181101&lt;/date-of-service&gt;&lt;/date&gt;&lt;patientname&gt;&lt;first&gt;XXXXX&lt;/first&gt;&lt;last&gt;XXXXX&lt;/last&gt;&lt;/patientname&gt;&lt;patientid&gt;WXXXX
          XXXXX&lt;/patientid&gt;&lt;sex&gt;Female&lt;/sex&gt;&lt;date-of-birth&gt;19690525&lt;/date-of-birth&gt;&lt;/subscriber&gt;&lt;/eligibilityresponse&gt;</ResponseAsXml>
        <ExtraProcessingInfo><AllMessages/><Failures/></ExtraProcessingInfo>
        <SuccessCode>Success</SuccessCode>
        <OriginalInquiry>
          <Parameters>
            <MyNameValue>
              <Name>ProviderLastName</Name>
              <Value>knightdale family medicine</Value>
            </MyNameValue>
            <MyNameValue>
              <Name>NPI</Name>
              <Value>1154305549</Value>
            </MyNameValue>
            <MyNameValue>
              <Name>InsuranceNum</Name>
              <Value>WXXXX XXXXX</Value>
            </MyNameValue>
            <MyNameValue>
              <Name>InsuredFirstName</Name>
              <Value>XXXXX</Value>
            </MyNameValue>
            <MyNameValue>
              <Name>InsuredLastName</Name>
              <Value>XXXXX</Value>
            </MyNameValue>
            <MyNameValue>
              <Name>InsuredDob</Name>
              <Value>19690525</Value>
            </MyNameValue>
            <MyNameValue>
              <Name>GediPayerId</Name>
              <Value>60054</Value>
            </MyNameValue>
          </Parameters>
          <ResponseDataType>Xml</ResponseDataType>
        </OriginalInquiry>
      </DoInquiryResult>
    </DoInquiryResponse>
  </soap:Body>
</soap:Envelope>```

@johnnaegle
Copy link
Contributor

It looks like this was a submission to Aetna with an invalid NPI. When I perform the same request, I get back errors. I turned the XML you provided into a test case and added one of my own.

Here is one of the fixtures that gets parsed:

And the test

I was using this client code to test an invalid NPI submission. Does this look similar to what you are doing? What does your client code look like that handles the error?

require 'trizetto/api'

Trizetto::Api.configure do |config|
  config.username = ENV['TRIZETTO_USERNAME']
  config.password = ENV['TRIZETTO_PASSWORD']
end

client = Trizetto::Api::Eligibility::WebService::Client.new({
  # You probably don't want logging enable unless you are being very careful to protect PHI in logs
  pretty_print_xml: true,
  log: true,
  log_level: :debug,
})

response = client.do_inquiry({
  'ProviderLastName': 'NaughtyMeasures',
  'NPI':              '1427487917'.reverse,
  'InsuredFirstName': 'Mickey',
  'InsuredLastName':  'Mouse',
  'InsuredDob':       '11281928',
  'GediPayerId':      '60054',
})

@bopritchard-admin
Copy link
Author

Yes, that's what my code looks like.
I get the error when rendering to JSON.

you can see it if you response.info_receiver.to_json

@johnnaegle
Copy link
Contributor

I'm not sure what is going on, with the response you provided, I get this

(byebug) response.info_receiver
#<Trizetto::Api::Eligibility::WebService::InfoReceiver rejection=nil, providername={:last=>"KNIGHTDALE FAMILY MEDICINE"}, npi="1154305549", rejections=[#<Trizetto::Api::Eligibility::WebService::Rejection reason="Invalid/Missing Provider Identification", follow_up_action="Please Correct and Resubmit">]>

(byebug) response.info_receiver.to_json
nil

(byebug) response.info_receiver.rejections
[#<Trizetto::Api::Eligibility::WebService::Rejection reason="Invalid/Missing Provider Identification", follow_up_action="Please Correct and Resubmit">]

(byebug) response.info_receiver.rejections.first.reason
"Invalid/Missing Provider Identification"

(byebug) response.info_receiver.rejections.first.follow_up_action
"Please Correct and Resubmit"

@bopritchard-admin
Copy link
Author

bopritchard-admin commented Nov 1, 2018

include the parameter 'InsuredDob': '19501231', and you should see it

response = client.do_inquiry({
  'ProviderLastName': 'NaughtyMeasures',
  'NPI':              '1427487917'.reverse,
  'InsuredFirstName': 'mickey',
  'InsuredLastName':  'mouse',
  'InsuredDob':       '19501231',
  'GediPayerId':      '60054',
})
response.info_receiver.to_json

should throw the stack level error

btw, thanks for bearing with me, i know I could've provided more concise examples...sorry

@johnnaegle
Copy link
Contributor

I wasn't able to reproduce it - the info receiver comes back with expected errors. to_json isn't implemented on the info_receiver object. If you can provide a failing test case, I can take it from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants