From 4b087124b243faa98dfa2223317e21dea794b6c2 Mon Sep 17 00:00:00 2001 From: Dr Masroor Ehsan Date: Thu, 23 Jan 2025 14:52:34 +0600 Subject: [PATCH] minor --- app/Services/Pacs/Sync/Pipes/InsertStudies.php | 4 ++++ app/Services/Pacs/Sync/Pipes/UpdateStudies.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/Services/Pacs/Sync/Pipes/InsertStudies.php b/app/Services/Pacs/Sync/Pipes/InsertStudies.php index f52f2df..e9b6532 100644 --- a/app/Services/Pacs/Sync/Pipes/InsertStudies.php +++ b/app/Services/Pacs/Sync/Pipes/InsertStudies.php @@ -20,6 +20,10 @@ public function __invoke(StudiesSync $sync, Closure $next): StudiesSync } $payload = $sync->transformData($study); + if (empty($payload)) { + continue; + } + $row = Study::create($payload['study']); $payload['details']['study_id'] = $row->id; $payload['details']['orthanc_uuid'] = $orthanc_uuid; diff --git a/app/Services/Pacs/Sync/Pipes/UpdateStudies.php b/app/Services/Pacs/Sync/Pipes/UpdateStudies.php index 93e6f38..4145c6f 100644 --- a/app/Services/Pacs/Sync/Pipes/UpdateStudies.php +++ b/app/Services/Pacs/Sync/Pipes/UpdateStudies.php @@ -25,6 +25,10 @@ public function __invoke(StudiesSync $sync, Closure $next): StudiesSync } $payload = $sync->transformData($study); + if (empty($payload)) { + continue; + } + unset($payload['study']['orthanc_uuid']); $payload['study']['updated_at'] = now(); DB::table('studies')->where('id', $study_id)->update($payload['study']);