From 9c502f327ea8679ab6ed4bce6116edf986ae5639 Mon Sep 17 00:00:00 2001 From: nvim Date: Mon, 16 Sep 2024 13:50:22 +0200 Subject: [PATCH 1/3] Add conditional/basic skip with message Ref: https://github.com/hl7au/au-fhir-core-inferno/issues/71 --- lib/au_core_test_kit/helpers.rb | 429 ++++++++++-------- lib/au_core_test_kit/must_support_test.rb | 5 +- .../reference_resolution_test.rb | 6 +- lib/au_core_test_kit/search_test.rb | 8 +- .../special_identifier_search_test.rb | 8 +- lib/au_core_test_kit/validation_test.rb | 7 +- 6 files changed, 252 insertions(+), 211 deletions(-) diff --git a/lib/au_core_test_kit/helpers.rb b/lib/au_core_test_kit/helpers.rb index 27ccc0d4..6fa4cbbd 100644 --- a/lib/au_core_test_kit/helpers.rb +++ b/lib/au_core_test_kit/helpers.rb @@ -1,231 +1,262 @@ # frozen_string_literal: true -module Helpers - DAR_CODE_SYSTEM_URL = 'http://terminology.hl7.org/CodeSystem/data-absent-reason' - DAR_EXTENSION_URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason' - - def self.multiple_test_description(multiple_type, conformance_expectation, search_param_name_string, resource_type, url_version) - multiple_type_str = multiple_type == 'OR' ? 'multipleOr' : 'multipleAnd' - <<~DESCRIPTION.gsub(/\n{3,}/, "\n\n") - A server #{conformance_expectation} support searching by #{multiple_type_str} - #{search_param_name_string} on the #{resource_type} resource. This test - will pass if resources are returned and match the search criteria. If - none are returned, the test is skipped. - - [AU Core Server CapabilityStatement](http://hl7.org.au/fhir/core/#{url_version}/CapabilityStatement-au-core-server.html) - DESCRIPTION - end - def self.get_http_header(header_name, header_value) - (header_name && header_value) ? {header_name => header_value} : {} - end +module AUCoreTestKit + module Helpers + extend Forwardable + + def_delegators 'properties', + :act_if_with_message, + :conditional_skip_with_msg, + :skip_with_msg + + DAR_CODE_SYSTEM_URL = 'http://terminology.hl7.org/CodeSystem/data-absent-reason' + DAR_EXTENSION_URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason' + + def self.multiple_test_description(multiple_type, conformance_expectation, search_param_name_string, resource_type, url_version) + multiple_type_str = multiple_type == 'OR' ? 'multipleOr' : 'multipleAnd' + <<~DESCRIPTION.gsub(/\n{3,}/, "\n\n") + A server #{conformance_expectation} support searching by #{multiple_type_str} + #{search_param_name_string} on the #{resource_type} resource. This test + will pass if resources are returned and match the search criteria. If + none are returned, the test is skipped. + + [AU Core Server CapabilityStatement](http://hl7.org.au/fhir/core/#{url_version}/CapabilityStatement-au-core-server.html) + DESCRIPTION + end + def self.get_http_header(header_name, header_value) + (header_name && header_value) ? {header_name => header_value} : {} + end - def self.extract_extensions_from_resource(resource, extensions = []) - resource_hash = convert_resource_to_hash(resource) - process_resource_element(resource_hash, extensions) - extensions - end + def self.extract_extensions_from_resource(resource, extensions = []) + resource_hash = convert_resource_to_hash(resource) + process_resource_element(resource_hash, extensions) + extensions + end - def self.get_capability_statement_group_description_text(title, for_group_description = true) - background_title = for_group_description ? '# Background' : '#### Background' - testing_methodology_title = for_group_description ? '# Testing Methodology' : '#### Testing Methodology' - - <<~DESCRIPTION - #{background_title} - The #{title} Sequence tests a FHIR server's ability to formally describe - features supported by the API by using the [Capability - Statement](https://www.hl7.org/fhir/capabilitystatement.html) resource. - The features described in the Capability Statement must be consistent with - the required capabilities of a AU Core **Responder**. - - The Capability Statement resource allows clients to determine which - resources are supported by a FHIR Server. Not all servers are expected to - implement all possible queries and data elements described in the AU Core - API. The **AU Core Responder Capability Statement** requires that - the Patient resource and **at least** one additional resource profile from the AU Core profiles. - - #{testing_methodology_title} - - This test sequence accesses the server endpoint at `/metadata` using a - `GET` request. It parses the Capability Statement and verifies that: - - * The endpoint is secured by an appropriate cryptographic protocol - * The resource matches the expected FHIR version defined by the tests - * The resource is a valid FHIR resource - * The server claims support for JSON encoding of resources - * The server claims support for the Patient resource and one other + def self.get_capability_statement_group_description_text(title, for_group_description = true) + background_title = for_group_description ? '# Background' : '#### Background' + testing_methodology_title = for_group_description ? '# Testing Methodology' : '#### Testing Methodology' + + <<~DESCRIPTION + #{background_title} + The #{title} Sequence tests a FHIR server's ability to formally describe + features supported by the API by using the [Capability + Statement](https://www.hl7.org/fhir/capabilitystatement.html) resource. + The features described in the Capability Statement must be consistent with + the required capabilities of a AU Core **Responder**. + + The Capability Statement resource allows clients to determine which + resources are supported by a FHIR Server. Not all servers are expected to + implement all possible queries and data elements described in the AU Core + API. The **AU Core Responder Capability Statement** requires that + the Patient resource and **at least** one additional resource profile from the AU Core profiles. + + #{testing_methodology_title} + + This test sequence accesses the server endpoint at `/metadata` using a + `GET` request. It parses the Capability Statement and verifies that: + + * The endpoint is secured by an appropriate cryptographic protocol + * The resource matches the expected FHIR version defined by the tests + * The resource is a valid FHIR resource + * The server claims support for JSON encoding of resources + * The server claims support for the Patient resource and one other + resource + + It collects the following information that is saved in the testing session + for use by later tests: + + * List of resources supported + * List of queries parameters supported + DESCRIPTION + end + + def self.get_group_description_text(title, resource_type, profile_name, group_version, profile_url, + required_searches, search_param_name_string, search_validation_resource_type, + for_group_description = true) + background_title = for_group_description ? '# Background' : '#### Background' + testing_methodology_title = for_group_description ? '# Testing Methodology' : '#### Testing Methodology' + must_support_title = for_group_description ? '## Must Support' : '##### Must Support' + profile_validation_title = for_group_description ? '## Profile Validation' : '##### Profile Validation' + reference_validation_title = for_group_description ? '## Reference Validation' : '##### Reference Validation' + + <<~DESCRIPTION + #{background_title} + + The AU Core #{title} sequence verifies that the system under test is + able to provide correct responses for #{resource_type} queries. These queries + must contain resources conforming to the #{profile_name} as + specified in the AU Core #{group_version} Implementation Guide. + + #{testing_methodology_title} + #{search_description(required_searches, search_param_name_string, search_validation_resource_type, for_group_description, resource_type)} + + #{must_support_title} + Each profile contains elements marked as "must support". This test + sequence expects to see each of these elements at least once. If at + least one cannot be found, the test will fail. The test will look + through the #{resource_type} resources found in the first test for these + elements. + + #{profile_validation_title} + Each resource returned from the first search is expected to conform to + the [#{profile_name}](#{profile_url}). Each element is checked against + teminology binding and cardinality requirements. + + Elements with a required binding are validated against their bound + ValueSet. If the code/system in the element is not part of the ValueSet, + then the test will fail. + + #{reference_validation_title} + At least one instance of each external reference in elements marked as + "must support" within the resources provided by the system must resolve. + The test will attempt to read each reference found and will fail if no + read succeeds. + DESCRIPTION + end + + def self.search_description(required_searches, search_param_name_string, search_validation_resource_type, for_group_description, resource_type) + return '' if required_searches.blank? + + is_independant_group = ['Practitioner', 'PractitionerRole', 'Location', 'Organization'].include? resource_type + basic_search_parameters_text = 'The first search uses the selected patient(s) from the prior launch sequence. Any subsequent searches will look for its parameter values from the results of the first search. For example, the `identifier` search in the patient sequence is performed by looking for an existing `Patient.identifier` from any of the resources returned in the `_id` search. If a value cannot be found this way, the search is skipped.' + independant_search_parameters_text = 'Resources for this test group can\'t be found using patient search parameters. This means that in this particular case, the first test will be a read test, not a search. To ensure that this resource will be available for reading, please review the [prerequisites](https://github.com/hl7au/au-fhir-core-inferno/blob/master/docs/pre-requisites.md). Additionally, you can run this test group separately by using specific resource IDs.' + search_parameters_text = is_independant_group ? independant_search_parameters_text : basic_search_parameters_text + + searching_title = for_group_description ? '## Searching' : '##### Searching' + search_parameters_title = for_group_description ? '### Search Parameters' : '###### Search Parameters' + search_validation_title = for_group_description ? '### Search Validation' : '###### Search Validation' + + <<~SEARCH_DESCRIPTION + #{searching_title} + This test sequence will first perform each required search associated + with this resource. This sequence will perform searches with the + following parameters: + + #{search_param_name_string} + + #{search_parameters_title} + #{search_parameters_text} + + #{search_validation_title} + Inferno will retrieve up to the first 20 bundle pages of the reply for + #{search_validation_resource_type} and save them for subsequent tests. Each of + these resources is then checked to see if it matches the searched + parameters in accordance with [FHIR search + guidelines](https://www.hl7.org/fhir/search.html). The test will fail, + for example, if a Patient search for `gender=male` returns a `female` + patient. + SEARCH_DESCRIPTION + end + + def self.convert_resource_to_hash(resource) + if defined?(FHIR) && resource.is_a?(FHIR::Model) + resource.source_hash.deep_stringify_keys + else resource + end + end - It collects the following information that is saved in the testing session - for use by later tests: + def self.process_resource_element(element, extensions) + case element + when Hash + extensions.concat(element['extension']) if element['extension'].is_a?(Array) + element.each_value do |value| + process_resource_element(value, extensions) + end + when Array + element.each { |item| process_resource_element(item, extensions) } + end + end - * List of resources supported - * List of queries parameters supported - DESCRIPTION - end + def self.custom_validation_group_title_text + 'Custom Validation Group' + end - def self.get_group_description_text(title, resource_type, profile_name, group_version, profile_url, - required_searches, search_param_name_string, search_validation_resource_type, - for_group_description = true) - background_title = for_group_description ? '# Background' : '#### Background' - testing_methodology_title = for_group_description ? '# Testing Methodology' : '#### Testing Methodology' - must_support_title = for_group_description ? '## Must Support' : '##### Must Support' - profile_validation_title = for_group_description ? '## Profile Validation' : '##### Profile Validation' - reference_validation_title = for_group_description ? '## Reference Validation' : '##### Reference Validation' - - <<~DESCRIPTION - #{background_title} - - The AU Core #{title} sequence verifies that the system under test is - able to provide correct responses for #{resource_type} queries. These queries - must contain resources conforming to the #{profile_name} as - specified in the AU Core #{group_version} Implementation Guide. - - #{testing_methodology_title} - #{search_description(required_searches, search_param_name_string, search_validation_resource_type, for_group_description, resource_type)} - - #{must_support_title} - Each profile contains elements marked as "must support". This test - sequence expects to see each of these elements at least once. If at - least one cannot be found, the test will fail. The test will look - through the #{resource_type} resources found in the first test for these - elements. - - #{profile_validation_title} - Each resource returned from the first search is expected to conform to - the [#{profile_name}](#{profile_url}). Each element is checked against - teminology binding and cardinality requirements. - - Elements with a required binding are validated against their bound - ValueSet. If the code/system in the element is not part of the ValueSet, - then the test will fail. - - #{reference_validation_title} - At least one instance of each external reference in elements marked as - "must support" within the resources provided by the system must resolve. - The test will attempt to read each reference found and will fail if no - read succeeds. - DESCRIPTION - end + def self.custom_validation_group_description_text + %( + This test group is designed to validate the conformity of FHIR resources against specified profiles. + Leveraging the dynamic capabilities of FHIR, this validation ensures that the resources adhere to the standards and guidelines established within the relevant AU Core. + ) + end - def self.search_description(required_searches, search_param_name_string, search_validation_resource_type, for_group_description, resource_type) - return '' if required_searches.blank? - - is_independant_group = ['Practitioner', 'PractitionerRole', 'Location', 'Organization'].include? resource_type - basic_search_parameters_text = 'The first search uses the selected patient(s) from the prior launch sequence. Any subsequent searches will look for its parameter values from the results of the first search. For example, the `identifier` search in the patient sequence is performed by looking for an existing `Patient.identifier` from any of the resources returned in the `_id` search. If a value cannot be found this way, the search is skipped.' - independant_search_parameters_text = 'Resources for this test group can\'t be found using patient search parameters. This means that in this particular case, the first test will be a read test, not a search. To ensure that this resource will be available for reading, please review the [prerequisites](https://github.com/hl7au/au-fhir-core-inferno/blob/master/docs/pre-requisites.md). Additionally, you can run this test group separately by using specific resource IDs.' - search_parameters_text = is_independant_group ? independant_search_parameters_text : basic_search_parameters_text - - searching_title = for_group_description ? '## Searching' : '##### Searching' - search_parameters_title = for_group_description ? '### Search Parameters' : '###### Search Parameters' - search_validation_title = for_group_description ? '### Search Validation' : '###### Search Validation' - - <<~SEARCH_DESCRIPTION - #{searching_title} - This test sequence will first perform each required search associated - with this resource. This sequence will perform searches with the - following parameters: - - #{search_param_name_string} - - #{search_parameters_title} - #{search_parameters_text} - - #{search_validation_title} - Inferno will retrieve up to the first 20 bundle pages of the reply for - #{search_validation_resource_type} and save them for subsequent tests. Each of - these resources is then checked to see if it matches the searched - parameters in accordance with [FHIR search - guidelines](https://www.hl7.org/fhir/search.html). The test will fail, - for example, if a Patient search for `gender=male` returns a `female` - patient. - SEARCH_DESCRIPTION - end + def self.custom_validation_test_title_text + 'Custom validation of the resource' + end - def self.convert_resource_to_hash(resource) - if defined?(FHIR) && resource.is_a?(FHIR::Model) - resource.source_hash.deep_stringify_keys - else - resource + def self.custom_validation_test_input_text + 'FHIR resource in JSON format (custom validation)' end - end - def self.process_resource_element(element, extensions) - case element - when Hash - extensions.concat(element['extension']) if element['extension'].is_a?(Array) - element.each_value do |value| - process_resource_element(value, extensions) - end - when Array - element.each { |item| process_resource_element(item, extensions) } + def self.custom_validation_test_description_text + %( + This test automatically identifies and validates any provided FHIR resource. + Users are required to input the FHIR resource in JSON format, referred to as 'resource_json'. + The test extracts the applicable profile for validation from the first element in the 'meta.profile' array, located at the path: resource.meta.profile.0. + This profile serves as the benchmark for the validation process. + + Given the optional nature of this test, its results do not influence the final outcome of the test report. + ) end - end - def self.custom_validation_group_title_text - 'Custom Validation Group' - end + def self.custom_validation_test_info_resource_type_text(resource_type) + "Resource type to validate is #{resource_type}" + end - def self.custom_validation_group_description_text - %( - This test group is designed to validate the conformity of FHIR resources against specified profiles. - Leveraging the dynamic capabilities of FHIR, this validation ensures that the resources adhere to the standards and guidelines established within the relevant AU Core. - ) - end + def self.custom_validation_test_info_profile_text(fhir_resource_profile) + "Resource profile to validate is #{fhir_resource_profile}" + end - def self.custom_validation_test_title_text - 'Custom validation of the resource' - end + def self.custom_validation_test_info_ig_text(ig_version) + "IG version to validate is #{ig_version}" + end - def self.custom_validation_test_input_text - 'FHIR resource in JSON format (custom validation)' - end + def self.default_patient_ids_string + 'baratz-toni, irvine-ronny-lawrence, italia-sofia, howe-deangelo, hayes-arianne, baby-banks-john, banks-mia-leanne' + end - def self.custom_validation_test_description_text - %( - This test automatically identifies and validates any provided FHIR resource. - Users are required to input the FHIR resource in JSON format, referred to as 'resource_json'. - The test extracts the applicable profile for validation from the first element in the 'meta.profile' array, located at the path: resource.meta.profile.0. - This profile serves as the benchmark for the validation process. + def self.check_for_dar(resource) + resource.each_element do |element, _meta, path| + next unless element.is_a?(FHIR::Coding) - Given the optional nature of this test, its results do not influence the final outcome of the test report. - ) - end + return true if (element.code == 'masked' || element.code == 'unknown') && element.system == DAR_CODE_SYSTEM_URL + end - def self.custom_validation_test_info_resource_type_text(resource_type) - "Resource type to validate is #{resource_type}" - end + false + end - def self.custom_validation_test_info_profile_text(fhir_resource_profile) - "Resource profile to validate is #{fhir_resource_profile}" - end + def self.check_for_dar_extension(resource) + return resource.source_contents&.include? DAR_EXTENSION_URL + end - def self.custom_validation_test_info_ig_text(ig_version) - "IG version to validate is #{ig_version}" - end + def self.return_uniq_list_resources(resource_list) + return resource_list.uniq + end - def self.default_patient_ids_string - 'baratz-toni, irvine-ronny-lawrence, italia-sofia, howe-deangelo, hayes-arianne, baby-banks-john, banks-mia-leanne' - end + def self.is_message_exist_in_list(message_list, message) + message_list.any? { |list_message| message.include? list_message } + end - def self.check_for_dar(resource) - resource.each_element do |element, _meta, path| - next unless element.is_a?(FHIR::Coding) + def act_if_with_message(act_func, condition, message) + if condition + info message + end - return true if (element.code == 'masked' || element.code == 'unknown') && element.system == DAR_CODE_SYSTEM_URL + act_func.call(condition, message) end - false - end + def self.act_with_message(act_func, message) + info message - def self.check_for_dar_extension(resource) - return resource.source_contents&.include? DAR_EXTENSION_URL - end + act_func.call(message) + end - def self.return_uniq_list_resources(resource_list) - return resource_list.uniq - end + def conditional_skip_with_msg(condition, message) + act_if_with_message(method(:skip_if), condition, message) + end - def self.is_message_exist_in_list(message_list, message) - message_list.any? { |list_message| message.include? list_message } + def skip_with_msg(message) + act_with_message(method(:skip), message) + end end end diff --git a/lib/au_core_test_kit/must_support_test.rb b/lib/au_core_test_kit/must_support_test.rb index ad8ef6cf..b01b035d 100644 --- a/lib/au_core_test_kit/must_support_test.rb +++ b/lib/au_core_test_kit/must_support_test.rb @@ -7,6 +7,7 @@ module AUCoreTestKit module MustSupportTest extend Forwardable include FHIRResourceNavigation + include Helpers def_delegators 'self.class', :metadata @@ -15,7 +16,7 @@ def all_scratch_resources end def perform_must_support_test(resources) - skip_if resources.blank?, "No #{resource_type} resources were found" + conditional_skip_with_msg resources.blank?, "No #{resource_type} resources were found" missing_elements(resources) missing_slices(resources) @@ -24,7 +25,7 @@ def perform_must_support_test(resources) handle_must_support_choices if metadata.must_supports[:choices].present? pass if (missing_elements + missing_slices + missing_extensions).empty? - skip "Could not find #{missing_must_support_strings.join(', ')} element(s) in the #{resources.length} " \ + skip_with_msg "Could not find #{missing_must_support_strings.join(', ')} element(s) in the #{resources.length} " \ "provided #{resource_type} resource(s). To prevent this issue, please add the missing must support "\ "elements to at least one #{resource_type} resource on the server." end diff --git a/lib/au_core_test_kit/reference_resolution_test.rb b/lib/au_core_test_kit/reference_resolution_test.rb index 17f02707..28b2675b 100644 --- a/lib/au_core_test_kit/reference_resolution_test.rb +++ b/lib/au_core_test_kit/reference_resolution_test.rb @@ -1,20 +1,22 @@ # frozen_string_literal: true require_relative 'fhir_resource_navigation' +require_relative 'helpers' module AUCoreTestKit module ReferenceResolutionTest extend Forwardable include FHIRResourceNavigation + include Helpers def_delegators 'self.class', :metadata def perform_reference_resolution_test(resources) - skip_if resources.blank?, no_resources_skip_message + conditional_skip_with_msg resources.blank?, no_resources_skip_message pass if unresolved_references(resources).empty? - skip "Could not resolve and validate any Must Support references for #{unresolved_references_strings.join(', ')}" + skip_with_msg "Could not resolve and validate any Must Support references for #{unresolved_references_strings.join(', ')}" end def unresolved_references_strings diff --git a/lib/au_core_test_kit/search_test.rb b/lib/au_core_test_kit/search_test.rb index 4a3f476f..033cb5b2 100644 --- a/lib/au_core_test_kit/search_test.rb +++ b/lib/au_core_test_kit/search_test.rb @@ -4,6 +4,7 @@ require_relative 'fhir_resource_navigation' require_relative 'search_test_properties' require_relative 'read_test' +require_relative 'helpers' module AUCoreTestKit module SearchTest @@ -11,6 +12,7 @@ module SearchTest include DateSearchValidation include FHIRResourceNavigation include ReadTest + include Helpers def_delegators 'self.class', :metadata, :provenance_metadata, :properties def_delegators 'properties', @@ -62,7 +64,7 @@ def any_valid_search_params?(search_params) def run_provenance_revinclude_search_test # TODO: skip if not supported? - skip_if !any_valid_search_params?(all_provenance_revinclude_search_params), unable_to_resolve_params_message + conditional_skip_with_msg !any_valid_search_params?(all_provenance_revinclude_search_params), unable_to_resolve_params_message provenance_resources = all_provenance_revinclude_search_params.flat_map do |_patient_id, params_list| @@ -900,7 +902,7 @@ def check_resource_against_params(resource, params) private def run_search_test_common(search_method) - skip_if !any_valid_search_params?(all_search_params), unable_to_resolve_params_message + conditional_skip_with_msg !any_valid_search_params?(all_search_params), unable_to_resolve_params_message ability_to_search_is_checked = false search_is_available = true @@ -924,7 +926,7 @@ def run_search_test_common(search_method) end end - skip_if resources_returned.empty?, no_resources_skip_message + conditional_skip_with_msg resources_returned.empty?, no_resources_skip_message return unless search_is_available == false diff --git a/lib/au_core_test_kit/special_identifier_search_test.rb b/lib/au_core_test_kit/special_identifier_search_test.rb index cc1a1bed..a6795dac 100644 --- a/lib/au_core_test_kit/special_identifier_search_test.rb +++ b/lib/au_core_test_kit/special_identifier_search_test.rb @@ -2,11 +2,13 @@ require_relative 'search_test_properties' require_relative 'search_test' +require_relative 'helpers' module AUCoreTestKit module SpecialIdentifierSearchTest extend Forwardable include SearchTest + include Helpers def_delegators 'self.class', :metadata, :provenance_metadata, :properties def_delegators 'properties', @@ -78,15 +80,15 @@ def search_param_value(_name, resource, include_system: false) end def run_special_identifier_search_test - skip_if scratch_resources[:all].empty?, no_resources_skip_message - skip_if !any_valid_search_params?(all_search_params), unable_to_resolve_params_message + conditional_skip_with_msg scratch_resources[:all].empty?, no_resources_skip_message + conditional_skip_with_msg !any_valid_search_params?(all_search_params), unable_to_resolve_params_message resources_returned = all_search_params.flat_map do |patient_id, params_list| params_list.flat_map { |params| perform_search_with_system(params, patient_id) } end - skip_if resources_returned.empty?, no_resources_skip_message + conditional_skip_with_msg resources_returned.empty?, no_resources_skip_message end end end diff --git a/lib/au_core_test_kit/validation_test.rb b/lib/au_core_test_kit/validation_test.rb index 3c47a3e3..3596390b 100644 --- a/lib/au_core_test_kit/validation_test.rb +++ b/lib/au_core_test_kit/validation_test.rb @@ -1,7 +1,10 @@ # frozen_string_literal: true +require_relative 'helpers' + module AUCoreTestKit module ValidationTest + include Helpers DAR_CODE_SYSTEM_URL = 'http://terminology.hl7.org/CodeSystem/data-absent-reason' DAR_EXTENSION_URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason' @@ -10,8 +13,8 @@ def perform_validation_test(resources, profile_version, skip_if_empty: true) - skip_if skip_if_empty && resources.blank?, - "No #{resource_type} resources conforming to the #{profile_url} profile were returned" + conditional_skip_with_msg skip_if_empty && resources.blank?, + "No #{resource_type} resources conforming to the #{profile_url} profile were returned" omit_if resources.blank?, "No #{resource_type} resources provided so the #{profile_url} profile does not apply" From 191844949016b72f7584542ab6955a2808fd84e7 Mon Sep 17 00:00:00 2001 From: nvim Date: Mon, 16 Sep 2024 14:11:02 +0200 Subject: [PATCH 2/3] Add assert helpers as separated file Ref: https://github.com/hl7au/au-fhir-core-inferno/issues/71 --- lib/au_core_test_kit/assert_helpers.rb | 31 ++ lib/au_core_test_kit/helpers.rb | 429 ++++++++---------- lib/au_core_test_kit/must_support_test.rb | 3 +- .../reference_resolution_test.rb | 3 +- lib/au_core_test_kit/search_test.rb | 3 +- .../special_identifier_search_test.rb | 3 +- lib/au_core_test_kit/validation_test.rb | 4 +- 7 files changed, 241 insertions(+), 235 deletions(-) create mode 100644 lib/au_core_test_kit/assert_helpers.rb diff --git a/lib/au_core_test_kit/assert_helpers.rb b/lib/au_core_test_kit/assert_helpers.rb new file mode 100644 index 00000000..6b903975 --- /dev/null +++ b/lib/au_core_test_kit/assert_helpers.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module AUCoreTestKit + module AssertHelpers + extend Forwardable + + def_delegators 'properties', + :conditional_skip_with_msg, + :skip_with_msg + + def act_if_with_message(act_func, condition, message) + info message if condition + + act_func.call(condition, message) + end + + def act_with_message(act_func, message) + info message + + act_func.call(message) + end + + def conditional_skip_with_msg(condition, message) + act_if_with_message(method(:skip_if), condition, message) + end + + def skip_with_msg(message) + act_with_message(method(:skip), message) + end + end +end diff --git a/lib/au_core_test_kit/helpers.rb b/lib/au_core_test_kit/helpers.rb index 6fa4cbbd..27ccc0d4 100644 --- a/lib/au_core_test_kit/helpers.rb +++ b/lib/au_core_test_kit/helpers.rb @@ -1,262 +1,231 @@ # frozen_string_literal: true -module AUCoreTestKit - module Helpers - extend Forwardable - - def_delegators 'properties', - :act_if_with_message, - :conditional_skip_with_msg, - :skip_with_msg - - DAR_CODE_SYSTEM_URL = 'http://terminology.hl7.org/CodeSystem/data-absent-reason' - DAR_EXTENSION_URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason' - - def self.multiple_test_description(multiple_type, conformance_expectation, search_param_name_string, resource_type, url_version) - multiple_type_str = multiple_type == 'OR' ? 'multipleOr' : 'multipleAnd' - <<~DESCRIPTION.gsub(/\n{3,}/, "\n\n") - A server #{conformance_expectation} support searching by #{multiple_type_str} - #{search_param_name_string} on the #{resource_type} resource. This test - will pass if resources are returned and match the search criteria. If - none are returned, the test is skipped. - - [AU Core Server CapabilityStatement](http://hl7.org.au/fhir/core/#{url_version}/CapabilityStatement-au-core-server.html) - DESCRIPTION - end - def self.get_http_header(header_name, header_value) - (header_name && header_value) ? {header_name => header_value} : {} - end - - def self.extract_extensions_from_resource(resource, extensions = []) - resource_hash = convert_resource_to_hash(resource) - process_resource_element(resource_hash, extensions) - extensions - end - - def self.get_capability_statement_group_description_text(title, for_group_description = true) - background_title = for_group_description ? '# Background' : '#### Background' - testing_methodology_title = for_group_description ? '# Testing Methodology' : '#### Testing Methodology' - - <<~DESCRIPTION - #{background_title} - The #{title} Sequence tests a FHIR server's ability to formally describe - features supported by the API by using the [Capability - Statement](https://www.hl7.org/fhir/capabilitystatement.html) resource. - The features described in the Capability Statement must be consistent with - the required capabilities of a AU Core **Responder**. - - The Capability Statement resource allows clients to determine which - resources are supported by a FHIR Server. Not all servers are expected to - implement all possible queries and data elements described in the AU Core - API. The **AU Core Responder Capability Statement** requires that - the Patient resource and **at least** one additional resource profile from the AU Core profiles. - - #{testing_methodology_title} - - This test sequence accesses the server endpoint at `/metadata` using a - `GET` request. It parses the Capability Statement and verifies that: - - * The endpoint is secured by an appropriate cryptographic protocol - * The resource matches the expected FHIR version defined by the tests - * The resource is a valid FHIR resource - * The server claims support for JSON encoding of resources - * The server claims support for the Patient resource and one other - resource - - It collects the following information that is saved in the testing session - for use by later tests: - - * List of resources supported - * List of queries parameters supported - DESCRIPTION - end - - def self.get_group_description_text(title, resource_type, profile_name, group_version, profile_url, - required_searches, search_param_name_string, search_validation_resource_type, - for_group_description = true) - background_title = for_group_description ? '# Background' : '#### Background' - testing_methodology_title = for_group_description ? '# Testing Methodology' : '#### Testing Methodology' - must_support_title = for_group_description ? '## Must Support' : '##### Must Support' - profile_validation_title = for_group_description ? '## Profile Validation' : '##### Profile Validation' - reference_validation_title = for_group_description ? '## Reference Validation' : '##### Reference Validation' - - <<~DESCRIPTION - #{background_title} - - The AU Core #{title} sequence verifies that the system under test is - able to provide correct responses for #{resource_type} queries. These queries - must contain resources conforming to the #{profile_name} as - specified in the AU Core #{group_version} Implementation Guide. - - #{testing_methodology_title} - #{search_description(required_searches, search_param_name_string, search_validation_resource_type, for_group_description, resource_type)} - - #{must_support_title} - Each profile contains elements marked as "must support". This test - sequence expects to see each of these elements at least once. If at - least one cannot be found, the test will fail. The test will look - through the #{resource_type} resources found in the first test for these - elements. - - #{profile_validation_title} - Each resource returned from the first search is expected to conform to - the [#{profile_name}](#{profile_url}). Each element is checked against - teminology binding and cardinality requirements. - - Elements with a required binding are validated against their bound - ValueSet. If the code/system in the element is not part of the ValueSet, - then the test will fail. - - #{reference_validation_title} - At least one instance of each external reference in elements marked as - "must support" within the resources provided by the system must resolve. - The test will attempt to read each reference found and will fail if no - read succeeds. - DESCRIPTION - end +module Helpers + DAR_CODE_SYSTEM_URL = 'http://terminology.hl7.org/CodeSystem/data-absent-reason' + DAR_EXTENSION_URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason' + + def self.multiple_test_description(multiple_type, conformance_expectation, search_param_name_string, resource_type, url_version) + multiple_type_str = multiple_type == 'OR' ? 'multipleOr' : 'multipleAnd' + <<~DESCRIPTION.gsub(/\n{3,}/, "\n\n") + A server #{conformance_expectation} support searching by #{multiple_type_str} + #{search_param_name_string} on the #{resource_type} resource. This test + will pass if resources are returned and match the search criteria. If + none are returned, the test is skipped. + + [AU Core Server CapabilityStatement](http://hl7.org.au/fhir/core/#{url_version}/CapabilityStatement-au-core-server.html) + DESCRIPTION + end + def self.get_http_header(header_name, header_value) + (header_name && header_value) ? {header_name => header_value} : {} + end - def self.search_description(required_searches, search_param_name_string, search_validation_resource_type, for_group_description, resource_type) - return '' if required_searches.blank? - - is_independant_group = ['Practitioner', 'PractitionerRole', 'Location', 'Organization'].include? resource_type - basic_search_parameters_text = 'The first search uses the selected patient(s) from the prior launch sequence. Any subsequent searches will look for its parameter values from the results of the first search. For example, the `identifier` search in the patient sequence is performed by looking for an existing `Patient.identifier` from any of the resources returned in the `_id` search. If a value cannot be found this way, the search is skipped.' - independant_search_parameters_text = 'Resources for this test group can\'t be found using patient search parameters. This means that in this particular case, the first test will be a read test, not a search. To ensure that this resource will be available for reading, please review the [prerequisites](https://github.com/hl7au/au-fhir-core-inferno/blob/master/docs/pre-requisites.md). Additionally, you can run this test group separately by using specific resource IDs.' - search_parameters_text = is_independant_group ? independant_search_parameters_text : basic_search_parameters_text - - searching_title = for_group_description ? '## Searching' : '##### Searching' - search_parameters_title = for_group_description ? '### Search Parameters' : '###### Search Parameters' - search_validation_title = for_group_description ? '### Search Validation' : '###### Search Validation' - - <<~SEARCH_DESCRIPTION - #{searching_title} - This test sequence will first perform each required search associated - with this resource. This sequence will perform searches with the - following parameters: - - #{search_param_name_string} - - #{search_parameters_title} - #{search_parameters_text} - - #{search_validation_title} - Inferno will retrieve up to the first 20 bundle pages of the reply for - #{search_validation_resource_type} and save them for subsequent tests. Each of - these resources is then checked to see if it matches the searched - parameters in accordance with [FHIR search - guidelines](https://www.hl7.org/fhir/search.html). The test will fail, - for example, if a Patient search for `gender=male` returns a `female` - patient. - SEARCH_DESCRIPTION - end + def self.extract_extensions_from_resource(resource, extensions = []) + resource_hash = convert_resource_to_hash(resource) + process_resource_element(resource_hash, extensions) + extensions + end - def self.convert_resource_to_hash(resource) - if defined?(FHIR) && resource.is_a?(FHIR::Model) - resource.source_hash.deep_stringify_keys - else + def self.get_capability_statement_group_description_text(title, for_group_description = true) + background_title = for_group_description ? '# Background' : '#### Background' + testing_methodology_title = for_group_description ? '# Testing Methodology' : '#### Testing Methodology' + + <<~DESCRIPTION + #{background_title} + The #{title} Sequence tests a FHIR server's ability to formally describe + features supported by the API by using the [Capability + Statement](https://www.hl7.org/fhir/capabilitystatement.html) resource. + The features described in the Capability Statement must be consistent with + the required capabilities of a AU Core **Responder**. + + The Capability Statement resource allows clients to determine which + resources are supported by a FHIR Server. Not all servers are expected to + implement all possible queries and data elements described in the AU Core + API. The **AU Core Responder Capability Statement** requires that + the Patient resource and **at least** one additional resource profile from the AU Core profiles. + + #{testing_methodology_title} + + This test sequence accesses the server endpoint at `/metadata` using a + `GET` request. It parses the Capability Statement and verifies that: + + * The endpoint is secured by an appropriate cryptographic protocol + * The resource matches the expected FHIR version defined by the tests + * The resource is a valid FHIR resource + * The server claims support for JSON encoding of resources + * The server claims support for the Patient resource and one other resource - end - end - def self.process_resource_element(element, extensions) - case element - when Hash - extensions.concat(element['extension']) if element['extension'].is_a?(Array) - element.each_value do |value| - process_resource_element(value, extensions) - end - when Array - element.each { |item| process_resource_element(item, extensions) } - end - end + It collects the following information that is saved in the testing session + for use by later tests: - def self.custom_validation_group_title_text - 'Custom Validation Group' - end + * List of resources supported + * List of queries parameters supported + DESCRIPTION + end - def self.custom_validation_group_description_text - %( - This test group is designed to validate the conformity of FHIR resources against specified profiles. - Leveraging the dynamic capabilities of FHIR, this validation ensures that the resources adhere to the standards and guidelines established within the relevant AU Core. - ) - end + def self.get_group_description_text(title, resource_type, profile_name, group_version, profile_url, + required_searches, search_param_name_string, search_validation_resource_type, + for_group_description = true) + background_title = for_group_description ? '# Background' : '#### Background' + testing_methodology_title = for_group_description ? '# Testing Methodology' : '#### Testing Methodology' + must_support_title = for_group_description ? '## Must Support' : '##### Must Support' + profile_validation_title = for_group_description ? '## Profile Validation' : '##### Profile Validation' + reference_validation_title = for_group_description ? '## Reference Validation' : '##### Reference Validation' + + <<~DESCRIPTION + #{background_title} + + The AU Core #{title} sequence verifies that the system under test is + able to provide correct responses for #{resource_type} queries. These queries + must contain resources conforming to the #{profile_name} as + specified in the AU Core #{group_version} Implementation Guide. + + #{testing_methodology_title} + #{search_description(required_searches, search_param_name_string, search_validation_resource_type, for_group_description, resource_type)} + + #{must_support_title} + Each profile contains elements marked as "must support". This test + sequence expects to see each of these elements at least once. If at + least one cannot be found, the test will fail. The test will look + through the #{resource_type} resources found in the first test for these + elements. + + #{profile_validation_title} + Each resource returned from the first search is expected to conform to + the [#{profile_name}](#{profile_url}). Each element is checked against + teminology binding and cardinality requirements. + + Elements with a required binding are validated against their bound + ValueSet. If the code/system in the element is not part of the ValueSet, + then the test will fail. + + #{reference_validation_title} + At least one instance of each external reference in elements marked as + "must support" within the resources provided by the system must resolve. + The test will attempt to read each reference found and will fail if no + read succeeds. + DESCRIPTION + end - def self.custom_validation_test_title_text - 'Custom validation of the resource' - end + def self.search_description(required_searches, search_param_name_string, search_validation_resource_type, for_group_description, resource_type) + return '' if required_searches.blank? + + is_independant_group = ['Practitioner', 'PractitionerRole', 'Location', 'Organization'].include? resource_type + basic_search_parameters_text = 'The first search uses the selected patient(s) from the prior launch sequence. Any subsequent searches will look for its parameter values from the results of the first search. For example, the `identifier` search in the patient sequence is performed by looking for an existing `Patient.identifier` from any of the resources returned in the `_id` search. If a value cannot be found this way, the search is skipped.' + independant_search_parameters_text = 'Resources for this test group can\'t be found using patient search parameters. This means that in this particular case, the first test will be a read test, not a search. To ensure that this resource will be available for reading, please review the [prerequisites](https://github.com/hl7au/au-fhir-core-inferno/blob/master/docs/pre-requisites.md). Additionally, you can run this test group separately by using specific resource IDs.' + search_parameters_text = is_independant_group ? independant_search_parameters_text : basic_search_parameters_text + + searching_title = for_group_description ? '## Searching' : '##### Searching' + search_parameters_title = for_group_description ? '### Search Parameters' : '###### Search Parameters' + search_validation_title = for_group_description ? '### Search Validation' : '###### Search Validation' + + <<~SEARCH_DESCRIPTION + #{searching_title} + This test sequence will first perform each required search associated + with this resource. This sequence will perform searches with the + following parameters: + + #{search_param_name_string} + + #{search_parameters_title} + #{search_parameters_text} + + #{search_validation_title} + Inferno will retrieve up to the first 20 bundle pages of the reply for + #{search_validation_resource_type} and save them for subsequent tests. Each of + these resources is then checked to see if it matches the searched + parameters in accordance with [FHIR search + guidelines](https://www.hl7.org/fhir/search.html). The test will fail, + for example, if a Patient search for `gender=male` returns a `female` + patient. + SEARCH_DESCRIPTION + end - def self.custom_validation_test_input_text - 'FHIR resource in JSON format (custom validation)' + def self.convert_resource_to_hash(resource) + if defined?(FHIR) && resource.is_a?(FHIR::Model) + resource.source_hash.deep_stringify_keys + else + resource end + end - def self.custom_validation_test_description_text - %( - This test automatically identifies and validates any provided FHIR resource. - Users are required to input the FHIR resource in JSON format, referred to as 'resource_json'. - The test extracts the applicable profile for validation from the first element in the 'meta.profile' array, located at the path: resource.meta.profile.0. - This profile serves as the benchmark for the validation process. - - Given the optional nature of this test, its results do not influence the final outcome of the test report. - ) + def self.process_resource_element(element, extensions) + case element + when Hash + extensions.concat(element['extension']) if element['extension'].is_a?(Array) + element.each_value do |value| + process_resource_element(value, extensions) + end + when Array + element.each { |item| process_resource_element(item, extensions) } end + end - def self.custom_validation_test_info_resource_type_text(resource_type) - "Resource type to validate is #{resource_type}" - end + def self.custom_validation_group_title_text + 'Custom Validation Group' + end - def self.custom_validation_test_info_profile_text(fhir_resource_profile) - "Resource profile to validate is #{fhir_resource_profile}" - end + def self.custom_validation_group_description_text + %( + This test group is designed to validate the conformity of FHIR resources against specified profiles. + Leveraging the dynamic capabilities of FHIR, this validation ensures that the resources adhere to the standards and guidelines established within the relevant AU Core. + ) + end - def self.custom_validation_test_info_ig_text(ig_version) - "IG version to validate is #{ig_version}" - end + def self.custom_validation_test_title_text + 'Custom validation of the resource' + end - def self.default_patient_ids_string - 'baratz-toni, irvine-ronny-lawrence, italia-sofia, howe-deangelo, hayes-arianne, baby-banks-john, banks-mia-leanne' - end + def self.custom_validation_test_input_text + 'FHIR resource in JSON format (custom validation)' + end - def self.check_for_dar(resource) - resource.each_element do |element, _meta, path| - next unless element.is_a?(FHIR::Coding) + def self.custom_validation_test_description_text + %( + This test automatically identifies and validates any provided FHIR resource. + Users are required to input the FHIR resource in JSON format, referred to as 'resource_json'. + The test extracts the applicable profile for validation from the first element in the 'meta.profile' array, located at the path: resource.meta.profile.0. + This profile serves as the benchmark for the validation process. - return true if (element.code == 'masked' || element.code == 'unknown') && element.system == DAR_CODE_SYSTEM_URL - end + Given the optional nature of this test, its results do not influence the final outcome of the test report. + ) + end - false - end + def self.custom_validation_test_info_resource_type_text(resource_type) + "Resource type to validate is #{resource_type}" + end - def self.check_for_dar_extension(resource) - return resource.source_contents&.include? DAR_EXTENSION_URL - end + def self.custom_validation_test_info_profile_text(fhir_resource_profile) + "Resource profile to validate is #{fhir_resource_profile}" + end - def self.return_uniq_list_resources(resource_list) - return resource_list.uniq - end + def self.custom_validation_test_info_ig_text(ig_version) + "IG version to validate is #{ig_version}" + end - def self.is_message_exist_in_list(message_list, message) - message_list.any? { |list_message| message.include? list_message } - end + def self.default_patient_ids_string + 'baratz-toni, irvine-ronny-lawrence, italia-sofia, howe-deangelo, hayes-arianne, baby-banks-john, banks-mia-leanne' + end - def act_if_with_message(act_func, condition, message) - if condition - info message - end + def self.check_for_dar(resource) + resource.each_element do |element, _meta, path| + next unless element.is_a?(FHIR::Coding) - act_func.call(condition, message) + return true if (element.code == 'masked' || element.code == 'unknown') && element.system == DAR_CODE_SYSTEM_URL end - def self.act_with_message(act_func, message) - info message + false + end - act_func.call(message) - end + def self.check_for_dar_extension(resource) + return resource.source_contents&.include? DAR_EXTENSION_URL + end - def conditional_skip_with_msg(condition, message) - act_if_with_message(method(:skip_if), condition, message) - end + def self.return_uniq_list_resources(resource_list) + return resource_list.uniq + end - def skip_with_msg(message) - act_with_message(method(:skip), message) - end + def self.is_message_exist_in_list(message_list, message) + message_list.any? { |list_message| message.include? list_message } end end diff --git a/lib/au_core_test_kit/must_support_test.rb b/lib/au_core_test_kit/must_support_test.rb index b01b035d..ed5c4a0b 100644 --- a/lib/au_core_test_kit/must_support_test.rb +++ b/lib/au_core_test_kit/must_support_test.rb @@ -1,13 +1,14 @@ # frozen_string_literal: true require_relative 'fhir_resource_navigation' -require_relative 'helpers' +require_relative 'assert_helpers' module AUCoreTestKit module MustSupportTest extend Forwardable include FHIRResourceNavigation include Helpers + include AssertHelpers def_delegators 'self.class', :metadata diff --git a/lib/au_core_test_kit/reference_resolution_test.rb b/lib/au_core_test_kit/reference_resolution_test.rb index 28b2675b..82a08ee0 100644 --- a/lib/au_core_test_kit/reference_resolution_test.rb +++ b/lib/au_core_test_kit/reference_resolution_test.rb @@ -1,13 +1,14 @@ # frozen_string_literal: true require_relative 'fhir_resource_navigation' -require_relative 'helpers' +require_relative 'assert_helpers' module AUCoreTestKit module ReferenceResolutionTest extend Forwardable include FHIRResourceNavigation include Helpers + include AssertHelpers def_delegators 'self.class', :metadata diff --git a/lib/au_core_test_kit/search_test.rb b/lib/au_core_test_kit/search_test.rb index 033cb5b2..c6da8510 100644 --- a/lib/au_core_test_kit/search_test.rb +++ b/lib/au_core_test_kit/search_test.rb @@ -4,7 +4,7 @@ require_relative 'fhir_resource_navigation' require_relative 'search_test_properties' require_relative 'read_test' -require_relative 'helpers' +require_relative 'assert_helpers' module AUCoreTestKit module SearchTest @@ -13,6 +13,7 @@ module SearchTest include FHIRResourceNavigation include ReadTest include Helpers + include AssertHelpers def_delegators 'self.class', :metadata, :provenance_metadata, :properties def_delegators 'properties', diff --git a/lib/au_core_test_kit/special_identifier_search_test.rb b/lib/au_core_test_kit/special_identifier_search_test.rb index a6795dac..eb808edb 100644 --- a/lib/au_core_test_kit/special_identifier_search_test.rb +++ b/lib/au_core_test_kit/special_identifier_search_test.rb @@ -3,12 +3,13 @@ require_relative 'search_test_properties' require_relative 'search_test' require_relative 'helpers' +require_relative 'assert_helpers' module AUCoreTestKit module SpecialIdentifierSearchTest extend Forwardable include SearchTest - include Helpers + include AssertHelpers def_delegators 'self.class', :metadata, :provenance_metadata, :properties def_delegators 'properties', diff --git a/lib/au_core_test_kit/validation_test.rb b/lib/au_core_test_kit/validation_test.rb index 3596390b..a9f23a61 100644 --- a/lib/au_core_test_kit/validation_test.rb +++ b/lib/au_core_test_kit/validation_test.rb @@ -1,10 +1,12 @@ # frozen_string_literal: true require_relative 'helpers' +require_relative 'assert_helpers' module AUCoreTestKit module ValidationTest - include Helpers + include AssertHelpers + DAR_CODE_SYSTEM_URL = 'http://terminology.hl7.org/CodeSystem/data-absent-reason' DAR_EXTENSION_URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason' From 67bde7a7ece217a47b99f9a2e09eed71a230ceef Mon Sep 17 00:00:00 2001 From: nvim Date: Mon, 16 Sep 2024 14:26:31 +0200 Subject: [PATCH 3/3] Undo basic helpers changes Ref: https://github.com/hl7au/au-fhir-core-inferno/issues/71 --- lib/au_core_test_kit/must_support_test.rb | 2 +- lib/au_core_test_kit/reference_resolution_test.rb | 1 - lib/au_core_test_kit/search_test.rb | 1 - lib/au_core_test_kit/special_identifier_search_test.rb | 1 - lib/au_core_test_kit/validation_test.rb | 1 - 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/au_core_test_kit/must_support_test.rb b/lib/au_core_test_kit/must_support_test.rb index ed5c4a0b..ff12ed8a 100644 --- a/lib/au_core_test_kit/must_support_test.rb +++ b/lib/au_core_test_kit/must_support_test.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true require_relative 'fhir_resource_navigation' +require_relative 'helpers' require_relative 'assert_helpers' module AUCoreTestKit module MustSupportTest extend Forwardable include FHIRResourceNavigation - include Helpers include AssertHelpers def_delegators 'self.class', :metadata diff --git a/lib/au_core_test_kit/reference_resolution_test.rb b/lib/au_core_test_kit/reference_resolution_test.rb index 82a08ee0..9bd086a7 100644 --- a/lib/au_core_test_kit/reference_resolution_test.rb +++ b/lib/au_core_test_kit/reference_resolution_test.rb @@ -7,7 +7,6 @@ module AUCoreTestKit module ReferenceResolutionTest extend Forwardable include FHIRResourceNavigation - include Helpers include AssertHelpers def_delegators 'self.class', :metadata diff --git a/lib/au_core_test_kit/search_test.rb b/lib/au_core_test_kit/search_test.rb index c6da8510..3769966f 100644 --- a/lib/au_core_test_kit/search_test.rb +++ b/lib/au_core_test_kit/search_test.rb @@ -12,7 +12,6 @@ module SearchTest include DateSearchValidation include FHIRResourceNavigation include ReadTest - include Helpers include AssertHelpers def_delegators 'self.class', :metadata, :provenance_metadata, :properties diff --git a/lib/au_core_test_kit/special_identifier_search_test.rb b/lib/au_core_test_kit/special_identifier_search_test.rb index eb808edb..db523a87 100644 --- a/lib/au_core_test_kit/special_identifier_search_test.rb +++ b/lib/au_core_test_kit/special_identifier_search_test.rb @@ -2,7 +2,6 @@ require_relative 'search_test_properties' require_relative 'search_test' -require_relative 'helpers' require_relative 'assert_helpers' module AUCoreTestKit diff --git a/lib/au_core_test_kit/validation_test.rb b/lib/au_core_test_kit/validation_test.rb index a9f23a61..e78e9808 100644 --- a/lib/au_core_test_kit/validation_test.rb +++ b/lib/au_core_test_kit/validation_test.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require_relative 'helpers' require_relative 'assert_helpers' module AUCoreTestKit