Sha256: 59c1b62080abf8706dd02b762d534d6207c6c4ddc6e6e894ac48cb8c00ed29f1

Contents?: true

Size: 626 Bytes

Versions: 54

Compression:

Stored size: 626 Bytes

Contents

# frozen_string_literal: true

module Renalware
  extend SeedsHelper

  log "Adding POS-S Renal Survey" do
    survey = Surveys::Survey.create(name: "PROM", code: "prom", description: "Patient health status")
    file_path = File.join(File.dirname(__FILE__), "pos_s_questions.csv")
    questions = []

    CSV.foreach(file_path, headers: true) do |row|
      questions << Surveys::Question.new(
        survey: survey,
        code: row["code"],
        position: row["position"],
        label: row["label"],
        validation_regex: row["validation_regex"]
      )
    end
    Surveys::Question.import! questions
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

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