This commit is contained in:
Dr Masroor Ehsan 2025-01-04 00:02:13 +06:00
parent 92179760d0
commit 17eb245daf
4 changed files with 27 additions and 12 deletions

View File

@ -7,13 +7,24 @@
class StudyViewerController extends HashidControllerBase class StudyViewerController extends HashidControllerBase
{ {
public function stone() private function loadViewer(\Closure $callback)
{ {
$this->decodeKeys(); $this->decodeKeys();
$study = Study::findOrFail($this->key); $study = Study::findOrFail($this->key);
$url = $study->getStoneLink(); $url = $callback($study);
abort_if(blank($url), 404); abort_if(blank($url), 404);
$title = $study->patient_name;
return view('staff.studies.viewer', compact('url')); return view('staff.studies.viewer', compact('url', 'title'));
}
public function stone()
{
return $this->loadViewer(fn (Study $study) => $study->getStoneLink());
}
public function ohif()
{
return $this->loadViewer(fn (Study $study) => $study->getOhifLink());
} }
} }

View File

@ -1,7 +1,10 @@
@extends('layouts/layoutMaster') <html>
<head>
@section('title', 'Viewer') <title>{{ $title }}</title>
</head>
@section('content') <body style="background-color:black;">
<iframe src="{{ $url }}" frameborder="0"></iframe> <iframe src="{{ $url }}" frameborder="0" width="100%" height="100%"
@endsection allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true">
</iframe>
</body>
</html>

View File

@ -127,10 +127,10 @@ class="d-flex justify-content-between align-items-start border-end pb-4 pb-sm-0
<td>{{ $study->institution_name }}</td> <td>{{ $study->institution_name }}</td>
<td> <td>
@if ($study->allowed()['stone']) @if ($study->allowed()['stone'])
<a target="_blank" href="{{ $study->links()['stone'] }}">St</a> | <a target="_blank" href="{{ route('viewer.stone', $study->hash) }}">St</a> |
@endif @endif
@if ($study->allowed()['ohif']) @if ($study->allowed()['ohif'])
<a target="_blank" href="{{ $study->links()['ohif'] }}">O</a> | <a target="_blank" href="{{ route('viewer.ohif', $study->hash) }}">Oh</a> |
@endif @endif
@if ($study->allowed()['ohif.mpr']) @if ($study->allowed()['ohif.mpr'])
<a target="_blank" href="{{ $study->links()['ohif.mpr'] }}">OM</a> | <a target="_blank" href="{{ $study->links()['ohif.mpr'] }}">OM</a> |

View File

@ -40,6 +40,7 @@
Route::group(['prefix' => 'viewer', 'as' => 'viewer.'], function () { Route::group(['prefix' => 'viewer', 'as' => 'viewer.'], function () {
Route::get('stone/{hashid}', [StudyViewerController::class, 'stone'])->name('stone'); Route::get('stone/{hashid}', [StudyViewerController::class, 'stone'])->name('stone');
Route::get('ohif/{hashid}', [StudyViewerController::class, 'ohif'])->name('ohif');
}); });
Route::group(['as' => 'staff.'], function () { Route::group(['as' => 'staff.'], function () {