M2 local mode: treat consent-missing as pending info log

This commit is contained in:
DevSoftTech Server 2026-06-26 23:54:31 +05:30
parent 617cecdcbf
commit ea3d88ce46

View File

@ -1027,15 +1027,24 @@ class AbdmGateway extends BaseController
$hasAbha = $abhaId !== '' || $abhaAddressPost !== ''; $hasAbha = $abhaId !== '' || $abhaAddressPost !== '';
$consent = null; $consent = null;
$consentWarning = ''; $consentWarning = '';
$consentEventType = 'abdm.opd.prescription.share.consent_missing';
$consentLogStatus = 'warning';
if ($hasAbha) { if ($hasAbha) {
$consent = $this->getActiveConsentRecord($patientId, $abhaId !== '' ? $abhaId : $abhaAddressPost, $consentHandle); $consent = $this->getActiveConsentRecord($patientId, $abhaId !== '' ? $abhaId : $abhaAddressPost, $consentHandle);
if ($consent === null) { if ($consent === null) {
$consentWarning = 'No active consent found. Proceeding with care-context push only.'; if ($pushToGateway) {
$consentWarning = 'No active consent found. Proceeding with care-context push only.';
} else {
$consentWarning = 'No active consent found now; this is expected in M2 local mode until ABDM consent callback arrives.';
$consentEventType = 'abdm.opd.prescription.share.consent_pending';
$consentLogStatus = 'success';
}
$logBridge( $logBridge(
'warning', $consentLogStatus,
['ok' => 1, 'warning' => $consentWarning], ['ok' => 1, 'warning' => $consentWarning],
$consentWarning, $consentWarning,
'abdm.opd.prescription.share.consent_missing' $consentEventType
); );
} }
} }