Class: DaVinciDTRTestKit::MockPayer::FullEHRNextQuestionEndpoint

Inherits:
NextQuestionEndpoint
  • Object
show all
Defined in:
lib/davinci_dtr_test_kit/endpoints/mock_payer/full_ehr_next_question_endpoint.rb

Instance Method Summary collapse

Methods inherited from NextQuestionEndpoint

#complete_questionnaire?, #custom_next_question_requests, #custom_questionnaires, #next_custom_questionnaire, #tags

Methods included from DaVinciDTRTestKit::MockPayer

#build_outcome_param, #find_questionnaire_response, #operation_outcome, #outcome_issue, #parse_fhir_object

Instance Method Details

#make_responseObject



14
15
16
17
18
# File 'lib/davinci_dtr_test_kit/endpoints/mock_payer/full_ehr_next_question_endpoint.rb', line 14

def make_response
  return if response.status == 401 # set in update_result (expired token handling there)

  super
end

#test_run_identifierObject



6
7
8
9
10
11
12
# File 'lib/davinci_dtr_test_kit/endpoints/mock_payer/full_ehr_next_question_endpoint.rb', line 6

def test_run_identifier
  return request.params[:session_path] if request.params[:session_path].present?

  UDAPSecurityTestKit::MockUDAPServer.issued_token_to_client_id(
    request.headers['authorization']&.delete_prefix('Bearer ')
  )
end

#update_resultObject



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

def update_result
  if UDAPSecurityTestKit::MockUDAPServer.request_has_expired_token?(request)
    UDAPSecurityTestKit::MockUDAPServer.update_response_for_expired_token(response, 'Bearer token')
    return
  end

  super
end