Class: Inferno::Terminology::Tasks::CreateValueSetValidators

Inherits:
Object
  • Object
show all
Includes:
TempDir
Defined in:
lib/inferno/terminology/tasks/create_value_set_validators.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TempDir

#pipe_files, #umls_dir, #umls_subset_dir, #umls_zip_path, #versioned_temp_dir

Constructor Details

#initialize(minimum_binding_strength:, version:, delete_existing:, type:) ⇒ CreateValueSetValidators

Returns a new instance of CreateValueSetValidators.



11
12
13
14
15
16
# File 'lib/inferno/terminology/tasks/create_value_set_validators.rb', line 11

def initialize(minimum_binding_strength:, version:, delete_existing:, type:)
  @minimum_binding_strength = minimum_binding_strength
  @version = version
  @delete_existing = delete_existing != 'false'
  @type = type.to_sym
end

Instance Attribute Details

#delete_existingObject (readonly)

Returns the value of attribute delete_existing.



9
10
11
# File 'lib/inferno/terminology/tasks/create_value_set_validators.rb', line 9

def delete_existing
  @delete_existing
end

#minimum_binding_strengthObject (readonly)

Returns the value of attribute minimum_binding_strength.



9
10
11
# File 'lib/inferno/terminology/tasks/create_value_set_validators.rb', line 9

def minimum_binding_strength
  @minimum_binding_strength
end

#typeObject (readonly)

Returns the value of attribute type.



9
10
11
# File 'lib/inferno/terminology/tasks/create_value_set_validators.rb', line 9

def type
  @type
end

#versionObject (readonly)

Returns the value of attribute version.



9
10
11
# File 'lib/inferno/terminology/tasks/create_value_set_validators.rb', line 9

def version
  @version
end

Instance Method Details

#db_for_versionObject



28
29
30
# File 'lib/inferno/terminology/tasks/create_value_set_validators.rb', line 28

def db_for_version
  File.join(versioned_temp_dir, 'umls.db')
end

#runObject



18
19
20
21
22
23
24
25
26
# File 'lib/inferno/terminology/tasks/create_value_set_validators.rb', line 18

def run
  Loader.register_umls_db db_for_version
  Loader.load_value_sets_from_directory(PACKAGE_DIR, true)
  Loader.create_validators(
    type:,
    minimum_binding_strength:,
    delete_existing:
  )
end