43 lines
883 B
PHP
43 lines
883 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(Organization::class);
|
|
}
|
|
|
|
public function facility(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Department::class);
|
|
}
|
|
|
|
public function stoneViewerUrl(): Uri
|
|
{
|
|
return $this->restEndpoint($this->stone_viewer_path);
|
|
}
|
|
|
|
public function ohifViewerUrl(): Uri
|
|
{
|
|
return $this->restEndpoint($this->ohif_viewer_path);
|
|
}
|
|
|
|
public function wadoUrl(): Uri
|
|
{
|
|
return $this->restEndpoint($this->wado_path);
|
|
}
|
|
|
|
private function restEndpoint(string $path): Uri
|
|
{
|
|
return Uri::of($this->rest_api_endpoint)->withPath($path);
|
|
}
|
|
}
|