study details/series -> JSON
This commit is contained in:
parent
9288f1b71d
commit
3c7d43542b
@ -32,7 +32,7 @@ public function create(array $input): User
|
|||||||
'name' => $input['name'],
|
'name' => $input['name'],
|
||||||
'username' => $input['username'],
|
'username' => $input['username'],
|
||||||
'email' => $input['email'],
|
'email' => $input['email'],
|
||||||
//'phone' => $input['phone'],
|
// 'phone' => $input['phone'],
|
||||||
'phone' => phone($input['phone'])->formatE164(),
|
'phone' => phone($input['phone'])->formatE164(),
|
||||||
'password' => Hash::make($input['password']),
|
'password' => Hash::make($input['password']),
|
||||||
]);
|
]);
|
||||||
|
@ -26,7 +26,7 @@ public function details()
|
|||||||
->on($study)
|
->on($study)
|
||||||
->log();
|
->log();
|
||||||
|
|
||||||
//return view('staff.studies.details', compact('study'));
|
// return view('staff.studies.details', compact('study'));
|
||||||
return response()->json($study);
|
return response()->json($study);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,4 +12,12 @@ public function study(): BelongsTo
|
|||||||
{
|
{
|
||||||
return $this->belongsTo(Study::class);
|
return $this->belongsTo(Study::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function casts()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'properties' => 'array',
|
||||||
|
'series' => 'array',
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Models;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
||||||
|
|
||||||
class StudySeries extends Model
|
|
||||||
{
|
|
||||||
public function study(): BelongsTo
|
|
||||||
{
|
|
||||||
return $this->belongsTo(Study::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function casts(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'series_date' => 'datetime',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
@ -75,8 +75,8 @@
|
|||||||
/*
|
/*
|
||||||
* Change this if you want to name the related pivots other than defaults
|
* Change this if you want to name the related pivots other than defaults
|
||||||
*/
|
*/
|
||||||
'role_pivot_key' => null, //default 'role_id',
|
'role_pivot_key' => null, // default 'role_id',
|
||||||
'permission_pivot_key' => null, //default 'permission_id',
|
'permission_pivot_key' => null, // default 'permission_id',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Change this if you want to name the related model primary key other than
|
* Change this if you want to name the related model primary key other than
|
||||||
|
@ -30,10 +30,12 @@ class UserFactory extends Factory
|
|||||||
public function definition(): array
|
public function definition(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => fake()->name(),
|
'first_name' => fake()->firstName(),
|
||||||
|
'last_name' => fake()->lastName(),
|
||||||
|
'display_name' => fake()->name(),
|
||||||
'username' => fake()->unique()->userName(),
|
'username' => fake()->unique()->userName(),
|
||||||
'email' => fake()->unique()->safeEmail(),
|
'email' => fake()->unique()->safeEmail(),
|
||||||
'email_verified_at' => now(),
|
'email_verified_at' => fake()->dateTime(),
|
||||||
'last_seen_at' => fake()->dateTime(),
|
'last_seen_at' => fake()->dateTime(),
|
||||||
'phone' => fake()->phoneNumber(),
|
'phone' => fake()->phoneNumber(),
|
||||||
'user_role' => static::$role ??= UserRole::Guest->value,
|
'user_role' => static::$role ??= UserRole::Guest->value,
|
||||||
@ -44,6 +46,7 @@ public function definition(): array
|
|||||||
'profile_photo_path' => null,
|
'profile_photo_path' => null,
|
||||||
'current_team_id' => null,
|
'current_team_id' => null,
|
||||||
'institute_id' => null,
|
'institute_id' => null,
|
||||||
|
'is_active' => fake()->boolean(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,13 +24,13 @@ public function up(): void
|
|||||||
$table->string('email')->nullable()->index();
|
$table->string('email')->nullable()->index();
|
||||||
$table->timestamp('email_verified_at')->nullable();
|
$table->timestamp('email_verified_at')->nullable();
|
||||||
$table->string('password');
|
$table->string('password');
|
||||||
$table->rememberToken();
|
|
||||||
$table->unsignedTinyInteger('user_role')->default(UserRole::Guest->value);
|
$table->unsignedTinyInteger('user_role')->default(UserRole::Guest->value);
|
||||||
$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->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->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ public function up(): void
|
|||||||
}
|
}
|
||||||
|
|
||||||
Schema::create($tableNames['permissions'], function (Blueprint $table) {
|
Schema::create($tableNames['permissions'], function (Blueprint $table) {
|
||||||
//$table->engine('InnoDB');
|
// $table->engine('InnoDB');
|
||||||
$table->bigIncrements('id'); // permission id
|
$table->bigIncrements('id'); // permission id
|
||||||
$table->string('name'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
|
$table->string('name'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
|
||||||
$table->string('guard_name'); // For MyISAM use string('guard_name', 25);
|
$table->string('guard_name'); // For MyISAM use string('guard_name', 25);
|
||||||
@ -35,7 +35,7 @@ public function up(): void
|
|||||||
});
|
});
|
||||||
|
|
||||||
Schema::create($tableNames['roles'], function (Blueprint $table) use ($teams, $columnNames) {
|
Schema::create($tableNames['roles'], function (Blueprint $table) use ($teams, $columnNames) {
|
||||||
//$table->engine('InnoDB');
|
// $table->engine('InnoDB');
|
||||||
$table->bigIncrements('id'); // role id
|
$table->bigIncrements('id'); // role id
|
||||||
if ($teams || config('permission.testing')) { // permission.testing is a fix for sqlite testing
|
if ($teams || config('permission.testing')) { // permission.testing is a fix for sqlite testing
|
||||||
$table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable();
|
$table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable();
|
||||||
|
@ -11,16 +11,13 @@ public function up(): void
|
|||||||
Schema::create('study_details', function (Blueprint $table) {
|
Schema::create('study_details', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->foreignId('study_id')->unique()->constrained('studies')->cascadeOnDelete();
|
$table->foreignId('study_id')->unique()->constrained('studies')->cascadeOnDelete();
|
||||||
//$table->foreignId('user_id')->constrained('users');
|
// $table->foreignId('user_id')->constrained('users');
|
||||||
$table->text('clinical_history')->nullable();
|
$table->text('clinical_history')->nullable();
|
||||||
$table->text('surgical_history')->nullable();
|
$table->text('surgical_history')->nullable();
|
||||||
$table->text('lab_results')->nullable();
|
$table->text('lab_results')->nullable();
|
||||||
$table->text('clinical_diagnosis')->nullable();
|
$table->text('clinical_diagnosis')->nullable();
|
||||||
$table->string('station_name')->nullable();
|
$table->json('properties')->nullable();
|
||||||
$table->string('operators_name')->nullable();
|
$table->json('series')->nullable();
|
||||||
$table->string('manufacturer')->nullable();
|
|
||||||
$table->string('manufacturer_model_name')->nullable();
|
|
||||||
$table->string('software_versions')->nullable();
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
<?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_series', function (Blueprint $table) {
|
|
||||||
$table->id();
|
|
||||||
$table->foreignId('study_id')->constrained('studies')->cascadeOnDelete();
|
|
||||||
$table->string('orthanc_uid')->unique();
|
|
||||||
$table->dateTime('series_date');
|
|
||||||
$table->string('series_instance_uid')->nullable();
|
|
||||||
$table->string('body_part_examined')->nullable();
|
|
||||||
$table->string('series_description')->nullable();
|
|
||||||
$table->string('modality', 4)->nullable();
|
|
||||||
$table->string('series_number')->nullable();
|
|
||||||
$table->string('protocol_name')->nullable();
|
|
||||||
$table->string('sequence_name')->nullable();
|
|
||||||
$table->string('performed_procedure_step_description')->nullable();
|
|
||||||
$table->unsignedSmallInteger('num_instances')->nullable();
|
|
||||||
$table->timestamps();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('study_series');
|
|
||||||
}
|
|
||||||
};
|
|
@ -14,9 +14,12 @@ public function run(): void
|
|||||||
// User::factory(10)->create();
|
// User::factory(10)->create();
|
||||||
|
|
||||||
User::factory()->create([
|
User::factory()->create([
|
||||||
'name' => 'Administrator',
|
'first_name' => 'Administrator',
|
||||||
|
'display_name' => 'Administrator',
|
||||||
'username' => 'admin',
|
'username' => 'admin',
|
||||||
'email' => 'test@example.com',
|
'email' => 'test@example.com',
|
||||||
|
'email_verified_at' => now(),
|
||||||
|
'phone' => '+8801733938582',
|
||||||
'user_role' => UserRole::Admin->value,
|
'user_role' => UserRole::Admin->value,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user