This commit is contained in:
Masroor Ehsan 2025-01-07 16:46:16 +06:00
parent 227ad59e4b
commit 2cd9050247
4 changed files with 17 additions and 1 deletions

View File

@ -14,6 +14,7 @@ public function up(): void
$table->id(); $table->id();
$table->string('guid', 40)->unique()->index()->default(DB::raw("concat('USR-', gen_random_uuid())")); $table->string('guid', 40)->unique()->index()->default(DB::raw("concat('USR-', gen_random_uuid())"));
$table->boolean('is_active')->default(true); $table->boolean('is_active')->default(true);
$table->string('prefix')->nullable();
$table->string('first_name'); $table->string('first_name');
$table->string('last_name')->nullable(); $table->string('last_name')->nullable();
$table->string('display_name'); $table->string('display_name');

View File

@ -1,6 +1,8 @@
<?php <?php
use App\Models\Enums\ReportStatus; use App\Models\Enums\ReportStatus;
use App\Models\Facility;
use App\Models\Institute;
use App\Models\Study; use App\Models\Study;
use App\Models\User; use App\Models\User;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
@ -14,8 +16,20 @@ 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::Pending->value);
$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(Facility::class)->index()->nullable()->constrained()->nullOnDelete();
$table->foreignIdFor(Study::class)->index()->constrained()->cascadeOnDelete(); $table->foreignIdFor(Study::class)->index()->constrained()->cascadeOnDelete();
$table->foreignIdFor(User::class, 'radiologist_id')->index()->constrained()->cascadeOnDelete(); $table->foreignIdFor(User::class, 'radiologist_id')->index()->constrained()->cascadeOnDelete();
$table->foreignIdFor(User::class, 'dictate_by_id')->index()->nullable()->constrained()->nullOnDelete();
$table->timestamp('dictated_at')->nullable();
$table->foreignIdFor(User::class, 'approve_by_id')->index()->nullable()->constrained()->nullOnDelete();
$table->timestamp('approved_at')->nullable();
$table->string('report_title')->nullable(); $table->string('report_title')->nullable();
$table->binary('content')->nullable(); $table->binary('content')->nullable();
$table->string('remarks')->nullable(); $table->string('remarks')->nullable();

View File

@ -14,6 +14,7 @@ public function up(): void
$table->foreignId('owner_id')->nullable()->constrained('users')->nullOnDelete(); $table->foreignId('owner_id')->nullable()->constrained('users')->nullOnDelete();
$table->boolean('is_private')->default(false); $table->boolean('is_private')->default(false);
$table->unsignedTinyInteger('priority')->default(0); $table->unsignedTinyInteger('priority')->default(0);
$table->string('body_part')->nullable();
$table->string('title'); $table->string('title');
$table->longText('content'); $table->longText('content');
$table->string('tags')->nullable(); $table->string('tags')->nullable();

View File

@ -12,7 +12,7 @@ public function up(): void
Schema::create('radiologists', static function (Blueprint $table) { Schema::create('radiologists', static function (Blueprint $table) {
$table->id(); $table->id();
$table->foreignIdFor(User::class)->unique()->constrained()->cascadeOnDelete(); $table->foreignIdFor(User::class)->unique()->constrained()->cascadeOnDelete();
$table->text('signature_img_path')->nullable(); $table->text('signature_image_path')->nullable();
$table->text('signature_text')->nullable(); $table->text('signature_text')->nullable();
$table->timestamps(); $table->timestamps();
}); });