This commit is contained in:
Dr Masroor Ehsan 2025-01-07 01:04:18 +06:00
parent d5a30a79ea
commit 01a2868adb
4 changed files with 132 additions and 83 deletions

View File

@ -5,6 +5,7 @@
use App\DAL\Radiologists; use App\DAL\Radiologists;
use App\Http\Controllers\HashidControllerBase; use App\Http\Controllers\HashidControllerBase;
use App\Http\Requests\AssignPhysicianRequest; use App\Http\Requests\AssignPhysicianRequest;
use App\Models\Enums\ReportStatus;
use App\Models\Enums\UserRole; use App\Models\Enums\UserRole;
use App\Models\Study; use App\Models\Study;
use App\Models\User; use App\Models\User;
@ -18,12 +19,12 @@ public function show()
$this->decodeKeys(); $this->decodeKeys();
$study = Study::with('assignedPhysician')->findOrFail($this->key); $study = Study::with('assignedPhysician')->findOrFail($this->key);
$rads = User::active()->role(UserRole::Radiologist)->get(['id', 'display_name', 'profile_photo_path', 'first_name', 'last_name', 'created_at']); $rads = User::active()->role(UserRole::Radiologist)->get(['id', 'display_name', 'profile_photo_path', 'first_name', 'last_name', 'created_at']);
$stats = Radiologists::worklist_stats(); $stats = Radiologists::worklist_stats(3, ReportStatus::Finalized->value);
foreach ($stats as $rad) { foreach ($stats as $rad) {
$found = $rads->where('id', $rad->id)->first(); $found = $rads->where('id', $rad->id)->first();
if ($found) { if ($found) {
$found->info['workload'] = $rad->workload; $found->info['workload'] = $rad->workload;
$found->info['last_seen'] = 'Seen: ' . ($rad->last_seen ?? Carbon::now()->addHours(-10))->diffForHumans(); $found->info['last_seen'] = ($rad->last_seen ?? Carbon::now()->addHours(-10))->diffForHumans();
} }
} }

View File

@ -7,3 +7,13 @@
width: $badge-width; width: $badge-width;
@include font-size($badge-font-size); @include font-size($badge-font-size);
} }
.badge-tiny {
min-width: 1.8em;
padding: .25em !important;
margin-left: .1em;
margin-right: .1em;
color: white !important;
cursor: pointer;
}

View File

