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