diff --git a/lib/au_core_test_kit/generator/search_definition_metadata_extractor.rb b/lib/au_core_test_kit/generator/search_definition_metadata_extractor.rb index 36553824..fa10772b 100644 --- a/lib/au_core_test_kit/generator/search_definition_metadata_extractor.rb +++ b/lib/au_core_test_kit/generator/search_definition_metadata_extractor.rb @@ -236,7 +236,7 @@ def multiple_and_expectation def values fixed_diagnostic_result_values = %w[251739003 24701-5] - fixed_date_value = %w[ge1950-01-01 le2050-01-01] + fixed_date_value = %w[1950-01-01 2050-01-01] # NOTE: In the current step we don't need to check the correct content of the response. # We should care about the correct structure of the request. In this current case we use dates just # to check that server can make a response for the request. diff --git a/lib/au_core_test_kit/search_test.rb b/lib/au_core_test_kit/search_test.rb index b761971c..5b7644a3 100644 --- a/lib/au_core_test_kit/search_test.rb +++ b/lib/au_core_test_kit/search_test.rb @@ -420,9 +420,7 @@ def perform_multiple_and_search_test end def modify_value_by_multiple_type(values, multiple_type) - return [values.join(',')] if multiple_type == 'or' - - Array.wrap(values) + multiple_type == 'or' ? [values.join(',')] : Array.wrap(values) end def perform_multiple_search_test(multiple_type) @@ -433,10 +431,19 @@ def perform_multiple_search_test(multiple_type) else param_name = search_param_names[0] default_search_values = default_search_values_clean(param_name.to_sym) + req_comparators = required_comparators(param_name) if default_search_values.length > 1 - search_params = { param_name => modify_value_by_multiple_type(default_search_values, multiple_type) } - search_and_check_response(search_params) + if req_comparators.length.positive? + combo_values_to_search = [["ge", "le"], ["gt", "lt"]].map { |combo_comp| [date_comparator_value(combo_comp[0], default_search_values[0]), date_comparator_value(combo_comp[1], default_search_values[1])] } + combo_values_to_search.each do |combo_values| + search_params = { param_name => modify_value_by_multiple_type(combo_values, multiple_type) } + search_and_check_response(search_params) + end + else + search_params = { param_name => modify_value_by_multiple_type(default_search_values, multiple_type) } + search_and_check_response(search_params) + end else resources_arr = all_search_params.map { |patient_id, _params_list| scratch_resources_for_patient(patient_id) }.flatten existing_values = extract_existing_values_safety(resources_arr, param_name)