seeding - images, rules
This commit is contained in:
parent
05b615fc75
commit
7f5d594a24
@ -1,3 +1,3 @@
|
||||
is_active,organization,name
|
||||
1,Chevron Panchlaish,CR
|
||||
1,Chevron Panchlaish,DR
|
||||
1,Chevron Panchlaish,Imaging
|
||||
|
|
@ -1,27 +1,27 @@
|
||||
DNAME,PREFIX,FNAME,LNAME,DEGREE,USERNAME,EMAIL,PHONE,ROLE,ORG,DEPT
|
||||
Dr. Sadrul ,Dr.,Sadrul ,Amin ,"MBBS, FCPS, M-Phil, MD (Radiology & Imaging), Ex-Associate Professor, Department of Radiology & Imaging, Bangabandhu Sheikh Mujib Medical University, BMDC Reg. No: A-26619",aminsadrul@gmail.com,aminsadrul@gmail.com,8801711362820,RAD,,
|
||||
Prof. Dr. Subash ,Prof. Dr.,Subash ,Mazumder,"MBBS, MD, HOD (Radiology & Imaging), Chittagong Medical College Hospital. BMDC Reg. No: A 23715",subashmajumder@yahoo.com,subashmajumder@yahoo.com,8801819329484,RAD,,
|
||||
Dr. Goutam ,Dr.,Goutam,Chowdhury ,"MBBS, M.MED, MRCR (London), Fellow Radiology, Act (Neuro-Radiology), Consultant, Radiology & Imaging. BMDC Reg. No: A-32086",drgoutam,,,RAD,,
|
||||
Brig. Gen. Khairul,Brig. Gen. Dr.,Md. Khairul ,Islam,"MBBS, FCPS (Radiology & Imaging), Advanced Training on MRI, CT & Coronary CT Angiogram (India). Senior Consultant, Radiology & Imaging",drkhairul,,8801715059151,RAD,,
|
||||
Prof. Dr. Col. Nasir,Prof. Dr.Col. (Retd),Md. Nasir ,Uddin,"MBBS, FCPS, ARDMS, RVT, ARMRIT (USA), TMSS Medical College & Hospital, Bogura, Consultant Radiologist, Popular Diagnostic Center. BMDC Reg. No: A-21609",drnasir770@gmail.com,drnasir770@gmail.com,8801715748987,RAD,,
|
||||
Prof. Brig. Gen. Saad ,Prof. (Brig. Gen),A M Hossain,Saad,"Classified Specialist, Radiology & Imaging, Armed Forces Medical College, Dhaka Cantonment. MBBS, FCPS. Fellow CT Scan (Dublin & Germany). Fellow MRI (KSA)",drsaad,,8801715059151,RAD,,
|
||||
Brig. Gen. Anwarul,Brig. Gen. (Retd),M Anwarul ,Haque,"MBBS. FCPS.(Radiology). Advance Training in CT & MRI (KSA), BMDC Reg. No: A -13336",dr.mahaque60@gmail.com,dr.mahaque60@gmail.com,8801911302505,RAD,,
|
||||
Dr. Moinul ,Dr.,Mohammad Moinul,Hossain,"MBBS, MD (Radiology & Imaging)-BSMMU, Consultant (Radiology & Imaging), Radiology & Imaging Specialist, BMDC Reg. No: A-33097",mmhossainsa06@gmail.com,mmhossainsa06@gmail.com,8801715129437,RAD,,
|
||||
Prof. Rabeya ,Asst. Prof. Dr. ,Rabeya,Khatoon,"MBBS, MCPS, MD (BSMMU), Consultant, Radiolgoy & Imaging, BIRDEM, Dhaka. BMDC Reg. No: A-47981",drrabeya,,,RAD,,
|
||||
Prof. Col. Anowar,Prof. Col. Dr.,Anowar ,Hossain,"MBBS,FCPS (Radiology & Imaging), Fellow Cardiovascular Imaging (CT and MRI). All India Institute of Medical Science, New Delhi, India. Department of Radiology & Imaging Armed Forces Medical College & CMH Dhaka, BMDC Reg No : A-32496",dranowar,,8801795430240,RAD,,
|
||||
Dr. Hamid,Dr.,Hamid ,Alam ,,drhamid,,16462956323,RAD,,
|
||||
Dr. Shabiha ,Dr.,Shabiha,Quadir ,,dr.shabihaquadir@gmail.com,dr.shabihaquadir@gmail.com,8801819876760,RAD,,
|
||||
Dr. Ehsan,Dr.,Ehsan S,Choudhury,,ehsanchy@gmail.com,ehsanchy@gmail.com,8801711898269,RAD,,
|
||||
Dr. Mobin,Dr.,Mobinul Alam,Chowdhury ,,mobinchy@hotmail.com,mobinchy@hotmail.com,8801819775757,RAD,,
|
||||
Noor Mohammad ,,Noor ,Mohammad ,,noor.mohammad024@gmail.com,noor.mohammad024@gmail.com,8801716817712,TECH,Chevron Panchlaish,Imaging
|
||||
Ali Akbar ,,Ali ,Akbar ,,ali.akbar.ri@gmail.com,ali.akbar.ri@gmail.com,8801816913564,TECH,Chevron Panchlaish,Imaging
|
||||
Bulbul,,Mahbubul ,Islam ,,bulbulislam10@gmail.com,bulbulislam10@gmail.com,8801761587552,TECH,Chevron Panchlaish,Imaging
|
||||
Zulhas,,Zillur Rahman,Zulhas,,rahmanmdzillur9@gmail.com,rahmanmdzillur9@gmail.com,8801868658028,TECH,Chevron Panchlaish,Imaging
|
||||
Dr. Masroor,Dr.,Masroor Ehsan,Choudhury,,masroor,masroore@gmail.com,8801733938582,ADMIN,,
|
||||
Sumit,,Sumit,Majumder,,sumit.chvrnit@gmail.com,sumit.chvrnit@gmail.com,8801822224492,ADMIN,,
|
||||
Saiful,,Saiful,Islam,,saiful,,8801824534945,TECH,Chevron Panchlaish,Imaging
|
||||
Apon,,Apon,,,apon,,8801627970974,TECH,Chevron Panchlaish,Imaging
|
||||
Chevron CR,,X-ray,Tech,,chevroncr,,,TECH,Chevron Panchlaish,CR
|
||||
Dr. Gopinathan,Dr.,Gopinathan,,"MBBS, MDRD, Reg No.62980",drgopinathan,,,RAD,,
|
||||
Dr. Sudha,Dr.,K Sudha,,"MBBS, MDRD",drsudha,,,RAD,,
|
||||
Dr. Rajkumar,Dr.,Rajkumar,,MBBS MDRD Reg No.TMMC130572,drrajkumar,,,RAD,,
|
||||
DNAME,PREFIX,FNAME,LNAME,DEGREE,USERNAME,EMAIL,PHONE,ROLE,ORG,DEPT,SIGN_IMG
|
||||
Dr. Sadrul ,Dr.,Sadrul ,Amin ,"MBBS, FCPS, M-Phil, MD (Radiology & Imaging), Ex-Associate Professor, Department of Radiology & Imaging, Bangabandhu Sheikh Mujib Medical University, BMDC Reg. No: A-26619",aminsadrul@gmail.com,aminsadrul@gmail.com,8801711362820,RAD,,,sadrul-amin.png
|
||||
Prof. Dr. Subash ,Prof. Dr.,Subash ,Mazumder,"MBBS, MD, HOD (Radiology & Imaging), Chittagong Medical College Hospital. BMDC Reg. No: A 23715",subashmajumder@yahoo.com,subashmajumder@yahoo.com,8801819329484,RAD,,,subash.png
|
||||
Dr. Goutam ,Dr.,Goutam,Chowdhury ,"MBBS, M.MED, MRCR (London), Fellow Radiology, Act (Neuro-Radiology), Consultant, Radiology & Imaging. BMDC Reg. No: A-32086",drgoutam,,,RAD,,,
|
||||
Brig. Gen. Khairul,Brig. Gen. Dr.,Md. Khairul ,Islam,"MBBS, FCPS (Radiology & Imaging), Advanced Training on MRI, CT & Coronary CT Angiogram (India). Senior Consultant, Radiology & Imaging",drkhairul,,8801715059151,RAD,,,khairul-islam.png
|
||||
Prof. Dr. Col. Nasir,Prof. Dr.Col. (Retd),Md. Nasir ,Uddin,"MBBS, FCPS, ARDMS, RVT, ARMRIT (USA), TMSS Medical College & Hospital, Bogura, Consultant Radiologist, Popular Diagnostic Center. BMDC Reg. No: A-21609",drnasir770@gmail.com,drnasir770@gmail.com,8801715748987,RAD,,,nasir-uddin.png
|
||||
Prof. Brig. Gen. Saad ,Prof. (Brig. Gen),A M Hossain,Saad,"Classified Specialist, Radiology & Imaging, Armed Forces Medical College, Dhaka Cantonment. MBBS, FCPS. Fellow CT Scan (Dublin & Germany). Fellow MRI (KSA)",drsaad,,8801715059151,RAD,,,hossain-saad.png
|
||||
Brig. Gen. Anwarul,Brig. Gen. (Retd),M Anwarul ,Haque,"MBBS. FCPS.(Radiology). Advance Training in CT & MRI (KSA), BMDC Reg. No: A -13336",dr.mahaque60@gmail.com,dr.mahaque60@gmail.com,8801911302505,RAD,,,
|
||||
Dr. Moinul ,Dr.,Mohammad Moinul,Hossain,"MBBS, MD (Radiology & Imaging)-BSMMU, Consultant (Radiology & Imaging), Radiology & Imaging Specialist, BMDC Reg. No: A-33097",mmhossainsa06@gmail.com,mmhossainsa06@gmail.com,8801715129437,RAD,,,
|
||||
Prof. Rabeya ,Asst. Prof. Dr. ,Rabeya,Khatoon,"MBBS, MCPS, MD (BSMMU), Consultant, Radiolgoy & Imaging, BIRDEM, Dhaka. BMDC Reg. No: A-47981",drrabeya,,,RAD,,,rabeya-khatoon.png
|
||||
Prof. Col. Anowar,Prof. Col. Dr.,Anowar ,Hossain,"MBBS,FCPS (Radiology & Imaging), Fellow Cardiovascular Imaging (CT and MRI). All India Institute of Medical Science, New Delhi, India. Department of Radiology & Imaging Armed Forces Medical College & CMH Dhaka, BMDC Reg No : A-32496",dranowar,,8801795430240,RAD,,,
|
||||
Dr. Hamid,Dr.,Hamid ,Alam ,,drhamid,,16462956323,RAD,,,
|
||||
Dr. Shabiha ,Dr.,Shabiha,Quadir ,,dr.shabihaquadir@gmail.com,dr.shabihaquadir@gmail.com,8801819876760,RAD,,,
|
||||
Dr. Ehsan,Dr.,Ehsan S,Choudhury,,ehsanchy@gmail.com,ehsanchy@gmail.com,8801711898269,RAD,,,
|
||||
Dr. Mobin,Dr.,Mobinul Alam,Chowdhury ,,mobinchy@hotmail.com,mobinchy@hotmail.com,8801819775757,RAD,,,
|
||||
Noor Mohammad ,,Noor ,Mohammad ,,noor.mohammad024@gmail.com,noor.mohammad024@gmail.com,8801716817712,TECH,Chevron Panchlaish,Imaging,
|
||||
Ali Akbar ,,Ali ,Akbar ,,ali.akbar.ri@gmail.com,ali.akbar.ri@gmail.com,8801816913564,TECH,Chevron Panchlaish,Imaging,
|
||||
Bulbul,,Mahbubul ,Islam ,,bulbulislam10@gmail.com,bulbulislam10@gmail.com,8801761587552,TECH,Chevron Panchlaish,Imaging,
|
||||
Zulhas,,Zillur Rahman,Zulhas,,rahmanmdzillur9@gmail.com,rahmanmdzillur9@gmail.com,8801868658028,TECH,Chevron Panchlaish,Imaging,
|
||||
Dr. Masroor,Dr.,Masroor Ehsan,Choudhury,,masroor,masroore@gmail.com,8801733938582,ADMIN,,,
|
||||
Sumit,,Sumit,Majumder,,sumit.chvrnit@gmail.com,sumit.chvrnit@gmail.com,8801822224492,ADMIN,,,
|
||||
Saiful,,Saiful,Islam,,saiful,,8801824534945,TECH,Chevron Panchlaish,Imaging,
|
||||
Apon,,Apon,,,apon,,8801627970974,TECH,Chevron Panchlaish,Imaging,
|
||||
Chevron CR,,X-ray,Tech,,chevroncr,,,TECH,Chevron Panchlaish,DR,
|
||||
Dr. Gopinathan,Dr.,Gopinathan,,"MBBS, MDRD, Reg No.62980",drgopinathan,,,RAD,,,
|
||||
Dr. Sudha,Dr.,K Sudha,,"MBBS, MDRD",drsudha,,,RAD,,,
|
||||
Dr. Rajkumar,Dr.,Rajkumar,,MBBS MDRD Reg No.TMMC130572,drrajkumar,,,RAD,,,
|
|
@ -16,6 +16,7 @@ public function run(): void
|
||||
RoleSeeder::class,
|
||||
OrganizationSeeder::class,
|
||||
DicomServerSeeder::class,
|
||||
DicomRoutingRuleSeeder::class,
|
||||
UserSeeder::class,
|
||||
ModalityProcedureSeeder::class,
|
||||
]);
|
||||
|
43
database/seeders/DicomRoutingRuleSeeder.php
Normal file
43
database/seeders/DicomRoutingRuleSeeder.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Department;
|
||||
use App\Models\DicomRoutingRule;
|
||||
use App\Models\Organization;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DicomRoutingRuleSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$chev = Organization::where('name', 'Chevron Panchlaish')->first();
|
||||
$dept_chev_xr = Department::where('name', 'DR')->first();
|
||||
$chev_dep_ct_mr = Department::where('name', 'Imaging')->first();
|
||||
|
||||
$dr_modalities = ['DR', 'CR', 'DX', 'MG', 'OT', 'RF', 'XA', 'XRF', 'DXA', 'DBT', 'OPT'];
|
||||
$dr = collect($dr_modalities)->map(fn ($modality) => sprintf('"%s"', $modality))->implode(',');
|
||||
|
||||
DicomRoutingRule::create(
|
||||
[
|
||||
'is_active' => true,
|
||||
'name' => 'Chevron Panchlaish Imaging',
|
||||
'organization_id' => $chev->id,
|
||||
'department_id' => $chev_dep_ct_mr->id,
|
||||
'condition' => sprintf('(study.institution_name ?? "" starts with "chevron") and (study.modality not in [%s])', $dr),
|
||||
]
|
||||
);
|
||||
|
||||
DicomRoutingRule::create(
|
||||
[
|
||||
'is_active' => true,
|
||||
'name' => 'Chevron Panchlaish X-ray',
|
||||
'organization_id' => $chev->id,
|
||||
'department_id' => $dept_chev_xr->id,
|
||||
'condition' => sprintf('(study.institution_name ?? "" starts with "chevron") and (study.modality in [%s])', $dr),
|
||||
'priority' => 99,
|
||||
]
|
||||
);
|
||||
|
||||
}
|
||||
}
|
@ -3,7 +3,6 @@
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Department;
|
||||
use App\Models\DicomRoutingRule;
|
||||
use App\Models\Organization;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
@ -45,28 +44,5 @@ public function run(): void
|
||||
$skip_first = false;
|
||||
}
|
||||
fclose($dept_csv);
|
||||
|
||||
/*
|
||||
$rul_chev_mr_ct = DicomRoutingRule::create(
|
||||
[
|
||||
'is_active' => true,
|
||||
'name' => 'Chevron MR/CT',
|
||||
'organization_id' => $chev->id,
|
||||
'department_id' => $chev_dep_ct_mr->id,
|
||||
'condition' => '(study.institution_name ?? "" starts with "chevron") and (study.modality not in ["CR", "DX", "MG"])',
|
||||
]
|
||||
);
|
||||
|
||||
$rul_chev_xr = DicomRoutingRule::create(
|
||||
[
|
||||
'is_active' => true,
|
||||
'name' => 'Chevron X-ray',
|
||||
'organization_id' => $chev->id,
|
||||
'department_id' => $dept_chev_xr->id,
|
||||
'condition' => '(study.institution_name ?? "" starts with "chevron") and (study.modality in ["CR", "DX", "MG"])',
|
||||
'priority' => 99,
|
||||
]
|
||||
);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
@ -8,14 +8,11 @@
|
||||
use App\Models\User;
|
||||
use App\Services\Pacs\Sync\StudiesSync;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Spatie\Permission\Models\Role as SpatieRole;
|
||||
|
||||
class UserSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
// User::factory(10)->create();
|
||||
|
||||
$usr = User::factory()->create([
|
||||
'first_name' => 'PACS Agent',
|
||||
'display_name' => 'PACS Agent',
|
||||
@ -27,20 +24,21 @@ public function run(): void
|
||||
|
||||
$orgs = Organization::pluck('id', 'name');
|
||||
$depts = Department::pluck('id', 'name');
|
||||
$roles = SpatieRole::pluck('id', 'name');
|
||||
|
||||
$skip_first = true;
|
||||
$csv_file = fopen(base_path('database/data/users.csv'), 'r');
|
||||
while (($data = fgetcsv($csv_file, 2000, ',')) !== false) {
|
||||
while (($data = fgetcsv($csv_file, 2 * 1024, ',')) !== false) {
|
||||
if ($skip_first) {
|
||||
$skip_first = false;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$data = array_trim_strings($data, true);
|
||||
$role = Role::from(strtolower($data[8]));
|
||||
$org_id = $data[9] ? $orgs[$data[9]] : null;
|
||||
$dept_id = $data[10] ? $depts[$data[10]] : null;
|
||||
$role = Role::from(strtolower($data[8]));
|
||||
$image = $data[11] ? 'signatures/' . $data[11] : null;
|
||||
|
||||
$user = User::create([
|
||||
'is_active' => true,
|
||||
@ -49,16 +47,38 @@ public function run(): void
|
||||
'first_name' => $data[2],
|
||||
'last_name' => $data[3],
|
||||
'signature_text' => $data[4],
|
||||
'signature_image_path' => $image,
|
||||
'username' => $data[5],
|
||||
'password' => bcrypt('password'),
|
||||
'email' => strtolower($data[6]),
|
||||
'phone' => (string) $data[7],
|
||||
'email_verified_at' => $data[6] ? now() : null,
|
||||
'password' => bcrypt('password'),
|
||||
'organization_id' => $org_id,
|
||||
'department_id' => $dept_id,
|
||||
]);
|
||||
$user->assignRole($role->value);
|
||||
}
|
||||
fclose($csv_file);
|
||||
|
||||
$this->copySignatureImages();
|
||||
}
|
||||
|
||||
private function copySignatureImages()
|
||||
{
|
||||
$sourcePath = base_path('resources/report/signatures');
|
||||
$dest = storage_path('app/public/signatures');
|
||||
|
||||
if (! is_dir($dest)) {
|
||||
mkdir($dest, 0755, true);
|
||||
}
|
||||
|
||||
$files = scandir($sourcePath);
|
||||
foreach ($files as $file) {
|
||||
if (in_array($file, ['.', '..'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
copy("{$sourcePath}/{$file}", "{$dest}/{$file}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user