Class: AUCoreTestKit::Generator::SpecialIdentifiersChainSearchTestGenerator
- Inherits:
-
ChainSearchTestGenerator
- Object
- ChainSearchTestGenerator
- AUCoreTestKit::Generator::SpecialIdentifiersChainSearchTestGenerator
- Defined in:
- lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb
Instance Attribute Summary collapse
-
#base_output_dir ⇒ Object
Returns the value of attribute base_output_dir.
-
#chain_item ⇒ Object
Returns the value of attribute chain_item.
-
#group_metadata ⇒ Object
Returns the value of attribute group_metadata.
-
#search_metadata ⇒ Object
Returns the value of attribute search_metadata.
-
#search_name ⇒ Object
Returns the value of attribute search_name.
-
#target_identifier ⇒ Object
Returns the value of attribute target_identifier.
Class Method Summary collapse
Instance Method Summary collapse
- #class_name ⇒ Object
- #description ⇒ Object
-
#initialize(search_name, group_metadata, search_metadata, base_output_dir, chain_item, target_identifier) ⇒ SpecialIdentifiersChainSearchTestGenerator
constructor
A new instance of SpecialIdentifiersChainSearchTestGenerator.
- #search_properties ⇒ Object
- #test_id ⇒ Object
- #title ⇒ Object
Methods inherited from ChainSearchTestGenerator
#array_of_strings, #attribute_paths, #base_output_file_name, #conformance_expectation, #generate, #module_name, #optional?, #output, #output_file_directory, #output_file_name, #profile_identifier, #resource_type, #search_definition, #search_identifier, #search_param_name_string, #search_param_names, #search_param_names_array, #search_test_properties_string, #search_title, #template, #url_version
Constructor Details
#initialize(search_name, group_metadata, search_metadata, base_output_dir, chain_item, target_identifier) ⇒ SpecialIdentifiersChainSearchTestGenerator
Returns a new instance of SpecialIdentifiersChainSearchTestGenerator.
40 41 42 43 |
# File 'lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb', line 40 def initialize(search_name, , , base_output_dir, chain_item, target_identifier) super(search_name, , , base_output_dir, chain_item) self.target_identifier = target_identifier end |
Instance Attribute Details
#base_output_dir ⇒ Object
Returns the value of attribute base_output_dir.
38 39 40 |
# File 'lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb', line 38 def base_output_dir @base_output_dir end |
#chain_item ⇒ Object
Returns the value of attribute chain_item.
38 39 40 |
# File 'lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb', line 38 def chain_item @chain_item end |
#group_metadata ⇒ Object
Returns the value of attribute group_metadata.
38 39 40 |
# File 'lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb', line 38 def @group_metadata end |
#search_metadata ⇒ Object
Returns the value of attribute search_metadata.
38 39 40 |
# File 'lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb', line 38 def @search_metadata end |
#search_name ⇒ Object
Returns the value of attribute search_name.
38 39 40 |
# File 'lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb', line 38 def search_name @search_name end |
#target_identifier ⇒ Object
Returns the value of attribute target_identifier.
38 39 40 |
# File 'lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb', line 38 def target_identifier @target_identifier end |
Class Method Details
.generate(ig_metadata, base_output_dir) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb', line 11 def generate(, base_output_dir) .groups .select { |group| group.searches.present? } .each do |group| group.search_definitions.each_key do |search_key| current_search_definition = group.search_definitions[search_key] next unless current_search_definition.key?(:chain) && current_search_definition[:chain].length.positive? current_search_definition[:chain].each do |chain_item| next unless chain_item[:target] == 'Patient' SpecialCases.patient_au_identifiers.each do |target_identifier| new( search_key.to_s, group, group.search_definitions[search_key], base_output_dir, chain_item, target_identifier ).generate end end end end end |
Instance Method Details
#class_name ⇒ Object
49 50 51 |
# File 'lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb', line 49 def class_name "#{Naming.upper_camel_case_for_profile()}#{search_title}_#{target_identifier[:display]}_ChainSearchTest" end |
#description ⇒ Object
66 67 68 69 70 71 72 73 74 |
# File 'lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb', line 66 def description <<~DESCRIPTION.gsub(/\n{3,}/, "\n\n") A server #{conformance_expectation} support searching by #{search_param_names.first} (#{target_identifier[:display]}) on the #{resource_type} resource. This test will pass if the server returns a success response to the request. [AU Core Server CapabilityStatement](http://hl7.org.au/fhir/core/#{url_version}/CapabilityStatement-au-core-server.html) DESCRIPTION end |
#search_properties ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb', line 53 def search_properties {}.tap do |properties| properties[:resource_type] = "'#{resource_type}'" properties[:search_param_names] = search_param_names_array properties[:attr_paths] = attribute_paths properties[:target_identifier] = target_identifier end end |
#test_id ⇒ Object
45 46 47 |
# File 'lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb', line 45 def test_id "au_core_#{.reformatted_version}_#{profile_identifier}_#{search_identifier}_#{target_identifier[:display].downcase}_chain_search_test" end |
#title ⇒ Object
62 63 64 |
# File 'lib/au_core_test_kit/generator/special_identifiers_chain_search_test_generator.rb', line 62 def title "Server returns valid results for #{resource_type} search by #{search_param_name_string} (#{target_identifier[:display]}) (chained parameters)" end |