Class: DaVinciUSDrugFormularyTestKit::Generator::IGMetadataExtractor
- Inherits:
-
Object
- Object
- DaVinciUSDrugFormularyTestKit::Generator::IGMetadataExtractor
- Defined in:
- lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata_extractor.rb
Instance Attribute Summary collapse
-
#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
- #extract ⇒ Object
-
#initialize(ig_resources) ⇒ IGMetadataExtractor
constructor
A new instance of IGMetadataExtractor.
- #resources_in_capability_statement ⇒ Object
Constructor Details
#initialize(ig_resources) ⇒ IGMetadataExtractor
Returns a new instance of IGMetadataExtractor.
9 10 11 12 |
# File 'lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata_extractor.rb', line 9 def initialize(ig_resources) self.ig_resources = ig_resources self. = IGMetadata.new end |
Instance Attribute Details
#ig_resources ⇒ Object
Returns the value of attribute ig_resources.
7 8 9 |
# File 'lib/davinci_us_drug_formulary_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/davinci_us_drug_formulary_test_kit/generator/ig_metadata_extractor.rb', line 7 def @metadata end |
Instance Method Details
#add_metadata_from_ig ⇒ Object
20 21 22 |
# File 'lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata_extractor.rb', line 20 def .ig_version = "v#{ig_resources.ig.version}" end |
#add_metadata_from_resources ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata_extractor.rb', line 28 def .groups = resources_in_capability_statement.flat_map do |resource| resource.supportedProfile&.map do |supported_profile| GroupMetadataExtractor.new(resource, supported_profile, , ig_resources). end end.compact # metadata.postprocess_groups(ig_resources) end |
#extract ⇒ Object
14 15 16 17 18 |
# File 'lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata_extractor.rb', line 14 def extract end |
#resources_in_capability_statement ⇒ Object
24 25 26 |
# File 'lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata_extractor.rb', line 24 def resources_in_capability_statement ig_resources.capability_statement.rest.first.resource end |