Class: DaVinciCRDTestKit::V221::ClientCardDisplayAttest

Inherits:
Inferno::Test
  • Object
show all
Includes:
CardsIdentification, TaggedRequestLoadHelper, ClientURLs
Defined in:
lib/davinci_crd_test_kit/client/v2.2.1/verify_response/client_display_cards_attest.rb

Constant Summary collapse

CARD_AND_SYSTEM_ACTION_DISPLAY_PREFIX =
"\n\n By attesting true, ".freeze
CARD_AND_SYSTEM_ACTION_DISPLAY_CLAUSE_PREFIX =
'you confirm that the following '.freeze
CARD_AND_SYSTEM_ACTION_DISPLAY_CLAUSE_CONNECTOR =
"\n\n Additionally, ".freeze
CARD_AND_SYSTEM_ACTION_DISPLAY_CARD_CLAUSE =
'card types observed in Inferno\'s responses were displayed to users:'.freeze
CARD_AND_SYSTEM_ACTION_DISPLAY_SYSTEM_ACTION_CLAUSE =
'system action types observed in Inferno\'s responses were displayed to users ' \
'through standard card display, icons, flyovers, or another alternate mechanism:'.freeze

Constants included from CardsIdentification

CardsIdentification::ADDITIONAL_ORDERS_EXPECTED_RESOURCE_TYPES, CardsIdentification::ADDITIONAL_ORDERS_RESPONSE_TYPE, CardsIdentification::COVERAGE_INFORMATION_RESPONSE_TYPE, CardsIdentification::COVERAGE_INFO_CONFIGURATION_CODE, CardsIdentification::COVERAGE_INFO_EXPECTED_RESOURCE_TYPES, CardsIdentification::COVERAGE_INFO_EXT_URL, CardsIdentification::CREATE_OR_UPDATE_COVERAGE_RESPONSE_TYPE, CardsIdentification::EXTERNAL_REFERENCE_RESPONSE_TYPE, CardsIdentification::FORM_COMPLETION_RESPONSE_TYPE, CardsIdentification::INSTRUCTIONS_RESPONSE_TYPE, CardsIdentification::LAUNCH_SMART_APP_RESPONSE_TYPE, CardsIdentification::PROPOSE_ALTERNATIVE_REQUEST_EXPECTED_RESOURCE_TYPES, CardsIdentification::PROPOSE_ALTERNATIVE_REQUEST_RESPONSE_TYPE

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

Constants included from ClientURLs

DaVinciCRDTestKit::V221::ClientURLs::SUITE_ID

Instance Method Summary collapse

Methods included from TaggedRequestLoadHelper

#crd_interaction_group, #hook_name, #load_interaction_group_requests, #load_requests_for_cross_hook_analysis

Methods included from CardsIdentification

#additional_orders_response_type?, #cache_sorted_cards, #check_action_type, #coverage_info_card_type?, #coverage_info_configuration_disabled?, #coverage_info_content, #coverage_info_response?, #coverage_info_system_action_response?, #coverage_info_system_action_type?, #coverage_information_response_type?, #create_or_update_coverage_action_response_type?, #create_or_update_coverage_card_response_type?, #create_questionnaire_action_response_type?, #disable_coverage_info_configuration!, #extension_url, #external_reference_response_type?, #extract_coverage_information_extensions, #form_completion_action_response_type?, #form_completion_card_response_type?, #form_completion_task_questionnaire?, #hook_instances_from_requests, humanize_response_type, #identify_action_type, #identify_card_type, #initialize_sorted_cards_hash, #instructions_response_type?, #launch_smart_app_response_type?, #list_card_types_in_requests, #propose_alternative_request_response_type?, #sort_card_types_from_request, #sorted_cards_cached?, #sorted_cards_from_cache, #sorted_cards_from_requests

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, #filter_logical_model_extension_issues, #local_reference?, #logical_model_extension_issue?, #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?

Methods included from SuggestionActionsValidation

