Sha256: 4314392d95c510a312afb99bab08fa1bc3ee8e9b085b11d425eac0cecab7773a

Contents?: true

Size: 704 Bytes

Versions: 24

Compression:

Stored size: 704 Bytes

Contents

module Renalware

  log "Adding Primary Care Physicians\n" do
    sample_status = "SAMPLE ONLY"
    file_path = File.join(File.dirname(__FILE__), "primary_care_physicians_sample.csv")
    #"id","practice_code","gp_code","name","practice_id"

    CSV.foreach(file_path, headers: true) do |row|
      practice_id = row["practice_id"].to_i

      Patients::PrimaryCarePhysician.find_or_create_by!(code: row["gp_code"]) do |doc|
        doc.name = row["name"]
        doc.practitioner_type = "GP"
        doc.practice_ids = [practice_id]
      end
    end
    log_count = Patients::PrimaryCarePhysician.count
    log "#{log_count} NHS primary care physicians imported #{sample_status}", type: :sub
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
renalware-core-2.0.16 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.15 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.14 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.13 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.12 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.11 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.9 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.8 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.7 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.5 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.4 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.3 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.2 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.1 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.0 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.0.pre.rc13 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.0.pre.rc11 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.0.pre.rc10 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.0.pre.rc9 db/seeds/default/practices/primary_care_physicians.rb
renalware-core-2.0.0.pre.rc8 db/seeds/default/practices/primary_care_physicians.rb