summaryrefslogtreecommitdiff
path: root/rvh/db/seeds.rb
blob: b60228d6c3528c5f926e4c7fb81ae15ea296388e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
puts "Create seed data"

CareCentre.create!([
  { name: 'Intensive Care Unit', location: 'MT-M' },
  { name: 'Pshychiatry', location: 'FMC-2' },
  { name: 'Adult Outpatient Mental Health', location: 'SSB-2' },
  { name: 'Child & Adolescent Pshyciatry', location: 'SSB-2' },
  { name: 'Burns', location: 'FMC-3' },
  { name: 'Surgery - Head & Neck / Plastics', location: 'FMC-3' },
  { name: 'Acute Medicine', location: 'FMC-3' },
  { name: 'Medicine', location: 'SSB-3' },
  { name: 'Renal', location: 'SSB-3' },
  { name: 'Solid Organ Transplant', location: 'SSB-3' },
  { name: 'Ante Partum', location: 'FMC-4' },
  { name: 'Surgery - Short Stay', location: 'FMC-4' },
  { name: 'Gynecology / Gyne-Oncology', location: 'FMC-4' },
  { name: 'Trauma', location: 'MT-4' },
  { name: 'Medicine', location: 'SSB-4' },
  { name: 'Acute Medicine / Aphersis', location: 'SSB-4' },
  { name: 'Labour & Delivery', location: 'FMC-5' },
  { name: 'Post Partum', location: 'FMC-5' },
  { name: 'Orthopedics', location: 'MT-5' },
  { name: 'Neonatal Intensive Care Unit (NICU)', location: 'FMC-5' },
  { name: 'Hematology / Oncology / BMT', location: 'SSB-5' },
  { name: 'Hematology / BMT / Day Medicine', location: 'SSB-5' },
  { name: 'Neuro Rehab', location: 'SSB-5' },
  { name: 'Thoracic Surgery / Pulmonary Medicine', location: 'SSB-6' },
  { name: 'Medicine', location: 'FMC-6' },
  { name: 'Orthopedics', location: 'MT-6' },
  { name: 'Transition', location: 'FMC-7' },
])

CareCentre.find_each do |care_centre|
  Bed.create!(10.times.map { |n| { care_centre: care_centre, room_number: n.to_s } })
end

Employee.create!([
  {
    account: Account.create!({ name: 'mo', address: '123 1 street NW', birth_date: 30.years.ago }),
    type: 'Nurse',
    hired_at: 1.year.ago,
    qualifications: ['medicine']
  }
])