duster
This commit is contained in:
parent
65a5b9971d
commit
6a6f63fa15
@ -22,7 +22,7 @@ public static function getLister(): IUserStudyLister
|
|||||||
UserRole::Technician => new TechnicianWorklist,
|
UserRole::Technician => new TechnicianWorklist,
|
||||||
UserRole::Radiologist => new RadiologistWorklist,
|
UserRole::Radiologist => new RadiologistWorklist,
|
||||||
UserRole::ReferringDoctor => new ReferrerWorklist,
|
UserRole::ReferringDoctor => new ReferrerWorklist,
|
||||||
default => throw new Exception("Unknown user role: $role"),
|
default => throw new Exception("Unknown user role: {$role}"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use function Sentry\captureException;
|
|
||||||
|
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
|
||||||
|
use function Sentry\captureException;
|
||||||
|
|
||||||
abstract class HashidActionControllerBase extends Controller
|
abstract class HashidActionControllerBase extends Controller
|
||||||
{
|
{
|
||||||
protected ?int $key = null;
|
protected ?int $key = null;
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use function Sentry\captureException as gobble;
|
|
||||||
|
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
|
||||||
|
use function Sentry\captureException as gobble;
|
||||||
|
|
||||||
abstract class HashidControllerBase extends Controller
|
abstract class HashidControllerBase extends Controller
|
||||||
{
|
{
|
||||||
protected ?int $key = null;
|
protected ?int $key = null;
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
use App\Http\Controllers\HashidControllerBase;
|
use App\Http\Controllers\HashidControllerBase;
|
||||||
use App\Models\Study;
|
use App\Models\Study;
|
||||||
|
use Closure;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class StudyViewerController extends HashidControllerBase
|
class StudyViewerController extends HashidControllerBase
|
||||||
@ -18,7 +19,7 @@ public function ohif()
|
|||||||
return $this->loadViewer(fn (Study $study) => $study->getOhifLink());
|
return $this->loadViewer(fn (Study $study) => $study->getOhifLink());
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loadViewer(\Closure $callback)
|
private function loadViewer(Closure $callback)
|
||||||
{
|
{
|
||||||
$this->decodeKeys();
|
$this->decodeKeys();
|
||||||
$study = Study::findOrFail($this->key);
|
$study = Study::findOrFail($this->key);
|
||||||
|
@ -12,7 +12,7 @@ class CustomPersonalAccessToken extends PersonalAccessToken
|
|||||||
{
|
{
|
||||||
public static function findToken($token)
|
public static function findToken($token)
|
||||||
{
|
{
|
||||||
$token = Cache::remember("PersonalAccessToken::$token", 600,
|
$token = Cache::remember("PersonalAccessToken::{$token}", 600,
|
||||||
function () use ($token) {
|
function () use ($token) {
|
||||||
return parent::findToken($token) ?? '_null_';
|
return parent::findToken($token) ?? '_null_';
|
||||||
});
|
});
|
||||||
|
@ -219,7 +219,7 @@ public function sanitizedStudyDescription(): string
|
|||||||
'with' => 'w/',
|
'with' => 'w/',
|
||||||
];
|
];
|
||||||
foreach ($lut as $search => $replace) {
|
foreach ($lut as $search => $replace) {
|
||||||
$name = preg_replace("/\b$search\b/i", $replace, $name);
|
$name = preg_replace("/\b{$search}\b/i", $replace, $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $name;
|
return $name;
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
use App\Models\Enums\NameMatchModes;
|
use App\Models\Enums\NameMatchModes;
|
||||||
|
|
||||||
|
use function strlen;
|
||||||
|
|
||||||
final class InputMatcher
|
final class InputMatcher
|
||||||
{
|
{
|
||||||
public static function match(string $input, string $pattern, NameMatchModes $mode): bool
|
public static function match(string $input, string $pattern, NameMatchModes $mode): bool
|
||||||
@ -11,7 +13,7 @@ public static function match(string $input, string $pattern, NameMatchModes $mod
|
|||||||
return match ($mode) {
|
return match ($mode) {
|
||||||
NameMatchModes::Exact => strcasecmp($input, $pattern) === 0,
|
NameMatchModes::Exact => strcasecmp($input, $pattern) === 0,
|
||||||
NameMatchModes::Contains => stripos($input, $pattern) !== false,
|
NameMatchModes::Contains => stripos($input, $pattern) !== false,
|
||||||
NameMatchModes::StartsWith => strncasecmp($input, $pattern, \strlen($pattern)) === 0,
|
NameMatchModes::StartsWith => strncasecmp($input, $pattern, strlen($pattern)) === 0,
|
||||||
NameMatchModes::EndsWith => str_ends_with(strtolower($input), strtolower($pattern)),
|
NameMatchModes::EndsWith => str_ends_with(strtolower($input), strtolower($pattern)),
|
||||||
NameMatchModes::Regex => preg_match($pattern, $input) === 1,
|
NameMatchModes::Regex => preg_match($pattern, $input) === 1,
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
use App\Services\Pacs\InstituteMapper;
|
use App\Services\Pacs\InstituteMapper;
|
||||||
use App\Services\Pacs\OrthancRestClient;
|
use App\Services\Pacs\OrthancRestClient;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Exception;
|
||||||
use Illuminate\Pipeline\Pipeline;
|
use Illuminate\Pipeline\Pipeline;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
@ -137,7 +138,7 @@ public function transformData(mixed $orthanc_src): array
|
|||||||
if (filled($dob)) {
|
if (filled($dob)) {
|
||||||
try {
|
try {
|
||||||
$study['patient_birthdate'] = Carbon::parse($dob);
|
$study['patient_birthdate'] = Carbon::parse($dob);
|
||||||
} catch (\Exception) {
|
} catch (Exception) {
|
||||||
Log::error('Failed to parse PatientMainDicomTags.PatientBirthDate: {dob}', ['dob' => $dob]);
|
Log::error('Failed to parse PatientMainDicomTags.PatientBirthDate: {dob}', ['dob' => $dob]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user