@ -11,6 +11,7 @@
$active-border: null $active-border: null
) { ) {
} }
@mixin template-button-variant( @mixin template-button-variant(
$parent, $parent,
$background, $background,
@ -21,26 +22,26 @@
$border: $background; $border: $background;
$color: if($color, $color, color-contrast($background)); $color: if($color, $color, color-contrast($background));
$hover-background: if( $hover-background: if(
$color == $color-contrast-light, $color == $color-contrast-light,
shade-color($background, $btn-hover-bg-shade-amount), shade-color($background, $btn-hover-bg-shade-amount),
tint-color($background, $btn-hover-bg-tint-amount) tint-color($background, $btn-hover-bg-tint-amount)
); );
$hover-border: if( $hover-border: if(
$color == $color-contrast-light, $color == $color-contrast-light,
shade-color($border, $btn-hover-border-shade-amount), shade-color($border, $btn-hover-border-shade-amount),
tint-color($border, $btn-hover-border-tint-amount) tint-color($border, $btn-hover-border-tint-amount)
); );
$hover-color: color-contrast($hover-background); $hover-color: color-contrast($hover-background);
$active-background: if( $active-background: if(
$color == $color-contrast-light, $color == $color-contrast-light,
shade-color($background, $btn-active-bg-shade-amount), shade-color($background, $btn-active-bg-shade-amount),
tint-color($background, $btn-active-bg-tint-amount) tint-color($background, $btn-active-bg-tint-amount)
); );
$active-border: if( $active-border: if(
$color == $color-contrast-light, $color == $color-contrast-light,
shade-color($border, $btn-active-border-shade-amount), shade-color($border, $btn-active-border-shade-amount),
tint-color($border, $btn-active-border-tint-amount) tint-color($border, $btn-active-border-tint-amount)
); );
$active-color: color-contrast($active-background); $active-color: color-contrast($active-background);
@ -49,6 +50,7 @@
@include gradient-bg($background); @include gradient-bg($background);
border-color: $border; border-color: $border;
@include box-shadow($btn-box-shadow); @include box-shadow($btn-box-shadow);
&:hover { &:hover {
color: $hover-color !important; color: $hover-color !important;
@include gradient-bg($hover-background !important); @include gradient-bg($hover-background !important);
@ -110,34 +112,35 @@
$hover-color: $background; $hover-color: $background;
$hover-background: $background; $hover-background: $background;
$hover-background: if( $hover-background: if(
$hover-color == $color-contrast-light, $hover-color == $color-contrast-light,
shade-color($background, $btn-text-hover-shade-amount, $card-bg), shade-color($background, $btn-text-hover-shade-amount, $card-bg),
tint-color($background, $btn-text-hover-tint-amount, $card-bg) tint-color($background, $btn-text-hover-tint-amount, $card-bg)
); );
$focus-background: if( $focus-background: if(
$hover-color == $color-contrast-light, $hover-color == $color-contrast-light,
shade-color($background, $btn-text-focus-shade-amount, $card-bg), shade-color($background, $btn-text-focus-shade-amount, $card-bg),
tint-color($background, $btn-text-focus-tint-amount, $card-bg) tint-color($background, $btn-text-focus-tint-amount, $card-bg)
); );
$active-color: $hover-color; $active-color: $hover-color;
$active-background: if( $active-background: if(
$active-color == $color-contrast-light, $active-color == $color-contrast-light,
shade-color($background, $btn-text-active-shade-amount, $card-bg), shade-color($background, $btn-text-active-shade-amount, $card-bg),
tint-color($background, $btn-text-active-tint-amount, $card-bg) tint-color($background, $btn-text-active-tint-amount, $card-bg)
); );
#{$parent} { #{$parent} {
color: $label-color !important; color: $label-color !important;
&.waves-effect { &.waves-effect {
.waves-ripple { .waves-ripple {
background: radial-gradient( background: radial-gradient(
rgba($background, 0.2) 0, rgba($background, 0.2) 0,
rgba($background, 0.3) 40%, rgba($background, 0.3) 40%,
rgba($background, 0.4) 50%, rgba($background, 0.4) 50%,
rgba($background, 0.5) 60%, rgba($background, 0.5) 60%,
rgba($white, 0) 70% rgba($white, 0) 70%
); );
} }
} }
@ -196,50 +199,51 @@
$hover-color: if($color, $color, color-contrast($background)); $hover-color: if($color, $color, color-contrast($background));
$label-background: if( $label-background: if(
$hover-color == $color-contrast-light, $hover-color == $color-contrast-light,
shade-color($background, $btn-label-bg-shade-amount, $card-bg), shade-color($background, $btn-label-bg-shade-amount, $card-bg),
tint-color($background, $btn-label-bg-tint-amount, $card-bg) tint-color($background, $btn-label-bg-tint-amount, $card-bg)
); );
$hover-color: $background; $hover-color: $background;
$hover-background: $background; $hover-background: $background;
$hover-background: if( $hover-background: if(
$hover-color == $color-contrast-light, $hover-color == $color-contrast-light,
shade-color($background, $btn-label-hover-shade-amount, $card-bg), shade-color($background, $btn-label-hover-shade-amount, $card-bg),
tint-color($background, $btn-label-hover-tint-amount, $card-bg) tint-color($background, $btn-label-hover-tint-amount, $card-bg)
); );
$focus-background: if( $focus-background: if(
$hover-color == $color-contrast-light, $hover-color == $color-contrast-light,
shade-color($background, $btn-label-focus-shade-amount, $card-bg), shade-color($background, $btn-label-focus-shade-amount, $card-bg),
tint-color($background, $btn-label-focus-tint-amount, $card-bg) tint-color($background, $btn-label-focus-tint-amount, $card-bg)
); );
$active-color: $hover-color; $active-color: $hover-color;
$active-background: if( $active-background: if(
$active-color == $color-contrast-light, $active-color == $color-contrast-light,
shade-color($background, $btn-label-active-shade-amount, $card-bg), shade-color($background, $btn-label-active-shade-amount, $card-bg),
tint-color($background, $btn-label-active-tint-amount, $card-bg) tint-color($background, $btn-label-active-tint-amount, $card-bg)
); );
$btn-group-border-color: if( $btn-group-border-color: if(
$dark-style, $dark-style,
shade-color($background, $btn-group-border-shade-amount, $card-bg), shade-color($background, $btn-group-border-shade-amount, $card-bg),
tint-color($background, $btn-group-border-tint-amount, $card-bg) tint-color($background, $btn-group-border-tint-amount, $card-bg)
); );
#{$parent} { #{$parent} {
color: $label-color; color: $label-color;
border-color: $label-background; border-color: $label-background;
background: $label-background; background: $label-background;
&.waves-effect { &.waves-effect {
.waves-ripple { .waves-ripple {
background: radial-gradient( background: radial-gradient(
rgba($background, 0.2) 0, rgba($background, 0.2) 0,
rgba($background, 0.3) 40%, rgba($background, 0.3) 40%,
rgba($background, 0.4) 50%, rgba($background, 0.4) 50%,
rgba($background, 0.5) 60%, rgba($background, 0.5) 60%,
rgba($white, 0) 70% rgba($white, 0) 70%
); );
} }
} }
@ -267,6 +271,7 @@
background-image: if($enable-gradients, none !important, null); background-image: if($enable-gradients, none !important, null);
border-color: $active-background !important; border-color: $active-background !important;
} }
&.disabled, &.disabled,
&:disabled { &:disabled {
color: $label-color !important; color: $label-color !important;
@ -302,20 +307,20 @@
$border-color: $color; $border-color: $color;
$hover-background: if( $hover-background: if(
$color-hover == $color-contrast-light, $color-hover == $color-contrast-light,
shade-color($color, $btn-outline-hover-bg-shade-amount, $card-bg), shade-color($color, $btn-outline-hover-bg-shade-amount, $card-bg),
tint-color($color, $btn-outline-hover-bg-tint-amount, $card-bg) tint-color($color, $btn-outline-hover-bg-tint-amount, $card-bg)
); );
$focus-background: if( $focus-background: if(
$color == $color-contrast-light, $color == $color-contrast-light,
shade-color($color, $btn-outline-focus-bg-shade-amount, $card-bg), shade-color($color, $btn-outline-focus-bg-shade-amount, $card-bg),
tint-color($color, $btn-outline-focus-bg-tint-amount, $card-bg) tint-color($color, $btn-outline-focus-bg-tint-amount, $card-bg)
); );
$active-background: if( $active-background: if(
$color == $color-contrast-light, $color == $color-contrast-light,
shade-color($color, $btn-outline-active-bg-shade-amount, $card-bg), shade-color($color, $btn-outline-active-bg-shade-amount, $card-bg),
tint-color($color, $btn-outline-active-bg-tint-amount, $card-bg) tint-color($color, $btn-outline-active-bg-tint-amount, $card-bg)
); );
$active-border: $border-color; $active-border: $border-color;
$active-color: $color; $active-color: $color;
@ -324,14 +329,15 @@
color: $color; color: $color;
border-color: $border-color; border-color: $border-color;
background: transparent; background: transparent;
&.waves-effect { &.waves-effect {
.waves-ripple { .waves-ripple {
background: radial-gradient( background: radial-gradient(
rgba($color, 0.2) 0, rgba($color, 0.2) 0,
rgba($color, 0.3) 40%, rgba($color, 0.3) 40%,
rgba($color, 0.4) 50%, rgba($color, 0.4) 50%,
rgba($color, 0.5) 60%, rgba($color, 0.5) 60%,
rgba($white, 0) 70% rgba($white, 0) 70%
); );
} }
} }
@ -381,3 +387,10 @@
color: color-contrast($color-hover); color: color-contrast($color-hover);
} }
} }
.btn-group-xs > .btn, .btn-xs {
padding: 1px 5px;
font-size: 12px;
line-height: 1.4;
border-radius: 3px;
}

