44 lines
1.4 KiB
PHP
44 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\DicomServer;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class DicomServerSeeder extends Seeder
|
|
{
|
|
public function run(): void
|
|
{
|
|
$skip_first = true;
|
|
$csv_file = fopen(base_path('database/data/dicom-servers.csv'), 'r');
|
|
while (($data = fgetcsv($csv_file, 2000, ',')) !== false) {
|
|
if ($skip_first) {
|
|
$skip_first = false;
|
|
|
|
continue;
|
|
}
|
|
$data = array_trim_strings($data, true);
|
|
DicomServer::create([
|
|
'is_active' => (bool) $data['0'],
|
|
'server_name' => strtoupper($data['1']),
|
|
'geo_code' => $data['2'],
|
|
'host' => $data['3'],
|
|
'http_port' => $data['4'],
|
|
'dicom_port' => $data['5'],
|
|
'rest_api_endpoint' => $data['6'],
|
|
'ae_title' => strtoupper($data['7']),
|
|
'username' => strtolower($data['8'] ?? ''),
|
|
'password' => $data['9'],
|
|
'wado_path' => $data['10'],
|
|
'stone_viewer_path' => $data['11'],
|
|
'ohif_viewer_path' => $data['12'],
|
|
'meddream_viewer_path' => $data['13'],
|
|
// 'organization' => $data['14'],
|
|
// 'department' => $data['15'],
|
|
]);
|
|
}
|
|
fclose($csv_file);
|
|
|
|
}
|
|
}
|