Class: DaVinciDTRTestKit::DTRPayerServerV220::NextQuestionResponseValidationTest

Inherits:
Inferno::Test
  • Object
show all
Defined in:
lib/davinci_dtr_test_kit/server/v2.2.0/next_question_support/next_question_response_validation_test.rb

Constant Summary collapse

NEXT_QUESTION_OUTPUT_PARAMETERS_PROFILE =
'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-next-question-output-parameters|2.2.0'
ADAPTIVE_QUESTIONNAIRE_RESPONSE_PROFILE =
'http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-questionnaireresponse-adapt|2.2.0'

Instance Method Summary collapse

Instance Method Details

#perform_next_question_response_validation(resource, index) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/davinci_dtr_test_kit/server/v2.2.0/next_question_support/next_question_response_validation_test.rb', line 47

def perform_next_question_response_validation(resource, index)
  case resource
  when FHIR::Parameters
    resource_is_valid?(
      resource:,
      profile_url: NEXT_QUESTION_OUTPUT_PARAMETERS_PROFILE,
      message_prefix: "Response #{index + 1}: "
    )
  when FHIR::QuestionnaireResponse
    resource_is_valid?(
      resource:,
      profile_url: ADAPTIVE_QUESTIONNAIRE_RESPONSE_PROFILE,
      message_prefix: "Response #{index + 1}: "
    )
  else
    add_message('error', "Response #{index + 1} was not a Parameters or QuestionnaireResponse resource.")
  end
end