View File

@ -1,27 +1,46 @@
<div class="row mb-2"> @php
<div class="col-4"> $label = isset($study->assignedPhysician) ? 'Re-assign': 'Assign';
Currently assigned: {{ $study->assignedPhysician?->display_name }} $color = isset($study->assignedPhysician) ? 'btn-instagram': 'btn-primary';
</div> @endphp
<div class="row mb-2 text-nowrap">
<table class="table table-borderless table-sm">
<tr>
<td>Patient ID</td>
<td class="fw-semibold">{{ $study->patient_id }}</td>
</tr>
<tr>
<td>Patient Name</td>
<td class="fw-semibold">{{ $study->patient_name }}</td>
</tr>
<tr>
<td>Currently assigned</td>
<td>
@isset($study->assignedPhysician)
<div class="d-inline-flex">
<span class="fw-semibold me-4">{{ $study->assignedPhysician?->display_name }}</span>
<form action="{{ route('staff.assign.remove', $study->hash) }}" class="inline" method="post">
@csrf
@method('DELETE')
<button class="btn btn-danger btn-xs" type="submit">
<i class="fa-light fa-user-slash me-2"></i>
Remove
</button>
</form>
</div>
@endisset
</td>
</tr>
</table>
<div class="col-2"> <div class="col-2">
@isset($study->assignedPhysician)
<form action="{{ route('staff.assign.remove', $study->hash) }}" class="inline" method="post">
@csrf
@method('DELETE')
<button class="btn btn-danger btn-xs" type="submit">Remove</button>
</form>
@endisset
</div> </div>
</div> </div>
<table class="table table-sm"> <table class="table table-sm">
<thead> <tr class="fw-light">
<tr> <td>Physician</td>
<th>Physician</th> <td>Workload</td>
<th>Workload</th> <td>&nbsp;</td>
<th>&nbsp;</th>
</tr> </tr>
</thead>
<tbody>
@foreach ($rads as $doc) @foreach ($rads as $doc)
<tr> <tr>
@ -36,10 +55,13 @@
<span class="text-truncate fw-semibold mb-0"> <span class="text-truncate fw-semibold mb-0">
{{ $doc->display_name }} {{ $doc->display_name }}
@if ($study->isAssigned($doc->id)) @if ($study->isAssigned($doc->id))
<span class="badge bg-success badge-dot ms-2"></span> <span class="badge bg-danger badge-dot ms-1"></span>
@endif @endif
</span> </span>
<small class="text-truncate fw-light text-muted">{{ $doc->info['last_seen'] }}</small> <small class="text-truncate fw-light text-muted">
<i class="fa-light fa-wave-pulse me-2"></i>
{{ $doc->info['last_seen'] }}
</small>
</div> </div>
</div> </div>
</td> </td>
@ -52,7 +74,10 @@
<form action="{{ route('staff.assign.save', $study->hash) }}" class="inline" method="post"> <form action="{{ route('staff.assign.save', $study->hash) }}" class="inline" method="post">
@csrf @csrf
<input type="hidden" name="rad_id" value="{{ $doc->id }}"> <input type="hidden" name="rad_id" value="{{ $doc->id }}">
<button class="btn btn-primary btn-xs" type="submit">Assign</button> <button class="btn {{ $color }} btn-xs" type="submit">
<i class="fa-light fa-user-check me-2"></i>
{{ $label }}
</button>
</form> </form>
@endif @endif
</td> </td>