radfusion/app/DAL/Studies.php
2025-01-05 12:49:53 +06:00

19 lines
469 B
PHP

<?php
namespace App\DAL;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
final readonly class Studies
{
public static function getStudyIdByOrthancUuid(string $orthanc_uuid): ?int
{
return Cache::remember("studies.orthanc_uuid.{$orthanc_uuid}",
now()->addHours(1),
fn () => DB::table('studies')
->where('orthanc_uuid', strtolower($orthanc_uuid))
->value('id'));
}
}