diff --git a/database/seeders/OrganizationSeeder.php b/database/seeders/OrganizationSeeder.php index c30f09a..8922ff8 100644 --- a/database/seeders/OrganizationSeeder.php +++ b/database/seeders/OrganizationSeeder.php @@ -2,14 +2,10 @@ namespace Database\Seeders; -use App\Domain\Rule\MatchCondition; -use App\Domain\Rule\MatchMode; use App\Models\Department; use App\Models\DicomRoutingRule; -use App\Models\DicomRuleCondition; use App\Models\DicomServer; use App\Models\Organization; -use App\Services\StudyRouter\RawDicomTags; use Illuminate\Database\Seeder; class OrganizationSeeder extends Seeder @@ -61,7 +57,7 @@ public function run(): void 'name' => 'Chevron MR/CT', 'organization_id' => $chev->id, 'department_id' => $chev_dep_ct_mr->id, - 'match_condition' => MatchCondition::ALL->value, + 'condition' => 'study.institution_name starts with "chevron" and not (study.modality in ["CR", "DX", "MG"])', ] ); @@ -71,41 +67,11 @@ public function run(): void 'name' => 'Chevron X-ray', 'organization_id' => $chev->id, 'department_id' => $dept_chev_xr->id, - 'match_condition' => MatchCondition::ALL->value, - 'priority' => 10, + 'condition' => 'study.institution_name starts with "chevron" and study.modality in ["CR", "DX", "MG"]', + 'priority' => 99, ] ); - DicomRuleCondition::create([ - 'dicom_tag' => RawDicomTags::InstitutionName->value, - 'search_pattern' => 'chevron', - 'dicom_routing_rule_id' => $rul_chev_mr_ct->id, - 'match_mode' => MatchMode::Contains->value, - 'case_sensitive' => false, - ]); - DicomRuleCondition::create([ - 'dicom_tag' => RawDicomTags::Modality->value, - 'search_pattern' => 'MR,CT', - 'dicom_routing_rule_id' => $rul_chev_mr_ct->id, - 'match_mode' => MatchMode::InList->value, - 'case_sensitive' => true, - ]); - - DicomRuleCondition::create([ - 'dicom_tag' => RawDicomTags::InstitutionName->value, - 'search_pattern' => 'chevron', - 'dicom_routing_rule_id' => $rul_chev_xr->id, - 'match_mode' => MatchMode::Contains->value, - 'case_sensitive' => false, - ]); - DicomRuleCondition::create([ - 'dicom_tag' => RawDicomTags::Modality->value, - 'search_pattern' => 'CR,DX,MG', - 'dicom_routing_rule_id' => $rul_chev_xr->id, - 'match_mode' => MatchMode::InList->value, - 'case_sensitive' => true, - ]); - DicomServer::create( [ 'is_active' => true,