Class: IpaTestKit::Generator::IGMetadataExtractor
- Inherits:
-
Object
- Object
- IpaTestKit::Generator::IGMetadataExtractor
- Defined in:
- lib/ipa_test_kit/generator/ig_metadata_extractor.rb
Instance Attribute Summary collapse
-
#base_search_params ⇒ Object
Returns the value of attribute base_search_params.
-
#ig_resources ⇒ Object
Returns the value of attribute ig_resources.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
Instance Method Summary collapse
- #add_metadata_from_ig ⇒ Object
- #add_metadata_from_resources ⇒ Object
- #add_missing_supported_profiles ⇒ Object
- #extract ⇒ Object
-
#initialize(ig_resources, base_search_params) ⇒ IGMetadataExtractor
constructor
A new instance of IGMetadataExtractor.
- #remove_extra_supported_profiles ⇒ Object
- #resources_in_capability_statement ⇒ Object
Constructor Details
#initialize(ig_resources, base_search_params) ⇒ IGMetadataExtractor
Returns a new instance of IGMetadataExtractor.
9 10 11 12 13 14 15 |
# File 'lib/ipa_test_kit/generator/ig_metadata_extractor.rb', line 9 def initialize(ig_resources, base_search_params) self.ig_resources = ig_resources self.base_search_params = base_search_params add_missing_supported_profiles remove_extra_supported_profiles self. = IGMetadata.new end |
Instance Attribute Details
#base_search_params ⇒ Object
Returns the value of attribute base_search_params.
7 8 9 |
# File 'lib/ipa_test_kit/generator/ig_metadata_extractor.rb', line 7 def base_search_params @base_search_params end |
#ig_resources ⇒ Object
Returns the value of attribute ig_resources.
7 8 9 |
# File 'lib/ipa_test_kit/generator/ig_metadata_extractor.rb', line 7 def ig_resources @ig_resources end |
#metadata ⇒ Object
Returns the value of attribute metadata.
7 8 9 |
# File 'lib/ipa_test_kit/generator/ig_metadata_extractor.rb', line 7 def @metadata end |
Instance Method Details
#add_metadata_from_ig ⇒ Object
23 24 25 |
# File 'lib/ipa_test_kit/generator/ig_metadata_extractor.rb', line 23 def .ig_version = "v#{ig_resources.ig.version}" end |
#add_metadata_from_resources ⇒ Object
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ipa_test_kit/generator/ig_metadata_extractor.rb', line 47 def .groups = resources_in_capability_statement.flat_map do |resource| ([resource.profile] + resource.supportedProfile).uniq&.map do |supported_profile| GroupMetadataExtractor.new(resource, supported_profile, , ig_resources, base_search_params). end.compact end .postprocess_groups(ig_resources) end |
#add_missing_supported_profiles ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/ipa_test_kit/generator/ig_metadata_extractor.rb', line 31 def add_missing_supported_profiles ig_resources.capability_statement.rest.first.resource .find { |resource| resource.type == 'Observation' } .supportedProfile.concat [ 'http://hl7.org/fhir/StructureDefinition/vitalsigns' ] end |
#extract ⇒ Object
17 18 19 20 21 |
# File 'lib/ipa_test_kit/generator/ig_metadata_extractor.rb', line 17 def extract end |
#remove_extra_supported_profiles ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/ipa_test_kit/generator/ig_metadata_extractor.rb', line 39 def remove_extra_supported_profiles ig_resources.capability_statement.rest.first.resource .find { |resource| resource.type == 'Observation' } .supportedProfile.delete_if do |profile_url| SpecialCases::PROFILES_TO_EXCLUDE.include?(profile_url) end end |
#resources_in_capability_statement ⇒ Object
27 28 29 |
# File 'lib/ipa_test_kit/generator/ig_metadata_extractor.rb', line 27 def resources_in_capability_statement ig_resources.capability_statement.rest.first.resource end |