Class: DaVinciPASTestKit::DaVinciPASV201::ClaimInquiryOperationTest

Inherits:
Inferno::Test
  • Object
show all
Defined in:
lib/davinci_pas_test_kit/generated/v2.0.1/claim_inquiry/claim_inquiry_operation_test.rb

Instance Method Summary collapse

Instance Method Details

#perform_operation(request_payload) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/davinci_pas_test_kit/generated/v2.0.1/claim_inquiry/claim_inquiry_operation_test.rb', line 33

def perform_operation(request_payload)
  
  fhir_operation('/Claim/$inquire', body: request_payload, name: :pa_inquire)
  
  assert_response_status([200, 201])
  assert_valid_json(request.response_body)

  # Save request/response pair
  scratch_resources[:all] ||= []
  scratch_resources[:all] << {request_bundle: request.request_body, response_bundle: resource}
  
end

#request_bundlesObject



28
29
30
31
# File 'lib/davinci_pas_test_kit/generated/v2.0.1/claim_inquiry/claim_inquiry_operation_test.rb', line 28

def request_bundles
  parsed_payload = JSON.parse(pa_inquire_request_payload)
  [parsed_payload].flatten.compact.uniq
end

#scratch_resourcesObject



24
25
26
# File 'lib/davinci_pas_test_kit/generated/v2.0.1/claim_inquiry/claim_inquiry_operation_test.rb', line 24

def scratch_resources
  scratch[:inquire_request_response_pair] ||= {}
end