locking
This commit is contained in:
parent
fb2d962023
commit
c771981c97
@ -288,6 +288,30 @@ public function registerMediaConversions(?Media $media = null): void
|
||||
->nonQueued();
|
||||
}
|
||||
|
||||
public function isLocked(): bool
|
||||
{
|
||||
return $this->locked_at !== null;
|
||||
}
|
||||
|
||||
public function lockStudy(?User $user = null): void
|
||||
{
|
||||
$this->update(
|
||||
[
|
||||
'locking_physician_id' => $user?->id ?? auth()->id(),
|
||||
'locked_at' => now(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function unlockStudy(): void
|
||||
{
|
||||
$this->update(
|
||||
[
|
||||
'locked_at' => null,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function registerMediaCollections(): void
|
||||
{
|
||||
$this->addMediaCollection(self::MEDIA_COLLECTION)
|
||||
@ -318,7 +342,6 @@ public function getGenderNameAttribute(): string
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'is_locked' => 'boolean',
|
||||
'is_archived' => 'boolean',
|
||||
'study_status' => StudyLevelStatus::class,
|
||||
'report_status' => ReportStatus::class,
|
||||
|
Loading…
Reference in New Issue
Block a user