wip
This commit is contained in:
parent
a12585b7f0
commit
2e2b30cc13
21
app/Models/Facility.php
Normal file
21
app/Models/Facility.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
|
class Facility extends Model
|
||||||
|
{
|
||||||
|
public function institute(): BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Institute::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function casts(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'is_active' => 'boolean',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
7
app/Models/OrthancHost.php
Normal file
7
app/Models/OrthancHost.php
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class OrthancHost extends Model {}
|
@ -123,4 +123,8 @@
|
|||||||
'store' => env('APP_MAINTENANCE_STORE', 'database'),
|
'store' => env('APP_MAINTENANCE_STORE', 'database'),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'pagination' => [
|
||||||
|
'study_counts' => [5, 10, 25, 50, 100],
|
||||||
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
@ -12,6 +12,8 @@ public function up(): void
|
|||||||
$table->id();
|
$table->id();
|
||||||
$table->string('name')->unique();
|
$table->string('name')->unique();
|
||||||
$table->boolean('is_active')->default(false);
|
$table->boolean('is_active')->default(false);
|
||||||
|
$table->string('address')->nullable();
|
||||||
|
$table->string('logo_path')->nullable();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('facilities', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->boolean('is_active')->default(false);
|
||||||
|
$table->foreignId('institute_id')->constrained('institutes')->cascadeOnDelete();
|
||||||
|
$table->string('name');
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
$table->unique(['institute_id', 'name']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('facilities');
|
||||||
|
}
|
||||||
|
};
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Enums\UserRole;
|
use App\Models\Enums\UserRole;
|
||||||
|
use App\Models\Facility;
|
||||||
use App\Models\Institute;
|
use App\Models\Institute;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
@ -28,6 +29,7 @@ public function up(): void
|
|||||||
$table->foreignId('current_team_id')->nullable();
|
$table->foreignId('current_team_id')->nullable();
|
||||||
$table->string('profile_photo_path')->nullable();
|
$table->string('profile_photo_path')->nullable();
|
||||||
$table->foreignIdFor(Institute::class)->nullable()->index();
|
$table->foreignIdFor(Institute::class)->nullable()->index();
|
||||||
|
$table->foreignIdFor(Facility::class)->nullable()->index();
|
||||||
$table->string('timezone')->default('Asia/Dhaka');
|
$table->string('timezone')->default('Asia/Dhaka');
|
||||||
$table->timestamp('last_seen_at')->nullable();
|
$table->timestamp('last_seen_at')->nullable();
|
||||||
$table->rememberToken();
|
$table->rememberToken();
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use App\Models\Enums\ReportStatus;
|
use App\Models\Enums\ReportStatus;
|
||||||
use App\Models\Enums\StudyLevelStatus;
|
use App\Models\Enums\StudyLevelStatus;
|
||||||
|
use App\Models\Facility;
|
||||||
use App\Models\Institute;
|
use App\Models\Institute;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
@ -40,7 +41,8 @@ public function up(): void
|
|||||||
$table->dateTime('reported_at')->nullable();
|
$table->dateTime('reported_at')->nullable();
|
||||||
$table->dateTime('authorized_at')->nullable();
|
$table->dateTime('authorized_at')->nullable();
|
||||||
|
|
||||||
$table->foreignIdFor(Institute::class)->constrained()->onDelete('cascade');
|
$table->foreignIdFor(Institute::class)->constrained()->cascadeOnDelete();
|
||||||
|
$table->foreignIdFor(Facility::class)->nullable()->constrained()->cascadeOnDelete();
|
||||||
$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::Pending->value);
|
||||||
|
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('orthanc_hosts', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('server_name')->unique();
|
||||||
|
$table->string('fqdn')->unique();
|
||||||
|
$table->string('ae_title')->nullable();
|
||||||
|
$table->string('stone_viewer_url')->nullable();
|
||||||
|
$table->string('ohif_viewer_url')->nullable();
|
||||||
|
$table->string('meddream_viewer_url')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('orthanc_hosts');
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user