38 lines
776 B
PHP
38 lines
776 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Traits\Active;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Support\Uri;
|
|
|
|
class DicomServer extends BaseModel
|
|
{
|
|
use Active;
|
|
|
|
public function institute(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Institute::class);
|
|
}
|
|
|
|
public function facility(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Facility::class);
|
|
}
|
|
|
|
public function stoneViewerUrl(): Uri
|
|
{
|
|
return $this->restEndpoint($this->stone_viewer_path);
|
|
}
|
|
|
|
public function ohifViewerUrl(): Uri
|
|
{
|
|
return $this->restEndpoint($this->ohif_viewer_path);
|
|
}
|
|
|
|
private function restEndpoint(string $path): Uri
|
|
{
|
|
return Uri::of($this->rest_api_endpoint)->withPath($path);
|
|
}
|
|
}
|