fix(abdm): send hospital patient ref in nursing wellness push payload

This commit is contained in:
DevSoftTech Server 2026-10-07 15:25:00 +05:30
parent e992c3be37
commit 8fc443f1ba
2 changed files with 5 additions and 0 deletions

View File

@ -1111,6 +1111,8 @@ class NursingApi extends BaseController
$connector = \App\Libraries\Abdm\AbdmConnectorFactory::make();
$pushPayload = [
'patient_id' => (string) $patientId,
'patient_ref' => (string) ($patient['p_code'] ?? ('P' . $patientId)),
'local_patient_id' => (string) ($patient['p_code'] ?? ('P' . $patientId)),
'patient_name' => trim(($patient['p_fname'] ?? '') . ' ' . ($patient['p_lname'] ?? '')),
'abha_id' => (string) ($patient['abha_id'] ?? ''),
'abha_address' => (string) ($patient['abha_address'] ?? ''),

View File

@ -1492,9 +1492,12 @@ class EAtriaBridgeConnector implements AbdmConnectorInterface
if (! empty($bundle) && is_array($bundle)) {
// When a FHIR bundle is attached, push to /api/v3/records/push so the bridge
// validates the FHIR resources and holds the bundle for on-demand patient fetch.
$patientRef = trim((string) ($data['patient_ref'] ?? $data['patient_code'] ?? $data['local_patient_id'] ?? $data['patient_id'] ?? ''));
$recordPushPayload = [
'hfr_id' => $this->hfrId,
'patient_id' => (string) ($data['patient_id'] ?? ''),
'patient_ref' => $patientRef,
'local_patient_id' => $patientRef,
'patient_name' => $patientName,
'abha_address' => $effectiveAbha,
'care_context_reference' => $careContextReference,