#action_fields_validation, #action_resource_type_check, #actions_check

Methods included from ClientURLs

base_url, discovery_url, prefetch_subset_discovery_url, #suite_id

Methods included from ClientBaseURLs

#appointment_book_prefetch_subset_url, #appointment_book_url, #discovery_url, #encounter_discharge_prefetch_subset_url, #encounter_discharge_url, #encounter_start_prefetch_subset_url, #encounter_start_url, #order_dispatch_prefetch_subset_url, #order_dispatch_url, #order_select_prefetch_subset_url, #order_select_url, #order_sign_prefetch_subset_url, #order_sign_url, #prefetch_subset_discovery_url

Instance Method Details

#card_and_system_action_details_displayObject



60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/davinci_crd_test_kit/client/v2.2.1/verify_response/client_display_cards_attest.rb', line 60

def card_and_system_action_details_display
  if format_responded_card_types.present? && format_responded_system_action_types.present?
    "#{CARD_AND_SYSTEM_ACTION_DISPLAY_PREFIX}#{CARD_AND_SYSTEM_ACTION_DISPLAY_CLAUSE_PREFIX}" \
      "#{CARD_AND_SYSTEM_ACTION_DISPLAY_CARD_CLAUSE}\n#{format_responded_card_types}" \
      "#{CARD_AND_SYSTEM_ACTION_DISPLAY_CLAUSE_CONNECTOR}#{CARD_AND_SYSTEM_ACTION_DISPLAY_CLAUSE_PREFIX}" \
      "#{CARD_AND_SYSTEM_ACTION_DISPLAY_SYSTEM_ACTION_CLAUSE}\n#{format_responded_system_action_types}"
  elsif format_responded_card_types.present?
    "#{CARD_AND_SYSTEM_ACTION_DISPLAY_PREFIX}#{CARD_AND_SYSTEM_ACTION_DISPLAY_CLAUSE_PREFIX}" \
      "#{CARD_AND_SYSTEM_ACTION_DISPLAY_CARD_CLAUSE}\n#{format_responded_card_types}"
  else
    "#{CARD_AND_SYSTEM_ACTION_DISPLAY_PREFIX}#{CARD_AND_SYSTEM_ACTION_DISPLAY_CLAUSE_PREFIX}" \
      "#{CARD_AND_SYSTEM_ACTION_DISPLAY_SYSTEM_ACTION_CLAUSE}\n#{format_responded_system_action_types}"
  end
end

#format_responded_card_typesObject



37
38
39
40
41
42
# File 'lib/davinci_crd_test_kit/client/v2.2.1/verify_response/client_display_cards_attest.rb', line 37

def format_responded_card_types
  @format_responded_card_types ||=
    format_responded_response_types(responded_card_types.select do |type|
      type.end_with?('_card')
    end)
end

#format_responded_response_types(response_types = responded_card_types) ⇒ Object



27
28
29
30
31
32
33
34
35
# File 'lib/davinci_crd_test_kit/client/v2.2.1/verify_response/client_display_cards_attest.rb', line 27

def format_responded_response_types(response_types = responded_card_types)
  response_types
    .map do |response_type|
      DaVinciCRDTestKit::CardsIdentification.humanize_response_type(response_type)
        .prepend('- ')
        .sub(' Card', '')
        .sub(' Action', '')
    end.join("\n")
end

#format_responded_system_action_typesObject



44
45
46
47
48
49
# File 'lib/davinci_crd_test_kit/client/v2.2.1/verify_response/client_display_cards_attest.rb', line 44

def format_responded_system_action_types
  @format_responded_system_action_types ||=
    format_responded_response_types(responded_card_types.select do |type|
      type.end_with?('_action')
    end)
end

#responded_card_typesObject



23
24
25
# File 'lib/davinci_crd_test_kit/client/v2.2.1/verify_response/client_display_cards_attest.rb', line 23

def responded_card_types
  @responded_card_types ||= list_card_types_in_requests(requests)
end