This commit is contained in:
Dr Masroor Ehsan 2024-12-31 22:46:58 +06:00
parent 5d94c9d92f
commit 787ba267d8
6 changed files with 46 additions and 23 deletions

View File

@ -5,7 +5,7 @@
use App\Models\Study;
use Illuminate\Contracts\Database\Eloquent\Builder;
class AdminStudyLister extends UserStudyListerBase
final class AdminStudyLister extends UserStudyListerBase
{
protected function buildQuery(?int $user_id = null): Builder
{

View File

@ -5,7 +5,7 @@
use App\Models\Study;
use Illuminate\Contracts\Database\Eloquent\Builder;
class RadiologistStudyLister extends UserStudyListerBase
final class RadiologistStudyLister extends UserStudyListerBase
{
protected function buildQuery(?int $user_id = null): Builder
{

View File

@ -0,0 +1,18 @@
<?php
namespace App\DAL\Studies;
use App\Models\Study;
use Illuminate\Contracts\Database\Eloquent\Builder;
final class ReferrerStudyLister extends UserStudyListerBase
{
protected function buildQuery(?int $user_id = null): Builder
{
$user_id = (int) ($user_id ?? auth()->id());
return self::defaultSortQuery(
Study::active()->where('referring_provider_id', $user_id)
);
}
}

View File

@ -5,7 +5,7 @@
use App\Models\Study;
use Illuminate\Contracts\Database\Eloquent\Builder;
class TechnicianStudyLister extends UserStudyListerBase
final class TechnicianStudyLister extends UserStudyListerBase
{
protected function buildQuery(?int $user_id = null): Builder
{

View File

@ -12,13 +12,14 @@
*/
public static function getLister(): IUserStudyLister
{
$user_role = (int) auth()->user()->user_role;
$role = auth()->user()->roles()->first()->name;
return match (UserRole::from($user_role)) {
return match (UserRole::from($role)) {
UserRole::Admin => new AdminStudyLister,
UserRole::Technician => new TechnicianStudyLister,
UserRole::Radiologist => new RadiologistStudyLister,
default => throw new Exception("Unknown user role: $user_role"),
UserRole::ReferringPhysician => new ReferrerStudyLister,
default => throw new Exception("Unknown user role: $role"),
};
}
}

View File

@ -64,38 +64,42 @@ class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->accession_number }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->patient_id }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900"><a
href="{{ route('studies.details', _h($study->id)) }}">{{ $study->patient_name }}</a>
href="{{ route('studies.details', _h($study->id)) }}">{{ $study->patient_name }}</a>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->patient_sex }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->patient_birthdate }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->study_modality }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->study_date }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->receive_date }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->received_at }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->image_count }}
/ {{ $study->series_count }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->institution_name }}</td>
<td>
<a target="_blank"
href="{{ \App\Services\Pacs\PacsUrlGen::stoneViewer($study->study_instance_uid) }}">St</a>
|
<a target="_blank"
href="{{ \App\Services\Pacs\PacsUrlGen::ohifViewer($study->study_instance_uid) }}">OHF</a>
@if($study->image_count > 1 && $study->study_modality != 'CR')
@can(\App\Models\Enums\Permission::StudyDownload)
<a target="_blank"
href="{{ \App\Services\Pacs\PacsUrlGen::stoneViewer($study->study_instance_uid) }}">St</a>
|
<a target="_blank"
href="{{ \App\Services\Pacs\PacsUrlGen::ohifViewerMpr($study->study_instance_uid) }}">MPR</a>
href="{{ \App\Services\Pacs\PacsUrlGen::ohifViewer($study->study_instance_uid) }}">OHF</a>
@if($study->image_count > 1 && $study->study_modality != 'CR')
|
<a target="_blank"
href="{{ \App\Services\Pacs\PacsUrlGen::ohifViewerMpr($study->study_instance_uid) }}">MPR</a>
|
<a target="_blank" class="btn"
href="{{ \App\Services\Pacs\PacsUrlGen::ohifSegmentation($study->study_instance_uid) }}">SEG</a>
@endif
|
<a target="_blank" class="btn"
href="{{ \App\Services\Pacs\PacsUrlGen::ohifSegmentation($study->study_instance_uid) }}">SEG</a>
@endif
|
<a target="_blank" class="btn"
href="{{ \App\Services\Pacs\PacsUrlGen::archive($study->orthanc_uuid) }}">ZIP</a>
|
<a target="_blank" class="btn"
href="{{ route('radiologist.report-write', $study->id) }}">TXT</a>
href="{{ \App\Services\Pacs\PacsUrlGen::archive($study->orthanc_uuid) }}">ZIP</a>
|
@endcan
@can(\App\Models\Enums\Permission::ReportCreate)
<a target="_blank" class="btn"
href="{{ route('radiologist.report-write', $study->id) }}">TXT</a>
@endcan
</td>
</tr>
@endforeach