radfusion/database/seeders/InstituteSeeder.php
2025-01-10 14:30:13 +06:00

74 lines
2.0 KiB
PHP

<?php
namespace Database\Seeders;
use App\Domain\Rule\NameMatchModes;
use App\Models\Facility;
use App\Models\Institute;
use App\Models\OrthancHost;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class InstituteSeeder extends Seeder
{
public function run(): void
{
Institute::create([
'name' => 'Catch-all',
'is_active' => true,
]);
$chev = Institute::create([
'name' => 'Chevron',
'is_active' => true,
]);
$cmch = Institute::create([
'name' => 'CMCH',
'is_active' => true,
]);
Institute::create([
'name' => 'Dummy Site',
'is_active' => false,
]);
$chev_xr = Facility::create(
[
'server_name' => 'Orthanc Main',
'host' => 'pacs.mylabctg.com',
'port' => 8042,
'ae_title' => 'RADFUSION',
'institute_id' => $chev->id,
]
);
DB::table('institute_names')->insert([
'name' => 'CHEVRON CLINICAL LABORATORY , PANCHLAISH,CTG',
'institute_id' => $chev->id,
'match_mode' => NameMatchModes::Exact->value,
]);
DB::table('institute_names')->insert([
'name' => 'CHEVRON CLINICAL',
'institute_id' => $chev->id,
'match_mode' => NameMatchModes::StartsWith->value,
]);
OrthancHost::create(
[
'server_name' => 'Orthanc Main',
'host' => 'pacs.mylabctg.com',
'port' => 8042,
'ae_title' => 'RADFUSION',
]
);
OrthancHost::create(
[
'server_name' => 'Orthanc XR',
'host' => 'pacs.mylabctg.com',
'port' => 8043,
'ae_title' => 'RADFUSION',
'institute_id' => $chev->id,
'facility_id' => $chev_xr->id,
]
);
}
}