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.0.127 db/seeds/default/patients/surveys/pos_s.rb
renalware-core-2.0.126 db/seeds/default/patients/surveys/pos_s.rb
renalware-core-2.0.125 db/seeds/default/patients/surveys/pos_s.rb
renalware-core-2.0.124 db/seeds/default/patients/surveys/pos_s.rb
renalware-core-2.0.123 db/seeds/default/patients/surveys/pos_s.rb
renalware-core-2.0.121 db/seeds/default/patients/surveys/pos_s.rb
renalware-core-2.0.120 db/seeds/default/patients/surveys/pos_s.rb
renalware-core-2.0.119 db/seeds/default/patients/surveys/pos_s.rb
renalware-core-2.0.118 db/seeds/default/patients/surveys/pos_s.rb
renalware-core-2.0.117 db/seeds/default/patients/surveys/pos_s.rb
renalware-core-2.0.116 db/seeds/default/patients/surveys/pos_s.rb
renalware-core-2.0.115 db/seeds/default/patients/surveys/pos_s.rb
renalware-core-2.0.113 db/seeds/default/patients/surveys/pos_s.rb
renalware-core-2.0.112 db/seeds/default/patients/surveys/pos_s.rb