diff --git a/app/DataTables/WorklistDataTable.php b/app/DataTables/WorklistDataTable.php index 3c8b050..697f5ec 100644 --- a/app/DataTables/WorklistDataTable.php +++ b/app/DataTables/WorklistDataTable.php @@ -62,13 +62,6 @@ public function html(): HtmlBuilder public function getColumns(): array { return [ - Column::computed('action') - ->exportable(false) - ->printable(false) - ->width(60) - ->addClass('text-center'), - - Column::make('id'), Column::make('study_priority'), Column::make('study_modality'), @@ -83,9 +76,15 @@ public function getColumns(): array Column::make('study_description'), Column::make('reporting_physician_id'), Column::make('body_part_examined'), - Column::make('image_count'), + Column::make('num_instances'), // Column::make('xxx'), + Column::computed('action') + ->exportable(false) + ->printable(false) + ->width(60) + ->addClass('text-center'), + ]; } diff --git a/app/Models/Enums/Priority.php b/app/Models/Enums/Priority.php new file mode 100644 index 0000000..fac6c0a --- /dev/null +++ b/app/Models/Enums/Priority.php @@ -0,0 +1,11 @@ + 'boolean', 'study_status' => StudyLevelStatus::class, 'report_status' => ReportStatus::class, + 'study_priority' => Priority::class, 'received_at' => 'datetime', 'reported_at' => 'datetime', 'assigned_at' => 'datetime', @@ -184,4 +186,13 @@ public function toArray(): array 'allowed' => $this->allowed(), ]); } + + public function getPriorityIconAttribute(): string + { + return match ($this->study_priority) { + 1 => 'fa fa-star text-warning', + 2 => 'fa fa-star text-danger', + default => 'fa fa-star text-primary', + }; + } } diff --git a/app/Services/Pacs/Sync/StudiesSync.php b/app/Services/Pacs/Sync/StudiesSync.php index 858e474..c069c32 100644 --- a/app/Services/Pacs/Sync/StudiesSync.php +++ b/app/Services/Pacs/Sync/StudiesSync.php @@ -116,7 +116,7 @@ public function transformData(mixed $orthanc_src): array 'referring_physician_name' => data_get($orthanc_src, 'MainDicomTags.ReferringPhysicianName'), 'study_id' => data_get($orthanc_src, 'MainDicomTags.StudyID'), 'study_instance_uid' => data_get($orthanc_src, 'MainDicomTags.StudyInstanceUID'), - 'study_modality' => data_get($orthanc_src, 'RequestedTags.Modality'), + 'modality' => data_get($orthanc_src, 'RequestedTags.Modality'), 'body_part_examined' => data_get($orthanc_src, 'RequestedTags.BodyPartExamined'), 'study_date' => DicomUtils::dateTimeToCarbon($orthanc_src['MainDicomTags']['StudyDate'], $orthanc_src['MainDicomTags']['StudyTime']) ?? now('UTC'), diff --git a/database/migrations/2024_12_27_060234_create_studies_table.php b/database/migrations/2024_12_27_060234_create_studies_table.php index 674cf88..b69a515 100644 --- a/database/migrations/2024_12_27_060234_create_studies_table.php +++ b/database/migrations/2024_12_27_060234_create_studies_table.php @@ -1,5 +1,6 @@ id(); $table->string('orthanc_uuid')->unique(); $table->boolean('is_archived')->default(false); - $table->unsignedTinyInteger('study_priority')->default(0); + $table->unsignedTinyInteger('priority')->default(Priority::Normal); $table->string('patient_id')->nullable(); $table->string('patient_uuid')->nullable()->index(); @@ -24,13 +25,13 @@ public function up(): void $table->string('study_instance_uid')->index(); $table->string('study_id')->nullable(); - $table->string('institution_name')->nullable(); $table->string('accession_number')->nullable(); + $table->string('institution_name')->nullable(); $table->string('study_description')->nullable(); $table->string('body_part_examined')->nullable(); + $table->string('modality', 4)->nullable(); $table->string('referring_physician_name')->nullable(); - $table->string('study_modality', 4)->nullable(); $table->timestamp('study_date'); $table->timestamp('received_at'); $table->timestamp('assigned_at')->nullable();