From 2cd9050247a38489653abb07a8a33aef9e2b4904 Mon Sep 17 00:00:00 2001 From: Masroor Ehsan Date: Tue, 7 Jan 2025 16:46:16 +0600 Subject: [PATCH] DDL --- .../0001_01_01_000000_create_users_table.php | 1 + ...024_12_28_051451_create_study_reports_table.php | 14 ++++++++++++++ .../2024_12_29_124458_create_templates_table.php | 1 + .../2025_01_07_904595_create_radiologists.php | 2 +- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index 445fffb..9e3eda1 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -14,6 +14,7 @@ public function up(): void $table->id(); $table->string('guid', 40)->unique()->index()->default(DB::raw("concat('USR-', gen_random_uuid())")); $table->boolean('is_active')->default(true); + $table->string('prefix')->nullable(); $table->string('first_name'); $table->string('last_name')->nullable(); $table->string('display_name'); 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 8dfc12b..bc990dd 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 @@ -1,6 +1,8 @@ id(); $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(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->binary('content')->nullable(); $table->string('remarks')->nullable(); diff --git a/database/migrations/2024_12_29_124458_create_templates_table.php b/database/migrations/2024_12_29_124458_create_templates_table.php index 4d09628..56f890c 100644 --- a/database/migrations/2024_12_29_124458_create_templates_table.php +++ b/database/migrations/2024_12_29_124458_create_templates_table.php @@ -14,6 +14,7 @@ public function up(): void $table->foreignId('owner_id')->nullable()->constrained('users')->nullOnDelete(); $table->boolean('is_private')->default(false); $table->unsignedTinyInteger('priority')->default(0); + $table->string('body_part')->nullable(); $table->string('title'); $table->longText('content'); $table->string('tags')->nullable(); diff --git a/database/migrations/2025_01_07_904595_create_radiologists.php b/database/migrations/2025_01_07_904595_create_radiologists.php index 979f7c5..aba5ac2 100644 --- a/database/migrations/2025_01_07_904595_create_radiologists.php +++ b/database/migrations/2025_01_07_904595_create_radiologists.php @@ -12,7 +12,7 @@ public function up(): void Schema::create('radiologists', static function (Blueprint $table) { $table->id(); $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->timestamps(); });