Class: DaVinciDTRTestKit::MockPayer::FullEHRQuestionnairePackageEndpoint

Inherits:
QuestionnairePackageEndpoint show all
Defined in:
lib/davinci_dtr_test_kit/endpoints/mock_payer/full_ehr_questionnaire_package_endpoint.rb

Instance Method Summary collapse

Methods inherited from QuestionnairePackageEndpoint

#custom_response, #tags

Methods included from DaVinciDTRTestKit::MockPayer

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

Instance Method Details

#make_responseObject



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

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

  super
end

#test_run_identifierObject



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

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



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

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