radfusion/app/DAL/Studies.php
2024-12-31 15:57:17 +06:00

19 lines
415 B
PHP

<?php
namespace App\DAL;
use Cache;
use 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'));
}
}