diff --git a/app/DAL/Studies/WorklistBase.php b/app/DAL/Studies/WorklistBase.php index 39db9bd..e201672 100644 --- a/app/DAL/Studies/WorklistBase.php +++ b/app/DAL/Studies/WorklistBase.php @@ -41,7 +41,7 @@ abstract class WorklistBase implements IUserStudyLister protected static function reportCompleteQuery(Builder $query): Builder { - return $query->where('report_status', '=', ReportStatus::Authorized->value); + return $query->where('report_status', '=', ReportStatus::Approved->value); } public function setRadiologist(int $radiologist_id): self diff --git a/app/Domain/Report/ReportStatus.php b/app/Domain/Report/ReportStatus.php index 298a773..db21575 100644 --- a/app/Domain/Report/ReportStatus.php +++ b/app/Domain/Report/ReportStatus.php @@ -4,9 +4,10 @@ enum ReportStatus: int { - case Pending = 0; + case Unread = 0; case Opened = 10; - case Draft = 20; - case Finalized = 30; - case Authorized = 90; + case Transcribed = 20; + case Preliminary = 30; + case Finalized = 40; + case Approved = 90; } diff --git a/app/Domain/Study/Priority.php b/app/Domain/Study/Priority.php index 9f3078c..a1ff1b5 100644 --- a/app/Domain/Study/Priority.php +++ b/app/Domain/Study/Priority.php @@ -5,7 +5,7 @@ enum Priority: int { case Low = 0; - case Normal = 50; + case Routine = 50; case High = 75; case Urgent = 100; } diff --git a/app/Models/Study.php b/app/Models/Study.php index 3e460cc..d94a31e 100644 --- a/app/Models/Study.php +++ b/app/Models/Study.php @@ -128,19 +128,19 @@ public function isActive(): bool public function getReportStatusLedAttribute(): string { $color = match ($this->report_status) { - ReportStatus::Pending => 'bg-white', + ReportStatus::Unread => 'bg-white', ReportStatus::Opened => 'bg-secondary', - ReportStatus::Draft => 'bg-info', + ReportStatus::Preliminary => 'bg-info', ReportStatus::Finalized => 'bg-primary', - ReportStatus::Authorized => 'bg-success', + ReportStatus::Approved => 'bg-success', default => 'bg-light', }; // $icon = match ($this->report_status) { - ReportStatus::Pending => 'spinner text-muted', - ReportStatus::Draft => 'pen-to-square', + ReportStatus::Unread => 'spinner text-muted', + ReportStatus::Preliminary => 'pen-to-square', ReportStatus::Finalized => 'badge-check', - ReportStatus::Authorized => 'shield-check', + ReportStatus::Approved => 'shield-check', default => 'spinner text-muted', }; diff --git a/app/Services/Workflow/Manager.php b/app/Services/Workflow/Manager.php index a8baf92..85f451d 100644 --- a/app/Services/Workflow/Manager.php +++ b/app/Services/Workflow/Manager.php @@ -64,17 +64,17 @@ private function activeStudy(Closure $fn): bool public function canAssignPhysician(): bool { - return $this->activeStudy(fn () => $this->study->report_status <= ReportStatus::Draft); + return $this->activeStudy(fn () => $this->study->report_status <= ReportStatus::Preliminary); } public function canStudyHistoryEdit(): bool { - return $this->activeStudy(fn () => $this->study->report_status <= ReportStatus::Draft); + return $this->activeStudy(fn () => $this->study->report_status <= ReportStatus::Preliminary); } public function canAttachmentUpload(): bool { - return $this->activeStudy(fn () => $this->study->report_status <= ReportStatus::Draft); + return $this->activeStudy(fn () => $this->study->report_status <= ReportStatus::Preliminary); } public function canReportDownload(): bool 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 21e1c27..cc2ce68 100644 --- a/database/migrations/2024_12_27_060234_create_studies_table.php +++ b/database/migrations/2024_12_27_060234_create_studies_table.php @@ -15,7 +15,7 @@ public function up(): void $table->id(); $table->string('orthanc_uuid')->unique(); $table->boolean('is_archived')->default(false); - $table->unsignedTinyInteger('priority')->default(Priority::Normal); + $table->unsignedTinyInteger('priority')->default(Priority::Routine); $table->string('patient_id')->nullable(); $table->string('patient_uuid')->nullable()->index(); @@ -41,7 +41,7 @@ public function up(): void $table->timestamp('archived_at')->nullable(); $table->unsignedTinyInteger('study_status')->default(StudyLevelStatus::Pending->value); - $table->unsignedTinyInteger('report_status')->default(ReportStatus::Pending->value); + $table->unsignedTinyInteger('report_status')->default(ReportStatus::Unread->value); $table->unsignedSmallInteger('image_count')->nullable(); $table->unsignedSmallInteger('series_count')->nullable(); diff --git a/database/migrations/2024_12_28_051451_create_study_reports_table.php b/database/migrations/2024_12_28_051451_create_study_reports_table.php index 004df3a..e37ba62 100644 --- a/database/migrations/2024_12_28_051451_create_study_reports_table.php +++ b/database/migrations/2024_12_28_051451_create_study_reports_table.php @@ -15,7 +15,7 @@ public function up(): void { Schema::create('study_reports', function (Blueprint $table) { $table->id(); - $table->unsignedTinyInteger('report_status')->default(ReportStatus::Pending->value); + $table->unsignedTinyInteger('report_status')->default(ReportStatus::Unread->value); $table->string('accession_number', 64)->unique()->index()->default(DB::raw("concat('REP-', gen_random_uuid())")); $table->foreignIdFor(Institute::class)->index()->nullable()->constrained()->nullOnDelete();