This commit is contained in:
Dr Masroor Ehsan 2025-01-29 23:01:14 +06:00
parent 45d692968e
commit 927c51e16d
3 changed files with 6 additions and 3 deletions

View File

@ -15,8 +15,9 @@
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
class StudiesSync
final class StudiesSync
{
public const string SYNC_AGENT = '$$_pacs_agent_$$';
private Collection $study_ids;
private Collection $insert_queue;

View File

@ -3,6 +3,7 @@
use App\Models\Study;
use App\Models\User;
use App\Services\AuditTrail\ActivityLogger;
use App\Services\Pacs\Sync\StudiesSync;
use Illuminate\Support\Str;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
@ -52,7 +53,7 @@ function array_trim_strings(array $ary): array
function sync_agent_id(): int
{
return cache()->rememberForever('sync_agent_id',
fn () => User::where('username', '$$_pacs_sync_$$')->first()->id);
fn () => User::where('username', StudiesSync::SYNC_AGENT)->first()->id);
}
}

View File

@ -6,6 +6,7 @@
use App\Models\Department;
use App\Models\Organization;
use App\Models\User;
use App\Services\Pacs\Sync\StudiesSync;
use Illuminate\Database\Seeder;
class UserSeeder extends Seeder
@ -17,7 +18,7 @@ public function run(): void
$usr = User::factory()->create([
'first_name' => 'PACS Agent',
'display_name' => 'PACS Agent',
'username' => '$$_pacs_agent_$$',
'username' => StudiesSync::SYNC_AGENT,
'password' => bcrypt(fake()->password(20)),
'is_active' => false,
]);