wip
This commit is contained in:
parent
5d94c9d92f
commit
787ba267d8
@ -5,7 +5,7 @@
|
|||||||
use App\Models\Study;
|
use App\Models\Study;
|
||||||
use Illuminate\Contracts\Database\Eloquent\Builder;
|
use Illuminate\Contracts\Database\Eloquent\Builder;
|
||||||
|
|
||||||
class AdminStudyLister extends UserStudyListerBase
|
final class AdminStudyLister extends UserStudyListerBase
|
||||||
{
|
{
|
||||||
protected function buildQuery(?int $user_id = null): Builder
|
protected function buildQuery(?int $user_id = null): Builder
|
||||||
{
|
{
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
use App\Models\Study;
|
use App\Models\Study;
|
||||||
use Illuminate\Contracts\Database\Eloquent\Builder;
|
use Illuminate\Contracts\Database\Eloquent\Builder;
|
||||||
|
|
||||||
class RadiologistStudyLister extends UserStudyListerBase
|
final class RadiologistStudyLister extends UserStudyListerBase
|
||||||
{
|
{
|
||||||
protected function buildQuery(?int $user_id = null): Builder
|
protected function buildQuery(?int $user_id = null): Builder
|
||||||
{
|
{
|
||||||
|
18
app/DAL/Studies/ReferrerStudyLister.php
Normal file
18
app/DAL/Studies/ReferrerStudyLister.php
Normal 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)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -5,7 +5,7 @@
|
|||||||
use App\Models\Study;
|
use App\Models\Study;
|
||||||
use Illuminate\Contracts\Database\Eloquent\Builder;
|
use Illuminate\Contracts\Database\Eloquent\Builder;
|
||||||
|
|
||||||
class TechnicianStudyLister extends UserStudyListerBase
|
final class TechnicianStudyLister extends UserStudyListerBase
|
||||||
{
|
{
|
||||||
protected function buildQuery(?int $user_id = null): Builder
|
protected function buildQuery(?int $user_id = null): Builder
|
||||||
{
|
{
|
||||||
|
@ -12,13 +12,14 @@
|
|||||||
*/
|
*/
|
||||||
public static function getLister(): IUserStudyLister
|
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::Admin => new AdminStudyLister,
|
||||||
UserRole::Technician => new TechnicianStudyLister,
|
UserRole::Technician => new TechnicianStudyLister,
|
||||||
UserRole::Radiologist => new RadiologistStudyLister,
|
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"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,12 +70,13 @@ 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->patient_birthdate }}</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_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->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 }}
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->image_count }}
|
||||||
/ {{ $study->series_count }}</td>
|
/ {{ $study->series_count }}</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->institution_name }}</td>
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->institution_name }}</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
|
@can(\App\Models\Enums\Permission::StudyDownload)
|
||||||
<a target="_blank"
|
<a target="_blank"
|
||||||
href="{{ \App\Services\Pacs\PacsUrlGen::stoneViewer($study->study_instance_uid) }}">St</a>
|
href="{{ \App\Services\Pacs\PacsUrlGen::stoneViewer($study->study_instance_uid) }}">St</a>
|
||||||
|
|
|
|
||||||
@ -93,9 +94,12 @@ class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-
|
|||||||
<a target="_blank" class="btn"
|
<a target="_blank" class="btn"
|
||||||
href="{{ \App\Services\Pacs\PacsUrlGen::archive($study->orthanc_uuid) }}">ZIP</a>
|
href="{{ \App\Services\Pacs\PacsUrlGen::archive($study->orthanc_uuid) }}">ZIP</a>
|
||||||
|
|
|
|
||||||
|
@endcan
|
||||||
|
|
||||||
|
@can(\App\Models\Enums\Permission::ReportCreate)
|
||||||
<a target="_blank" class="btn"
|
<a target="_blank" class="btn"
|
||||||
href="{{ route('radiologist.report-write', $study->id) }}">TXT</a>
|
href="{{ route('radiologist.report-write', $study->id) }}">TXT</a>
|
||||||
|
@endcan
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
Loading…
Reference in New Issue
Block a user