From 8a0396a2c8d35b2dfa90928af1eee980ddfa4eb6 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Sat, 17 Oct 2026 02:48:42 +0530 Subject: [PATCH] Fix record_data column in resync-discharge --- app/Commands/ResyncDischarge.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Commands/ResyncDischarge.php b/app/Commands/ResyncDischarge.php index 9a0c108..ed545b8 100644 --- a/app/Commands/ResyncDischarge.php +++ b/app/Commands/ResyncDischarge.php @@ -45,7 +45,8 @@ class ResyncDischarge extends BaseCommand if (! empty($row)) { CLI::write("Latest Record ID: " . $row['id'] . " | Ref: " . $row['care_context_reference'] . " | Updated: " . $row['updated_at'], 'green'); - $bundle = is_string($row['fhir_bundle']) ? json_decode($row['fhir_bundle'], true) : $row['fhir_bundle']; + $rawBundle = $row['record_data'] ?? $row['fhir_bundle'] ?? ''; + $bundle = is_string($rawBundle) ? json_decode($rawBundle, true) : $rawBundle; $entries = (array) ($bundle['entry'] ?? []); $typeCounts = [];