Class: DaVinciDTRTestKit::LightEHRSupportedPayerEndpoint

Inherits:
Inferno::DSL::SuiteEndpoint
  • Object
show all
Defined in:
lib/davinci_dtr_test_kit/endpoints/mock_payer/light_ehr_supported_payer_endpoint.rb

Instance Method Summary collapse

Instance Method Details

#make_responseObject



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/davinci_dtr_test_kit/endpoints/mock_payer/light_ehr_supported_payer_endpoint.rb', line 17

def make_response
  user_response = JSON.parse(result.input_json)&.find { |input| input['name'] == 'user_response' }&.dig('value')

  response.body = if user_response.present?
                    user_response
                  else
                    default_response
                  end
  response.status = 200
  response.headers['Content-Type'] = 'application/json'
end

#nameObject



5
6
7
# File 'lib/davinci_dtr_test_kit/endpoints/mock_payer/light_ehr_supported_payer_endpoint.rb', line 5

def name
  'light_ehr_supported_payer_endpoint'
end

#tagsObject



13
14
15
# File 'lib/davinci_dtr_test_kit/endpoints/mock_payer/light_ehr_supported_payer_endpoint.rb', line 13

def tags
  [SUPPORTED_PAYER_TAG]
end

#test_run_identifierObject



9
10
11
# File 'lib/davinci_dtr_test_kit/endpoints/mock_payer/light_ehr_supported_payer_endpoint.rb', line 9

def test_run_identifier
  request.params[:tester_url_id]
end