Class: DaVinciUSDrugFormularyTestKit::Generator::IGMetadataExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata_extractor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_resourcesObject

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

#metadataObject

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_igObject



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_resourcesObject



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

#extractObject



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_statementObject



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