UI fixes
This commit is contained in:
parent
b493f2742b
commit
2365ac1ca7
@ -209,11 +209,6 @@ public function getColumns(): array
|
||||
return $columns;
|
||||
}
|
||||
|
||||
private function columTitle(string $str): string
|
||||
{
|
||||
return Str::of($str)->slug()->replace('-', ' ')->title()->toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename for export.
|
||||
*/
|
||||
@ -228,12 +223,17 @@ protected function filename(): string
|
||||
return Str::slug(implode(' ', $parts), '_');
|
||||
}
|
||||
|
||||
private function columTitle(string $str): string
|
||||
{
|
||||
return Str::of($str)->slug()->replace('-', ' ')->title()->toString();
|
||||
}
|
||||
|
||||
private function physicianColumn(Study $study): ?string
|
||||
{
|
||||
$user = $study->readingPhysician;
|
||||
if ($user === null) {
|
||||
if ($study->assigned_at !== null) {
|
||||
return '<img src="' . asset('imgs/checklist.png') . '" data-bs-toggle="tooltip" data-bs-placement="right" title="Assigned at ' . $study->assigned_at->format(self::DATE_FORMAT_LONG) . '">';
|
||||
return '<img src="' . asset('imgs/checklist.png') . '" data-bs-toggle="tooltip" data-bs-placement="right" title="Assigned on ' . $study->assigned_at->format(self::DATE_FORMAT_LONG) . '">';
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -83,15 +83,17 @@ public function view(string $uuid)
|
||||
$manager = ReportManager::fromReport($uuid);
|
||||
$title = 'Report Quick View ' . $manager->getStudy()->getPatientDemographic();
|
||||
$report = $manager->getReport();
|
||||
$copy_button = false;
|
||||
if ($report->isFinalized()) {
|
||||
$stamper = new StampService($report->read_by_id);
|
||||
$signature = $stamper->hasSignatureImage() ? $stamper->signatureImageUrl() : null;
|
||||
$notice = null;
|
||||
$copy_button = true;
|
||||
} else {
|
||||
$signature = null;
|
||||
$notice = 'This is a preliminary radiology interpretation that has not been finalized or approved by a radiologist. It is not intended for diagnostic purposes.';
|
||||
}
|
||||
|
||||
return view('staff.reports.viewer.html-report', compact('report', 'title', 'signature', 'notice'));
|
||||
return view('staff.reports.viewer.html-report', compact('report', 'title', 'signature', 'notice', 'copy_button'));
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,10 @@
|
||||
@extends('staff.reports.viewer.layout')
|
||||
|
||||
@push('header')
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.4/toastr.min.css"
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer"/>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="container container-main">
|
||||
|
||||
@ -58,21 +63,31 @@ class="fa-solid fs-4 fa-circle-radiation me-2"></i></span>Notice
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="pt-4" name="report">
|
||||
<div class="px-lg-3">
|
||||
<div class="border-dark mb-8">
|
||||
{!! $report->getContent() !!}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@isset($signature)
|
||||
<section class="pt-4" name="signature">
|
||||
<div id="report_content">
|
||||
<section class="pt-4" name="report">
|
||||
<div class="px-lg-3">
|
||||
<img src="{{ $signature }}">
|
||||
<div class="mb-8">
|
||||
{!! $report->getContent() !!}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endisset
|
||||
|
||||
@isset($signature)
|
||||
<section class="pt-4" name="signature">
|
||||
<div class="px-lg-3">
|
||||
<img src="{{ $signature }}">
|
||||
</div>
|
||||
</section>
|
||||
@endisset
|
||||
</div>
|
||||
|
||||
@if ($copy_button)
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn btn-outline-primary btn-sm" onclick="copyToClipboard('report_content')">
|
||||
<i class="fa-regular fa-copy"></i> Copy to Clipboard
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@ -84,4 +99,40 @@ class="fa-solid fs-4 fa-circle-radiation me-2"></i></span>Notice
|
||||
</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.4/toastr.min.js" crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script>
|
||||
function copyToClipboard(div_id) {
|
||||
const content_div = document.getElementById(div_id);
|
||||
const range = document.createRange();
|
||||
range.selectNode(content_div);
|
||||
window.getSelection().removeAllRanges();
|
||||
window.getSelection().addRange(range);
|
||||
|
||||
try {
|
||||
if (navigator.clipboard && window.isSecureContext) {
|
||||
navigator.clipboard.writeText(content_div.innerText)
|
||||
.then(() => {
|
||||
toastr.info('Report copied to clipboard');
|
||||
})
|
||||
.catch(() => {
|
||||
toastr.warning("Failed to copy report");
|
||||
});
|
||||
} else {
|
||||
const success = document.execCommand("copy");
|
||||
if (success) {
|
||||
toastr.info('Report copied to clipboard')
|
||||
} else {
|
||||
toastr.warning("Failed to copy report");
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
window.getSelection().removeAllRanges();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
Loading…
Reference in New Issue
Block a user