From 7f5e916d80e5f9cac778504b22cc0fabc36a8125 Mon Sep 17 00:00:00 2001 From: Dr Masroor Ehsan Date: Wed, 29 Jan 2025 22:12:47 +0600 Subject: [PATCH] datatable --- app/DataTables/WorklistDataTable.php | 6 +++--- app/Models/Study.php | 4 ++-- app/Services/ACL/WorklistColumn.php | 1 - app/Services/ACL/WorklistGuard.php | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/DataTables/WorklistDataTable.php b/app/DataTables/WorklistDataTable.php index 022c925..0009f16 100644 --- a/app/DataTables/WorklistDataTable.php +++ b/app/DataTables/WorklistDataTable.php @@ -47,7 +47,7 @@ public function dataTable(QueryBuilder $query): EloquentDataTable $dataTable = new EloquentDataTable($query); $rawColumns = [ 'priority_icon', - 'report_status_led', + 'workflow_level_led', ]; foreach ($this->renderCustomColumns() as $column => $content) { $dataTable->addColumn($column, $content); @@ -148,11 +148,11 @@ public function getColumns(): array ->title(''); break; - case WorklistColumn::ReportStatus: + case WorklistColumn::WorkflowLevel: $columns[] = Column::make($col->value) ->searchable(false) ->hidden(); - $columns[] = Column::make('report_status_led') + $columns[] = Column::make('workflow_level_led') ->searchable(false) ->orderable(false) ->addClass('text-center p-0 ps-2') diff --git a/app/Models/Study.php b/app/Models/Study.php index 7d0d6f6..afb2a1d 100644 --- a/app/Models/Study.php +++ b/app/Models/Study.php @@ -175,7 +175,7 @@ public function isArchived(): bool return $this->archived_at !== null; } - public function getReportStatusLedAttribute(): string + public function getWorkflowLevelLedAttribute(): string { // todo: implement $color = match ($this->workflow_level) { @@ -316,7 +316,7 @@ public function toArray(): array 'reader_name' => $this->readingPhysician?->display_name, // 'assigned_physician_name' => $this->assignedPhysician?->display_name, 'reader_photo' => $this->readingPhysician?->profile_photo_url, - 'report_status_led' => $this->getReportStatusLedAttribute(), + 'workflow_level_led' => $this->getWorkflowLevelLedAttribute(), 'priority_icon' => $this->getPriorityIcon(), 'sex_age' => $this->sexAge(), 'num_instances' => $this->numInstances(), diff --git a/app/Services/ACL/WorklistColumn.php b/app/Services/ACL/WorklistColumn.php index 8ac5e34..2c09c3b 100644 --- a/app/Services/ACL/WorklistColumn.php +++ b/app/Services/ACL/WorklistColumn.php @@ -5,7 +5,6 @@ enum WorklistColumn: string { case WorkflowLevel = 'workflow_level'; - case ReportStatus = 'report_status'; case StudyHash = 'hash'; case PatientName = 'patient_name'; case PatientId = 'patient_id'; diff --git a/app/Services/ACL/WorklistGuard.php b/app/Services/ACL/WorklistGuard.php index a759525..d9e9212 100644 --- a/app/Services/ACL/WorklistGuard.php +++ b/app/Services/ACL/WorklistGuard.php @@ -14,7 +14,7 @@ public static function worklistColumns(User|int|null $usr = null): Collection $user = me($usr); $columns = collect([ WorklistColumn::Priority, - WorklistColumn::ReportStatus, + WorklistColumn::WorkflowLevel, WorklistColumn::ActionButtons, // WorklistColumn::AssignedPhysician, WorklistColumn::PatientId,