Class: DaVinciUSDrugFormularyTestKit::Generator
- Inherits:
-
Object
- Object
- DaVinciUSDrugFormularyTestKit::Generator
show all
- Defined in:
- lib/davinci_us_drug_formulary_test_kit/generator.rb,
lib/davinci_us_drug_formulary_test_kit/generator/naming.rb,
lib/davinci_us_drug_formulary_test_kit/generator/ig_loader.rb,
lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata.rb,
lib/davinci_us_drug_formulary_test_kit/generator/ig_resources.rb,
lib/davinci_us_drug_formulary_test_kit/generator/group_metadata.rb,
lib/davinci_us_drug_formulary_test_kit/generator/urls_generator.rb,
lib/davinci_us_drug_formulary_test_kit/generator/group_generator.rb,
lib/davinci_us_drug_formulary_test_kit/generator/suite_generator.rb,
lib/davinci_us_drug_formulary_test_kit/generator/value_extractor.rb,
lib/davinci_us_drug_formulary_test_kit/generator/read_test_generator.rb,
lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata_extractor.rb,
lib/davinci_us_drug_formulary_test_kit/generator/search_test_generator.rb,
lib/davinci_us_drug_formulary_test_kit/generator/group_metadata_extractor.rb,
lib/davinci_us_drug_formulary_test_kit/generator/search_metadata_extractor.rb,
lib/davinci_us_drug_formulary_test_kit/generator/validation_test_generator.rb,
lib/davinci_us_drug_formulary_test_kit/generator/must_support_test_generator.rb,
lib/davinci_us_drug_formulary_test_kit/generator/include_search_test_generator.rb,
lib/davinci_us_drug_formulary_test_kit/generator/must_support_metadata_extractor.rb,
lib/davinci_us_drug_formulary_test_kit/generator/reference_resolution_test_generator.rb,
lib/davinci_us_drug_formulary_test_kit/generator/search_definition_metadata_extractor.rb,
lib/davinci_us_drug_formulary_test_kit/generator/terminology_binding_metadata_extractor.rb
Defined Under Namespace
Modules: Naming
Classes: GroupGenerator, GroupMetadata, GroupMetadataExtractor, IGLoader, IGMetadata, IGMetadataExtractor, IGResources, IncludeSearchTestGenerator, MustSupportMetadataExtractor, MustSupportTestGenerator, ReadTestGenerator, ReferenceResolutionTestGenerator, SearchDefinitionMetadataExtractor, SearchMetadataExtractor, SearchTestGenerator, SuiteGenerator, TerminologyBindingMetadataExtractor, UrlsGenerator, ValidationTestGenerator, ValueExactor
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(ig_file_name) ⇒ Generator
Returns a new instance of Generator.
28
29
30
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 28
def initialize(ig_file_name)
self.ig_file_name = ig_file_name
end
|
Instance Attribute Details
#ig_file_name ⇒ Object
Returns the value of attribute ig_file_name.
26
27
28
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 26
def ig_file_name
@ig_file_name
end
|
Returns the value of attribute ig_metadata.
26
27
28
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 26
def ig_metadata
@ig_metadata
end
|
#ig_resources ⇒ Object
Returns the value of attribute ig_resources.
26
27
28
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 26
def ig_resources
@ig_resources
end
|
Class Method Details
.generate ⇒ Object
18
19
20
21
22
23
24
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 18
def self.generate
ig_packages = Dir.glob(File.join(Dir.pwd, 'lib', 'davinci_us_drug_formulary_test_kit', 'igs', '*.tgz'))
ig_packages.each do |ig_package|
new(ig_package).generate
end
end
|
Instance Method Details
#base_output_dir ⇒ Object
55
56
57
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 55
def base_output_dir
File.join(__dir__, 'generated', ig_metadata.ig_version)
end
|
48
49
50
51
52
53
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 48
def
self.ig_metadata = .new(ig_resources).
FileUtils.mkdir_p(base_output_dir)
File.write(File.join(base_output_dir, 'metadata.yml'), YAML.dump(ig_metadata.to_hash))
end
|
#generate ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 32
def generate
load_ig_package
generate_search_tests
generate_read_tests
generate_include_search_tests
generate_validation_tests
generate_must_support_tests
generate_reference_resolution_tests
generate_urls
generate_groups
generate_suites
end
|
#generate_groups ⇒ Object
88
89
90
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 88
def generate_groups
GroupGenerator.generate(ig_metadata, base_output_dir)
end
|
#generate_include_search_tests ⇒ Object
84
85
86
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 84
def generate_include_search_tests
IncludeSearchTestGenerator.generate(ig_metadata, base_output_dir)
end
|
#generate_must_support_tests ⇒ Object
68
69
70
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 68
def generate_must_support_tests
MustSupportTestGenerator.generate(ig_metadata, base_output_dir)
end
|
#generate_read_tests ⇒ Object
76
77
78
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 76
def generate_read_tests
ReadTestGenerator.generate(ig_metadata, base_output_dir)
end
|
#generate_reference_resolution_tests ⇒ Object
64
65
66
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 64
def generate_reference_resolution_tests
ReferenceResolutionTestGenerator.generate(ig_metadata, base_output_dir)
end
|
#generate_search_tests ⇒ Object
80
81
82
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 80
def generate_search_tests
SearchTestGenerator.generate(ig_metadata, base_output_dir)
end
|
#generate_suites ⇒ Object
92
93
94
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 92
def generate_suites
SuiteGenerator.generate(ig_metadata, base_output_dir)
end
|
#generate_urls ⇒ Object
96
97
98
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 96
def generate_urls
UrlsGenerator.generate(ig_metadata, base_output_dir)
end
|
#generate_validation_tests ⇒ Object
72
73
74
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 72
def generate_validation_tests
ValidationTestGenerator.generate(ig_metadata, base_output_dir)
end
|
#load_ig_package ⇒ Object
59
60
61
62
|
# File 'lib/davinci_us_drug_formulary_test_kit/generator.rb', line 59
def load_ig_package
FHIR.logger = Logger.new('/dev/null')
self.ig_resources = IGLoader.new(ig_file_name).load
end
|