log viewing

This commit is contained in:
Dr Masroor Ehsan 2025-01-21 21:24:37 +06:00
parent b2c6a618fa
commit 04dc9239f1
3 changed files with 13 additions and 1 deletions

View File

@ -82,7 +82,7 @@ public function view(string $uuid)
ReportManager::ensureDownloadAccess();
$manager = ReportManager::fromReport($uuid);
$title = 'Report Quick View ' . $manager->getStudy()->getPatientDemographic();
$report = $manager->getReport();
$report = $manager->getReportForViewing();
$copy_button = false;
if ($report->isFinalized()) {
$stamper = new StampService($report->read_by_id);

View File

@ -36,6 +36,8 @@ enum Activity: int
case Report_Delete = 202;
case Report_Finalize = 203;
case Report_View = 204;
case Report_Download = 205;
case User_Login = 301;

View File

@ -138,4 +138,14 @@ public function getReport(): ?StudyReport
{
return $this->report;
}
public function getReportForViewing(): ?StudyReport
{
audit()
->on($this->study)
->did(Activity::Report_View)
->log();
return $this->report;
}
}