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