wip
This commit is contained in:
parent
5b9b4cad8d
commit
727d706a97
@ -279,12 +279,10 @@ private function renderCustomColumns(): array
|
||||
|
||||
private function generateReportingButtons(Study $study): string
|
||||
{
|
||||
if (me()->isRadiologist()) {
|
||||
if (! $study->hasReports() && $study->canEditReport()) {
|
||||
if (me()->isRadiologist() && $study->canEditReport() && ! $study->hasReports()) {
|
||||
// fresh untouched study, can edit report: take the rad directly to the edit page
|
||||
return '<a href="' . route('staff.report.create', $study->hash) . '" target="_blank" class="btn btn-sm btn-outline-light"><i class="fa-light fa-edit"></i></a>';
|
||||
}
|
||||
}
|
||||
|
||||
return $this->renderButton($study->hash, 'fa-eye', 'show-reports btn-outline', 'R');
|
||||
}
|
||||
|
@ -15,9 +15,10 @@ public function popup()
|
||||
{
|
||||
abort_unless(me()->may([Permission::ReportEdit, Permission::ReportDictate, Permission::ReportApprove, Permission::ReportDownload]), 403);
|
||||
$this->decodeKeys();
|
||||
$study = Study::with(['reports.radiologist', 'readingPhysician'])->findOrFail($this->key);
|
||||
$study = Study::with(['reports.radiologist', 'assignedPhysicians'])->findOrFail($this->key);
|
||||
if (me()->isRadiologist()) {
|
||||
abort_unless($study->isAssigned(), 403);
|
||||
// abort_unless($study->isAssigned(), 403);
|
||||
abort_unless($study->isUserInStudyAssignmentsOrReadingPhysician(), 403);
|
||||
}
|
||||
$reports = $study->reports->sortByDesc('created_at');
|
||||
|
||||
|
@ -27,6 +27,7 @@ public function run(): void
|
||||
$rad->givePermissionTo([
|
||||
Permission::ReportEdit,
|
||||
Permission::ReportDownload,
|
||||
Permission::ReportApprove,
|
||||
Permission::StudyDownload,
|
||||
Permission::StudyMetadataView,
|
||||
Permission::StudyHistoryView,
|
||||
|
@ -35,25 +35,40 @@ public function run(): void
|
||||
$chevron = Institute::where('name', 'Chevron')->first();
|
||||
$cmch = Institute::where('name', 'CMCH')->first();
|
||||
|
||||
User::factory(2)->create([
|
||||
User::factory(4)
|
||||
->create([
|
||||
'institute_id' => $chevron->id,
|
||||
])
|
||||
->each(function ($u) {
|
||||
->each(function ($u, $key) {
|
||||
$u->assignRole(Role::Technician);
|
||||
$u->update([
|
||||
'username' => sprintf('tech%d', $key + 1),
|
||||
]);
|
||||
});
|
||||
User::factory(2)->create([
|
||||
|
||||
User::factory(4)
|
||||
->create([
|
||||
'institute_id' => $cmch->id,
|
||||
])
|
||||
->each(function ($u) {
|
||||
->each(function ($u, $key) {
|
||||
$u->assignRole(Role::Technician);
|
||||
$u->update([
|
||||
'username' => sprintf('cmctech%d', $key + 1),
|
||||
]);
|
||||
});
|
||||
|
||||
User::factory(8)->create()
|
||||
->each(function ($u) {
|
||||
User::factory(8)
|
||||
->create()
|
||||
->each(function ($u, $key) {
|
||||
$u->assignRole(Role::Radiologist);
|
||||
$u->update([
|
||||
'display_name' => sprintf('Dr. %s', $u->first_name),
|
||||
'username' => sprintf('rad%d', $key + 1),
|
||||
]);
|
||||
});
|
||||
|
||||
User::factory(3)->create()
|
||||
User::factory(3)
|
||||
->create()
|
||||
->each(function ($u) {
|
||||
$u->assignRole(Role::Guest);
|
||||
});
|
||||
|
@ -27,7 +27,7 @@
|
||||
@endforeach
|
||||
</table>
|
||||
|
||||
<a class="btn btn-secondary btn-xs" href="{{ route('staff.report.create', $study->hash) }}">
|
||||
Create
|
||||
<a class="btn btn-primary btn-xs" target="_blank" href="{{ route('staff.report.create', $study->hash) }}">
|
||||
Create New
|
||||
</a>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user