This commit is contained in:
Masroor Ehsan 2025-01-07 17:16:05 +06:00
parent f95ada6426
commit 59f74f0e3f
7 changed files with 19 additions and 18 deletions

View File

@ -41,7 +41,7 @@ abstract class WorklistBase implements IUserStudyLister
protected static function reportCompleteQuery(Builder $query): Builder 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 public function setRadiologist(int $radiologist_id): self

View File

@ -4,9 +4,10 @@
enum ReportStatus: int enum ReportStatus: int
{ {
case Pending = 0; case Unread = 0;
case Opened = 10; case Opened = 10;
case Draft = 20; case Transcribed = 20;
case Finalized = 30; case Preliminary = 30;
case Authorized = 90; case Finalized = 40;
case Approved = 90;
} }

View File

@ -5,7 +5,7 @@
enum Priority: int enum Priority: int
{ {
case Low = 0; case Low = 0;
case Normal = 50; case Routine = 50;
case High = 75; case High = 75;
case Urgent = 100; case Urgent = 100;
} }

View File

@ -128,19 +128,19 @@ public function isActive(): bool
public function getReportStatusLedAttribute(): string public function getReportStatusLedAttribute(): string
{ {
$color = match ($this->report_status) { $color = match ($this->report_status) {
ReportStatus::Pending => 'bg-white', ReportStatus::Unread => 'bg-white',
ReportStatus::Opened => 'bg-secondary', ReportStatus::Opened => 'bg-secondary',
ReportStatus::Draft => 'bg-info', ReportStatus::Preliminary => 'bg-info',
ReportStatus::Finalized => 'bg-primary', ReportStatus::Finalized => 'bg-primary',
ReportStatus::Authorized => 'bg-success', ReportStatus::Approved => 'bg-success',
default => 'bg-light', default => 'bg-light',
}; };
// <i class="fa-solid fa-spinner"></i> // <i class="fa-solid fa-spinner"></i>
$icon = match ($this->report_status) { $icon = match ($this->report_status) {
ReportStatus::Pending => 'spinner text-muted', ReportStatus::Unread => 'spinner text-muted',
ReportStatus::Draft => 'pen-to-square', ReportStatus::Preliminary => 'pen-to-square',
ReportStatus::Finalized => 'badge-check', ReportStatus::Finalized => 'badge-check',
ReportStatus::Authorized => 'shield-check', ReportStatus::Approved => 'shield-check',
default => 'spinner text-muted', default => 'spinner text-muted',
}; };

View File

@ -64,17 +64,17 @@ private function activeStudy(Closure $fn): bool
public function canAssignPhysician(): 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 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 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 public function canReportDownload(): bool

View File

@ -15,7 +15,7 @@ public function up(): void
$table->id(); $table->id();
$table->string('orthanc_uuid')->unique(); $table->string('orthanc_uuid')->unique();
$table->boolean('is_archived')->default(false); $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_id')->nullable();
$table->string('patient_uuid')->nullable()->index(); $table->string('patient_uuid')->nullable()->index();
@ -41,7 +41,7 @@ public function up(): void
$table->timestamp('archived_at')->nullable(); $table->timestamp('archived_at')->nullable();
$table->unsignedTinyInteger('study_status')->default(StudyLevelStatus::Pending->value); $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('image_count')->nullable();
$table->unsignedSmallInteger('series_count')->nullable(); $table->unsignedSmallInteger('series_count')->nullable();

View File

@ -15,7 +15,7 @@ public function up(): void
{ {
Schema::create('study_reports', function (Blueprint $table) { Schema::create('study_reports', function (Blueprint $table) {
$table->id(); $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->string('accession_number', 64)->unique()->index()->default(DB::raw("concat('REP-', gen_random_uuid())"));
$table->foreignIdFor(Institute::class)->index()->nullable()->constrained()->nullOnDelete(); $table->foreignIdFor(Institute::class)->index()->nullable()->constrained()->nullOnDelete();