From dab7629dcd7c7a2905ce401a5e06609f916ac616 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Thu, 8 Oct 2026 12:47:50 +0530 Subject: [PATCH] fix(abdm): only query health_records with existing bundle payload in pushPendingHealthRecords --- app/Commands/AbdmPushSync.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Commands/AbdmPushSync.php b/app/Commands/AbdmPushSync.php index dfab06a..1627649 100644 --- a/app/Commands/AbdmPushSync.php +++ b/app/Commands/AbdmPushSync.php @@ -70,9 +70,17 @@ class AbdmPushSync extends BaseCommand } $rows = $db->table('health_records') - ->whereNotIn('push_status', ['pushed', 'linked', 'local_only']) + ->whereNotIn('push_status', ['pushed', 'linked', 'local_only', 'failed']) ->where('care_context_reference !=', '') ->where('abha_id !=', '') + ->groupStart() + ->where('record_data IS NOT NULL', null, false) + ->where('record_data !=', '') + ->orGroupStart() + ->where('fhir_bundle_enc IS NOT NULL', null, false) + ->where('fhir_bundle_enc !=', '') + ->groupEnd() + ->groupEnd() ->orderBy('id', 'ASC') ->get($limit) ->getResultArray();