Module: Trizetto::Api::Eligibility::WebService::Rejectable

Included in:
InfoReceiver, InfoSource, Subscriber
Defined in:
lib/trizetto/api/eligibility/web_service/rejectable.rb

Overview

Rejections appear in a few places in the eligibility response. Any node that can have a rejection should prepend this module

Example

class InfoReciever < Node
  prepend Rejectable
end

Example XML

<infosource>
  <rejection>
    <rejectreason>Unable to Respond at Current Time</rejectreason>
    <followupaction>Resubmission Allowed</followupaction>
  </rejection>
<i/nfosource>

Example XML

<inforeceiver>
  <rejection>
    <rejectreason>Provider Not on File</rejectreason>
    <followupaction>Please Correct and Resubmit</followupaction>
  </rejection>
</inforeceiver>

Example XML

<subscriber>
  <rejection>
    <rejectreason>Invalid/Missing Subscriber/Insured Name</rejectreason>
    <followupaction>Please Correct and Resubmit</followupaction>
  </rejection>
  <rejection>
    <rejectreason>Patient Birth Date Does Not Match That for the Patient on the Database</rejectreason>
    <followupaction>Please Correct and Resubmit</followupaction>
  </rejection>
</subscriber>

Instance Method Summary collapse

Instance Method Details

#after_inititlize(hash) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/trizetto/api/eligibility/web_service/rejectable.rb', line 43

def after_inititlize(hash)
  super(hash)

  # This is in an openstruct and after inititalize, :rejection in the
  # hash will have created an accessor, so nil that out here, we're using
  # rejections (plural) not rejection (singular)
  self.rejection = nil

  rejections_xml = hash[:rejection] || []
  rejections_xml = [rejections_xml] if rejections_xml.is_a?(Hash)

  self.rejections = rejections_xml.map do |rejection_xml|
    Rejection.new(rejection_xml).tap {|r| r.source = self }
  end
end