wip
This commit is contained in:
parent
f5628a9d54
commit
3f0fbf8222
@ -149,7 +149,7 @@ public function getReportStatusLedAttribute(): string
|
|||||||
|
|
||||||
public function getArchiveLink(): ?string
|
public function getArchiveLink(): ?string
|
||||||
{
|
{
|
||||||
if (me_or_other()->may(Permission::StudyDownload)) {
|
if (me()->may(Permission::StudyDownload)) {
|
||||||
return PacsUrlGen::archive($this->study_instance_uid);
|
return PacsUrlGen::archive($this->study_instance_uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ public function getArchiveLink(): ?string
|
|||||||
|
|
||||||
public function getStoneLink(): ?string
|
public function getStoneLink(): ?string
|
||||||
{
|
{
|
||||||
if (me_or_other()->may(Permission::StudyDownload)) {
|
if (me()->may(Permission::StudyDownload)) {
|
||||||
return PacsUrlGen::stoneViewer($this->study_instance_uid);
|
return PacsUrlGen::stoneViewer($this->study_instance_uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ public function getStoneLink(): ?string
|
|||||||
|
|
||||||
public function getOhifLink(): ?string
|
public function getOhifLink(): ?string
|
||||||
{
|
{
|
||||||
if (me_or_other()->may(Permission::StudyDownload)) {
|
if (me()->may(Permission::StudyDownload)) {
|
||||||
return PacsUrlGen::ohifViewer($this->study_instance_uid);
|
return PacsUrlGen::ohifViewer($this->study_instance_uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ public function getOhifLink(): ?string
|
|||||||
|
|
||||||
public function getOhifSegmentationLink(): ?string
|
public function getOhifSegmentationLink(): ?string
|
||||||
{
|
{
|
||||||
if (me_or_other()->may(Permission::StudyDownload)) {
|
if (me()->may(Permission::StudyDownload)) {
|
||||||
return PacsUrlGen::ohifSegmentation($this->study_instance_uid);
|
return PacsUrlGen::ohifSegmentation($this->study_instance_uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ public function getOhifSegmentationLink(): ?string
|
|||||||
|
|
||||||
public function getOhifMprLink(): ?string
|
public function getOhifMprLink(): ?string
|
||||||
{
|
{
|
||||||
if (me_or_other()->may(Permission::StudyDownload)) {
|
if (me()->may(Permission::StudyDownload)) {
|
||||||
return PacsUrlGen::ohifViewerMpr($this->study_instance_uid);
|
return PacsUrlGen::ohifViewerMpr($this->study_instance_uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ public function lockStudy(User|int|null $user = null): void
|
|||||||
{
|
{
|
||||||
$this->update(
|
$this->update(
|
||||||
[
|
[
|
||||||
'locking_physician_id' => me_or_other($user)->id,
|
'locking_physician_id' => me($user)->id,
|
||||||
'locked_at' => now(),
|
'locked_at' => now(),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
@ -375,11 +375,11 @@ protected function casts(): array
|
|||||||
|
|
||||||
public function isLockedBy(User|int|null $user = null): bool
|
public function isLockedBy(User|int|null $user = null): bool
|
||||||
{
|
{
|
||||||
return $this->locking_physician_id === me_or_other($user)->id;
|
return $this->locking_physician_id === me($user)->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isAssignedTo(User|int|null $user = null): bool
|
public function isAssignedTo(User|int|null $user = null): bool
|
||||||
{
|
{
|
||||||
return $this->assigned_physician_id === me_or_other($user)->id;
|
return $this->assigned_physician_id === me($user)->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ public static function of(Study $study): self
|
|||||||
|
|
||||||
public function by(User|int|null $user): self
|
public function by(User|int|null $user): self
|
||||||
{
|
{
|
||||||
$this->user = me_or_other($user);
|
$this->user = me($user);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -112,8 +112,11 @@ function thumb_url(Media $media): string
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! function_exists('me_or_other')) {
|
if (! function_exists('me')) {
|
||||||
function me_or_other(User|int|null $user = null): User
|
/**
|
||||||
|
* Gets the user. If no user is provided, it will return the authenticated user.
|
||||||
|
*/
|
||||||
|
function me(User|int|null $user = null): User
|
||||||
{
|
{
|
||||||
if (is_int($user) && $user > 0) {
|
if (is_int($user) && $user > 0) {
|
||||||
return User::find($user);
|
return User::find($user);
|
||||||
|
Loading…
Reference in New Issue
Block a user