Sha256: ffd5abbdd0cc070ddf2fda9dd76d60df33251412c4ff9c5317397cd8213861b4

Contents?: true

Size: 410 Bytes

Versions: 135

Compression:

Stored size: 410 Bytes

Contents

# frozen_string_literal: true

module Renalware
  log "Adding Renal Reg Cause of Death codes" do
    return if Deaths::Cause.count > 0

    file_path = File.join(File.dirname(__FILE__), "death_causes.csv")
    causes = []
    CSV.foreach(file_path, headers: true) do |row|
      causes << Deaths::Cause.new(code: row["code"], description: row["description"])
    end
    Deaths::Cause.import! causes
  end
end

Version data entries

135 entries across 135 versions & 1 rubygems

Version Path
renalware-core-2.1.1 db/seeds/default/deaths/death_causes.rb
renalware-core-2.1.0 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.167 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.166 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.165 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.164 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.163 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.162 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.161 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.160 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.159 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.158 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.157 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.156 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.155 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.153 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.152 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.151 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.149 db/seeds/default/deaths/death_causes.rb
renalware-core-2.0.148 db/seeds/default/deaths/death_causes.rb