Files
streamline-emr/docker/streamline-src/database/seeders/WardsTableSeeder.php
T
alec.turner 4a89356390 Import latest app updates from streamline
An updated set of source files and initialization was provided by streamline to
address issues observed during initial testing. These files have been updated in
order to generate a new set of app images.
2024-04-11 11:16:51 -07:00

64 lines
3.8 KiB
PHP
Executable File

<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Streamline\Models\Ward;
class WardsTableSeeder extends Seeder {
/**
* Run the database seeders.
*
* @return void
*/
public function run() {
$wards = [
// ['id' => '1', 'name' => 'CHILDREN', 'beds' => '40'],
// ['id' => '2', 'name' => 'MEDICAL LOWER (ISOLATION)', 'beds' => '29'],
// ['id' => '3', 'name' => 'MATERNITY', 'beds' => '34'],
// ['id' => '4', 'name' => 'MEDICAL UPPER', 'beds' => '32'],
// ['id' => '5', 'name' => 'PSYCHIATRY Ahumuza Centre', 'beds' => '25'],
// ['id' => '6', 'name' => 'REHABILITATION', 'beds' => '45'],
// ['id' => '7', 'name' => 'SPECIAL CARE BABY UNIT', 'beds' => '10'],
// ['id' => '8', 'name' => 'SURGICAL MALE', 'beds' => '24'],
// ['id' => '9', 'name' => 'SURGICAL FEMALE', 'beds' => '18'],
// ['id' => '10', 'name' => 'THEATRE', 'beds' => '0'],
// ['id' => '11', 'name' => 'OPD', 'beds' => '0'],
// ['id' => '13', 'name' => 'NIGHT NURSES CUPBOARD', 'beds' => '0'],
// ['id' => '14', 'name' => 'DEMO TEST WARD', 'beds' => '0'],
// ['id' => '15', 'name' => 'SCHOOL OF NURSING', 'beds' => '0'],
// ['id' => '16', 'name' => 'GYNAECOLOGY WARD', 'beds' => '24']
['id' => '1', 'slug'=>'medical-male', 'name'=>'Male medical ward', 'beds' => '40','hmis_ward_id'=>'1'],
['id' => '2', 'slug'=>'medical-female', 'name'=>'Female medical ward', 'beds' => '29','hmis_ward_id'=>'2'],
['id' => '3', 'slug'=>'paediatrics', 'name'=>'Paediatrics ward', 'beds' => '34','hmis_ward_id'=>'3'],
['id' => '4', 'slug'=>'maternity', 'name'=>'Maternity/Obstetric ward', 'beds' => '52','hmis_ward_id'=>'4'],
['id' => '5', 'slug'=>'male-surgical', 'name'=>'Male surgical', 'beds' => '25','hmis_ward_id'=>'5'],
['id' => '6', 'slug'=>'female-surgical', 'name'=>'Female surgical', 'beds' => '45','hmis_ward_id'=>'6'],
['id' => '7', 'slug'=>'tb', 'name'=>'TB ward', 'beds' => '10','hmis_ward_id'=>'7'],
['id' => '8', 'slug'=>'psychiatric', 'name'=>'Psychiatric ward', 'beds' => '24','hmis_ward_id'=>'8'],
['id' => '9', 'slug'=>'nutrition', 'name'=>'Nutrition Ward/Corner', 'beds' => '18','hmis_ward_id'=>'9'],
['id' => '10', 'slug'=>'emergency', 'name'=>'Emergency ward', 'beds' => '20','hmis_ward_id'=>'10'],
['id' => '11', 'slug'=>'gynaecology', 'name'=>'Gynaecology ward', 'beds' => '10','hmis_ward_id'=>'11'],
['id' => '13', 'slug'=>'acu', 'name'=>'Acute care unit (ACU)', 'beds' => '10','hmis_ward_id'=>'12'],
['id' => '14', 'slug'=>'palliative', 'name'=>'Palliative ward', 'beds' => '18','hmis_ward_id'=>'13'],
['id' => '15', 'slug'=>'eye', 'name'=>'Eye ward', 'beds' => '15','hmis_ward_id'=>'14'],
['id' => '16', 'slug'=>'others', 'name'=>'Others', 'beds' => '1','hmis_ward_id'=>'18'],
['id' => '17', 'slug'=>'icu', 'name'=>'Intensive care unit (ICU)', 'beds' => '24','hmis_ward_id'=>'15'],
['id' => '18', 'slug'=>'ent', 'name'=>'Ear, Nose and Throat (ENT)', 'beds' => '8','hmis_ward_id'=>'16'],
['id' => '19', 'slug'=>'orthopaedic', 'name'=>'Orthopaedic ward', 'beds' => '9','hmis_ward_id'=>'17']
];
foreach ($wards as $value) {
Ward::firstOrCreate([
"id" => $value['id'],
"name" => $value['name'],
"beds" => $value['beds'],
"slug" => $value['slug'],
"type" => $value['slug'],
"hmis_ward_id"=> $value['hmis_ward_id']
]);
}
}
}