wip
This commit is contained in:
parent
7f770512cd
commit
414d66e5d7
@ -9,5 +9,6 @@ enum UserRole: int
|
|||||||
case ReferringPhysician = 2;
|
case ReferringPhysician = 2;
|
||||||
case Technician = 3;
|
case Technician = 3;
|
||||||
case Radiologist = 4;
|
case Radiologist = 4;
|
||||||
|
case Associate = 5;
|
||||||
case Admin = 99;
|
case Admin = 99;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ class Study extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'is_locked' => 'boolean',
|
'is_locked' => 'boolean',
|
||||||
'is_active' => 'boolean',
|
'is_archived' => 'boolean',
|
||||||
'study_status' => StudyLevelStatus::class,
|
'study_status' => StudyLevelStatus::class,
|
||||||
'report_status' => ReportStatus::class,
|
'report_status' => ReportStatus::class,
|
||||||
];
|
];
|
||||||
@ -35,4 +35,9 @@ public function reports(): HasMany
|
|||||||
{
|
{
|
||||||
return $this->hasMany(StudyReport::class);
|
return $this->hasMany(StudyReport::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function shares(): HasMany
|
||||||
|
{
|
||||||
|
return $this->hasMany(SharedStudy::class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,15 +182,18 @@ private function updateStudy(int $row_id, mixed $study): void
|
|||||||
{
|
{
|
||||||
$payload = $this->prepareData($study);
|
$payload = $this->prepareData($study);
|
||||||
unset($payload['study']['orthanc_uid']);
|
unset($payload['study']['orthanc_uid']);
|
||||||
|
$payload['study']['updated_at'] = now();
|
||||||
DB::table('studies')->where('id', $row_id)->update($payload['study']);
|
DB::table('studies')->where('id', $row_id)->update($payload['study']);
|
||||||
|
|
||||||
if (! empty($payload['details'])) {
|
if (! empty($payload['details'])) {
|
||||||
|
$payload['details']['updated_at'] = now();
|
||||||
DB::table('study_details')->where('study_id', $row_id)->update($payload['details']);
|
DB::table('study_details')->where('study_id', $row_id)->update($payload['details']);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($payload['series'] as $series) {
|
foreach ($payload['series'] as $series) {
|
||||||
$series_guid = $series['orthanc_uid'];
|
$series_guid = $series['orthanc_uid'];
|
||||||
unset($series['orthanc_uid']);
|
unset($series['orthanc_uid']);
|
||||||
|
$series['updated_at'] = now();
|
||||||
DB::table('study_series')->where('orthanc_uid', $series_guid)->update($series);
|
DB::table('study_series')->where('orthanc_uid', $series_guid)->update($series);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -204,6 +207,7 @@ private function insertStudy(mixed $study): void
|
|||||||
|
|
||||||
foreach ($payload['series'] as $series) {
|
foreach ($payload['series'] as $series) {
|
||||||
$series['study_id'] = $row->id;
|
$series['study_id'] = $row->id;
|
||||||
|
$series['created_at'] = now();
|
||||||
DB::table('study_series')->insert($series);
|
DB::table('study_series')->insert($series);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,10 +15,13 @@ public function up(): void
|
|||||||
{
|
{
|
||||||
Schema::create('users', function (Blueprint $table) {
|
Schema::create('users', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('name');
|
$table->boolean('is_active')->default(true);
|
||||||
|
$table->string('first_name');
|
||||||
|
$table->string('last_name')->nullable();
|
||||||
|
$table->string('display_name');
|
||||||
$table->string('username')->unique();
|
$table->string('username')->unique();
|
||||||
$table->string('email')->nullable()->index();
|
|
||||||
$table->string('phone')->nullable()->index();
|
$table->string('phone')->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->rememberToken();
|
||||||
|
@ -15,8 +15,8 @@ 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_archived')->default(false);
|
||||||
$table->boolean('is_locked')->default(true);
|
$table->boolean('is_locked')->default(false);
|
||||||
$table->unsignedTinyInteger('study_priority')->default(0);
|
$table->unsignedTinyInteger('study_priority')->default(0);
|
||||||
$table->string('patient_id')->nullable();
|
$table->string('patient_id')->nullable();
|
||||||
$table->string('patient_uid')->nullable();
|
$table->string('patient_uid')->nullable();
|
||||||
|
@ -16,6 +16,9 @@ public function up(): void
|
|||||||
$table->foreignId('sender_id')->nullable()->constrained('users')->nullOnDelete();
|
$table->foreignId('sender_id')->nullable()->constrained('users')->nullOnDelete();
|
||||||
$table->unsignedTinyInteger('access_flags')->default(StudyAccessFlags::Forbidden->value);
|
$table->unsignedTinyInteger('access_flags')->default(StudyAccessFlags::Forbidden->value);
|
||||||
$table->string('access_password')->nullable();
|
$table->string('access_password')->nullable();
|
||||||
|
$table->string('patient_name')->nullable();
|
||||||
|
$table->string('study_description')->nullable();
|
||||||
|
$table->dateTime('study_date')->nullable();
|
||||||
$table->dateTime('expires_at')->nullable();
|
$table->dateTime('expires_at')->nullable();
|
||||||
$table->string('remarks')->nullable();
|
$table->string('remarks')->nullable();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
Loading…
Reference in New Issue
Block a user