lib/inferno/terminology/loader.rb
# Saves the valueset to a csv
# @param [String] filename the name of the file
Saves the valueset to a csv
Saves the valueset to a csv
def save_csv_to_file(codings, filename)
          csv_set = Set.new
          if File.file? filename
            CSV.read(filename).each do |code_array|
              csv_set.add({ code: code_array[1], system: code_array[0] })
            end
          end
          codings.merge csv_set
          CSV.open(filename, 'wb') do |csv|
            codings.each do |coding|
              csv << [coding[:system], coding[:code]]
            end
          end
          codings.length
        end
def save_csv_to_file ( codings , filename ) csv_set = Set . new if File . file? filename CSV . read ( filename ) . each do | code_array | csv_set . add ( { code : code_array [ 1 ] , system : code_array [ 0 ] } ) end end codings . merge csv_set CSV . open ( filename , 'wb' ) do | csv | codings . each do | coding | csv << [ coding [ :system ] , coding [ :code ] ] end end codings . length end
Saves the valueset to a csv
Saves the valueset to a csv
# If the file already exists, add it to the Set
codings
<not_specific>
filename
<not_specific>
<not_specific>
filename the name of the file
filename the name of the file