wip
This commit is contained in:
parent
06be5f576f
commit
8c3c948b26
@ -15,7 +15,7 @@ public function popup()
|
|||||||
{
|
{
|
||||||
abort_unless(me()->may([Permission::ReportEdit, Permission::ReportDictate, Permission::ReportApprove, Permission::ReportDownload]), 403);
|
abort_unless(me()->may([Permission::ReportEdit, Permission::ReportDictate, Permission::ReportApprove, Permission::ReportDownload]), 403);
|
||||||
$this->decodeKeys();
|
$this->decodeKeys();
|
||||||
$study = Study::with(['reports.radiologist', 'assignedPhysicians'])->findOrFail($this->key);
|
$study = Study::with(['reports.radiologist', 'reports.study', 'assignedPhysicians'])->findOrFail($this->key);
|
||||||
if (me()->isRadiologist()) {
|
if (me()->isRadiologist()) {
|
||||||
// abort_unless($study->isAssigned(), 403);
|
// abort_unless($study->isAssigned(), 403);
|
||||||
abort_unless($study->isUserInStudyAssignmentsOrReadingPhysician(), 403);
|
abort_unless($study->isUserInStudyAssignmentsOrReadingPhysician(), 403);
|
||||||
|
@ -79,6 +79,39 @@ public function getContent(): ?string
|
|||||||
return Storage::disk('public')->get($this->file_path);
|
return Storage::disk('public')->get($this->file_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function eligibleForExport(): bool
|
||||||
|
{
|
||||||
|
return $this->report_status->value >= ReportStatus::Finalized->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function canRemove(User|int|null $user = null): bool
|
||||||
|
{
|
||||||
|
if ($this->report_status->value < ReportStatus::Finalized->value) {
|
||||||
|
if ($this->read_by_id === me($user)->id) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if ($this->approved_by_id === me($user)->id) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function canEdit(User|int|null $user = null): bool
|
||||||
|
{
|
||||||
|
if ($this->study->canEditReport() &&
|
||||||
|
$this->report_status->value < ReportStatus::Finalized->value) {
|
||||||
|
if ($this->read_by_id === me($user)->id) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array<string, string>
|
* @return array<string, string>
|
||||||
*/
|
*/
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>{{ $report->radiologist?->name }}</td>
|
<td>{{ $report->radiologist?->name }}</td>
|
||||||
<td class="align-content-end">
|
<td class="align-content-end">
|
||||||
|
@if ($report->eligibleForExport())
|
||||||
<a class="btn btn-facebook btn-xs me-1 fs-xsmall fw-light" target="_blank"
|
<a class="btn btn-facebook btn-xs me-1 fs-xsmall fw-light" target="_blank"
|
||||||
href="{{ $report->wordDownloadUrl() }}">
|
href="{{ $report->wordDownloadUrl() }}">
|
||||||
<img class="me-1" src="{{ asset('imgs/docx.png') }}" alt="DOCX download">doc
|
<img class="me-1" src="{{ asset('imgs/docx.png') }}" alt="DOCX download">doc
|
||||||
@ -22,6 +23,14 @@
|
|||||||
href="{{ $report->htmlDownloadUrl() }}">
|
href="{{ $report->htmlDownloadUrl() }}">
|
||||||
<img class="me-1" src="{{ asset('imgs/html.png') }}" alt="HTML download">htm
|
<img class="me-1" src="{{ asset('imgs/html.png') }}" alt="HTML download">htm
|
||||||
</a>
|
</a>
|
||||||
|
@else
|
||||||
|
@if ($report->canEdit())
|
||||||
|
edit_button
|
||||||
|
@endif
|
||||||
|
@if ($report->canRemove())
|
||||||
|
remove_button
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@ -1,36 +1,52 @@
|
|||||||
@extends('staff.reports.viewer.layout')
|
@extends('staff.reports.viewer.layout')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<table class="table table-bordered table-sm border-dark mb-4">
|
<header class="py-4">
|
||||||
|
<div class="container">
|
||||||
|
<div class="p-2 p-lg-2 bg-light rounded-3">
|
||||||
|
<div class="m-2 m-lg-3">
|
||||||
|
<table class="table table-bordered border-gray">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="fw-semibold text-bg-light">Patient Name</td>
|
<td class="text-muted">Patient Name</td>
|
||||||
<td>{{ $report->study->patient_name }}</td>
|
<td class="fw-semibold">{{ $report->study->patient_name }}</td>
|
||||||
<td class="fw-semibold text-bg-light">Patient ID</td>
|
<td class="text-muted">Patient ID</td>
|
||||||
<td>{{ $report->study->patient_id }}</td>
|
<td class="fw-semibold">{{ $report->study->patient_id }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="fw-semibold text-bg-light">Accession No</td>
|
<td class="text-muted">Age/Gender</td>
|
||||||
<td>{{ $report->study->accession_number }}</td>
|
<td class="fw-semibold">{{ $report->study->sexAge() }}</td>
|
||||||
<td class="fw-semibold text-bg-light">Age/Gender</td>
|
<td class="text-muted">Accession No</td>
|
||||||
<td>{{ $report->study->sexAge() }}</td>
|
<td class="fw-semibold">{{ $report->study->accession_number }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="fw-semibold text-bg-light">Referred By</td>
|
<td class="text-muted">Referred By</td>
|
||||||
<td>{{ $report->study->referring_physician_name }}</td>
|
<td class="fw-semibold">{{ $report->study->referring_physician_name }}</td>
|
||||||
<td class="fw-semibold text-bg-light">Date</td>
|
<td class="text-muted">Date</td>
|
||||||
<td>{{ $report->created_at->format('d-M-Y') }}</td>
|
<td class="fw-semibold">{{ $report->created_at->format('d-M-Y') }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h6 style="text-align: center">
|
<div class="text-center">
|
||||||
{{ $report->study->modality }} REPORT
|
<h6 class="text-muted">
|
||||||
|
{{ $report->study->modality }} Report
|
||||||
</h6>
|
</h6>
|
||||||
|
<h3>
|
||||||
<h3 style="text-align: center">
|
|
||||||
{{ $report->study->study_description }}
|
{{ $report->study->study_description }}
|
||||||
</h3>
|
</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<section class="pt-4" name="report">
|
||||||
|
<div class="container px-lg-3">
|
||||||
|
<div class="border-dark mb-8">
|
||||||
{!! $report->getContent() !!}
|
{!! $report->getContent() !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
@endsection
|
@endsection
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" crossorigin="anonymous">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" crossorigin="anonymous">
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400..900&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,100..700&display=swap" rel="stylesheet">
|
||||||
<title>{{ $title }}</title>
|
<title>{{ $title }}</title>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
@ -20,9 +20,13 @@
|
|||||||
@stack('header')
|
@stack('header')
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container py-4 px-3 mx-auto">
|
<nav class="navbar navbar-light bg-light">
|
||||||
@yield('content')
|
<div class="container px-lg-3">
|
||||||
|
<a class="navbar-brand fw-semibold" href="#">{{ config('app.name') }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
@yield('content')
|
||||||
|
|
||||||
@stack('footer')
|
@stack('footer')
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
Reference in New Issue
Block a user