diff --git a/app/Models/OrthancHost.php b/app/Models/OrthancHost.php index c710624..b088392 100644 --- a/app/Models/OrthancHost.php +++ b/app/Models/OrthancHost.php @@ -2,4 +2,17 @@ namespace App\Models; -class OrthancHost extends BaseModel {} +use Illuminate\Database\Eloquent\Relations\BelongsTo; + +class OrthancHost extends BaseModel +{ + public function institute(): BelongsTo + { + return $this->belongsTo(Institute::class); + } + + public function facilty(): BelongsTo + { + return $this->belongsTo(Facility::class); + } +} diff --git a/app/Models/Study.php b/app/Models/Study.php index 58fd839..d12a2db 100644 --- a/app/Models/Study.php +++ b/app/Models/Study.php @@ -117,6 +117,11 @@ public function assignedPhysician(): BelongsTo return $this->belongsTo(User::class, 'assigned_physician_id'); } + public function orthancHost(): BelongsTo + { + return $this->belongsTo(OrthancHost::class); + } + public function isAssigned(int $rad_id): bool { return $this->assigned_physician_id === $rad_id;