wip
This commit is contained in:
parent
216a565d3a
commit
312b6bed6e
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Models\Enums;
|
namespace App\Models\Enums;
|
||||||
|
|
||||||
enum StudyModality:string
|
enum StudyModality: string
|
||||||
{
|
{
|
||||||
case CR = 'CR';
|
case CR = 'CR';
|
||||||
case CT = 'CT';
|
case CT = 'CT';
|
||||||
|
@ -4,6 +4,4 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class Study extends Model
|
class Study extends Model {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@ -4,6 +4,4 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class StudyAttachment extends Model
|
class StudyAttachment extends Model {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@ -4,6 +4,4 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class StudyNote extends Model
|
class StudyNote extends Model {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
19
app/Models/StudyReport.php
Normal file
19
app/Models/StudyReport.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
|
class StudyReport extends Model
|
||||||
|
{
|
||||||
|
public function study(): BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Study::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function radiologist(): BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'radiologist_id');
|
||||||
|
}
|
||||||
|
}
|
@ -14,11 +14,11 @@
|
|||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
use HasApiTokens;
|
use HasApiTokens;
|
||||||
|
|
||||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
use HasProfilePhoto;
|
use HasProfilePhoto;
|
||||||
|
|
||||||
use HasRoles;
|
use HasRoles;
|
||||||
use Notifiable;
|
use Notifiable;
|
||||||
use TwoFactorAuthenticatable;
|
use TwoFactorAuthenticatable;
|
||||||
|
@ -6,14 +6,15 @@
|
|||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
return new class extends Migration {
|
return new class extends Migration
|
||||||
|
{
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('studies', function (Blueprint $table) {
|
Schema::create('studies', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('orthanc_uid')->unique();
|
$table->string('orthanc_uid')->unique();
|
||||||
$table->boolean('is_active')->default(true);
|
$table->boolean('is_active')->default(true);
|
||||||
$table->tinyInteger('priority')->default(0);
|
$table->unsignedTinyInteger('study_priority')->default(0);
|
||||||
$table->string('patient_id')->nullable();
|
$table->string('patient_id')->nullable();
|
||||||
$table->string('patient_name');
|
$table->string('patient_name');
|
||||||
$table->string('patient_sex');
|
$table->string('patient_sex');
|
||||||
@ -25,9 +26,10 @@ public function up(): void
|
|||||||
$table->text('history')->nullable();
|
$table->text('history')->nullable();
|
||||||
$table->dateTime('study_date')->index();
|
$table->dateTime('study_date')->index();
|
||||||
$table->dateTime('upload_date')->index();
|
$table->dateTime('upload_date')->index();
|
||||||
|
$table->dateTime('report_date')->nullable();
|
||||||
$table->foreignIdFor(Site::class)->constrained()->onDelete('cascade');
|
$table->foreignIdFor(Site::class)->constrained()->onDelete('cascade');
|
||||||
$table->tinyInteger('report_status')->default(0);
|
$table->unsignedTinyInteger('report_status')->default(0);
|
||||||
$table->string('study_modality',4);
|
$table->string('study_modality', 4);
|
||||||
$table->foreignIdFor(User::class, 'assigned_physician_id')->nullable()->constrained()->onDelete('set null');
|
$table->foreignIdFor(User::class, 'assigned_physician_id')->nullable()->constrained()->onDelete('set null');
|
||||||
$table->foreignIdFor(User::class, 'interpreting_physician_id')->nullable()->constrained()->onDelete('set null');
|
$table->foreignIdFor(User::class, 'interpreting_physician_id')->nullable()->constrained()->onDelete('set null');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
@ -6,13 +6,15 @@
|
|||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
return new class extends Migration {
|
return new class extends Migration
|
||||||
|
{
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('study_attachments', function (Blueprint $table) {
|
Schema::create('study_attachments', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('file_name');
|
$table->string('file_name');
|
||||||
$table->integer('file_size');
|
$table->integer('file_size')->nullable();
|
||||||
|
$table->string('file_type')->nullable();
|
||||||
$table->foreignIdFor(Study::class)->constrained()->onDelete('cascade');
|
$table->foreignIdFor(Study::class)->constrained()->onDelete('cascade');
|
||||||
$table->foreignIdFor(User::class)->nullable()->constrained()->onDelete('SET NULL');
|
$table->foreignIdFor(User::class)->nullable()->constrained()->onDelete('SET NULL');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
@ -6,15 +6,19 @@
|
|||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
return new class extends Migration {
|
return new class extends Migration
|
||||||
|
{
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('study_notes', function (Blueprint $table) {
|
Schema::create('study_notes', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->foreignIdFor(Study::class)->constrained()->onDelete('cascade');
|
$table->foreignIdFor(Study::class)->constrained()->onDelete('cascade');
|
||||||
$table->foreignIdFor(User::class)->nullable()->constrained()->onDelete('cascade');
|
$table->foreignIdFor(User::class)->nullable()->constrained()->onDelete('cascade');
|
||||||
|
$table->string('title')->nullable();
|
||||||
$table->text('note');
|
$table->text('note');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
||||||
|
$table->index(['study_id', 'created_at']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
<?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('study_reports', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->unsignedTinyInteger('report_status')->default(0);
|
||||||
|
$table->foreignId('study_id')->constrained('studies');
|
||||||
|
$table->foreignId('radiologist_id')->constrained('users');
|
||||||
|
$table->string('file_path');
|
||||||
|
$table->string('pdf_path')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
$table->unique(['study_id', 'created_at']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('study_reports');
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user