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 b1ec8ac..0a46b82 100644 --- a/database/migrations/2024_12_27_060234_create_studies_table.php +++ b/database/migrations/2024_12_27_060234_create_studies_table.php @@ -14,7 +14,10 @@ public function up(): void { Schema::create('studies', function (Blueprint $table) { $table->id(); - $table->foreignIdFor(DicomServer::class)->index(); + $table->unsignedBigInteger('dicom_server_id')->index(); + $table->unsignedBigInteger('institute_id')->index(); + $table->unsignedBigInteger('facility_id')->nullable(); + $table->unsignedTinyInteger('priority')->default(Priority::Routine); $table->unsignedTinyInteger('study_status')->default(StudyLevelStatus::Pending->value); $table->unsignedTinyInteger('report_status')->default(ReportStatus::Unread->value); @@ -35,6 +38,10 @@ public function up(): void $table->string('modality', 4)->nullable(); $table->string('referring_physician_name')->nullable(); + $table->unsignedSmallInteger('image_count')->nullable(); + $table->unsignedSmallInteger('series_count')->nullable(); + $table->unsignedInteger('disk_size')->nullable(); + $table->timestamp('study_date'); $table->timestamp('received_at'); $table->timestamp('assigned_at')->nullable(); @@ -43,19 +50,12 @@ public function up(): void $table->timestamp('approved_at')->nullable(); $table->timestamp('archived_at')->nullable(); - $table->unsignedSmallInteger('image_count')->nullable(); - $table->unsignedSmallInteger('series_count')->nullable(); - $table->unsignedInteger('disk_size')->nullable(); - // $table->unsignedBigInteger('assigned_physician_id')->nullable(); $table->unsignedBigInteger('locking_physician_id')->nullable(); $table->unsignedBigInteger('reading_physician_id')->nullable(); $table->unsignedBigInteger('approving_physician_id')->nullable(); $table->unsignedBigInteger('clinician_id')->nullable(); - $table->unsignedBigInteger('institute_id'); - $table->unsignedBigInteger('facility_id')->nullable(); - $table->timestamps(); $table->unique(['dicom_server_id', 'orthanc_uuid']);