Class: DaVinciCRDTestKit::V201::ServiceResponseValidationTest
- Inherits:
-
Inferno::Test
- Object
- Inferno::Test
- DaVinciCRDTestKit::V201::ServiceResponseValidationTest
- Includes:
- CardsValidation, ServerHookHelper
- Defined in:
- lib/davinci_crd_test_kit/server/v2.0.1/verify_response/service_response_validation_test.rb
Constant Summary collapse
- SYSTEM_ACTIONS_HOOK_NAMES =
['appointment-book', 'order-sign', 'order-dispatch'].freeze
Constants included from CardsValidation
Constants included from ProfilesAndResourceTypes
ProfilesAndResourceTypes::ORDER_OR_ENCOUNTER_RESOURCE_CLASSES, ProfilesAndResourceTypes::ORDER_RESOURCE_CLASSES, ProfilesAndResourceTypes::ORDER_RESOURCE_TYPES
Constants included from RequestsLogicalModelValidation
RequestsLogicalModelValidation::CRD_CDS_HOOK_REQUEST_MODEL_URL, RequestsLogicalModelValidation::PERFORMER_ALLOWED_RESOURCE_TYPES, RequestsLogicalModelValidation::USER_ID_ALLOWED_RESOURCE_TYPES
Instance Method Summary collapse
- #perform_system_actions_validation(system_actions, response_index) ⇒ Object
- #system_actions_check(system_actions) ⇒ Object
- #valid_cards ⇒ Object
- #valid_system_actions ⇒ Object
Methods included from ServerHookHelper
#discovered_service_id_for_hook, #identify_hook, #target_service_id, #tested_hook_name
Methods included from CardsValidation
#additional_orders_check, #all_requests, #card_indicator_check, #card_links_check, #card_optional_fields, #card_override_reasons_check, #card_required_fields, #card_selection_behavior_check, #card_source_check, #card_source_topic_check, #card_suggestions_check, #card_summary_check, #cards_check, #create_or_update_coverage_check, #external_reference_card_check, #form_completion_check, #link_required_fields, #no_links_check, #override_reasons_required_fields, #perform_cards_validation, #process_suggestion, #propose_alternate_request_check, #response_label, #smart_app_card_check, #source_required_fields, #source_topic_required_fields, #valid_card_with_optionals?, #validate_and_process_actions
Methods included from SuggestionActionsValidation
#action_fields_validation, #action_resource_type_check, #actions_check
Methods included from HookRequestFieldValidation
#hook_request_context_check, #hook_request_optional_fields_check, #hook_request_prefetch_check, #hook_request_required_fields_check, #json_parse, #no_error_validation
Methods included from ProfilesAndResourceTypes
#structure_definition_map, #structure_definition_map_v201, #structure_definition_map_v221
Methods included from ServerBaseURLs
#client_fhir_base_url, #fhir_url, #instance_url, #search_url
Methods included from BaseURLs
#inferno_base_url, #resume_fail_url, #resume_pass_url
Methods included from RequestsLogicalModelValidation
#validate_request_against_logical_model
Methods included from LogicalModelsOverrideHelper
#allowed_resource_type?, #check_appointment_conformance, #check_order_like_resource_conformance, #check_resource_conformance_to_coverage_profile, #check_resource_conformance_to_order_or_encounter_profile, #check_resource_conformance_to_order_profile, #check_resource_conformance_to_questionnaire_task_profile, #check_resource_type_and_validate, #local_reference?, #manually_check_appointment_validation_errors, #parse_action_resource, #primary_performer_type?, #referenced_resource_present_in_bundle?, #reject_resource_issues, #resolved_participant_patient_slice_issue?, #resolved_participant_primary_performer_slice_issue?
Instance Method Details
#perform_system_actions_validation(system_actions, response_index) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/davinci_crd_test_kit/server/v2.0.1/verify_response/service_response_validation_test.rb', line 41 def perform_system_actions_validation(system_actions, response_index) if SYSTEM_ACTIONS_HOOK_NAMES.include?(invoked_hook) && system_actions.nil? msg = "Server response #{response_index + 1} did not have the `systemActions` field, " \ "which must be present for the `#{invoked_hook}` hook." ('error', msg) end return if system_actions.nil? unless system_actions.is_a?(Array) ('error', "`systemActions` of server response #{response_index + 1} is not an array.") return end system_actions_check(system_actions) end |
#system_actions_check(system_actions) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/davinci_crd_test_kit/server/v2.0.1/verify_response/service_response_validation_test.rb', line 33 def system_actions_check(system_actions) system_actions.each do |action| current_error_count = .count { |msg| msg[:type] == 'error' } action_fields_validation(action, ig_version: 'v201') valid_system_actions << action if current_error_count == .count { |msg| msg[:type] == 'error' } end end |
#valid_cards ⇒ Object
25 26 27 |
# File 'lib/davinci_crd_test_kit/server/v2.0.1/verify_response/service_response_validation_test.rb', line 25 def valid_cards @valid_cards ||= [] end |
#valid_system_actions ⇒ Object
29 30 31 |
# File 'lib/davinci_crd_test_kit/server/v2.0.1/verify_response/service_response_validation_test.rb', line 29 def valid_system_actions @valid_system_actions ||= [] end |