Keep ABHA modals open when patient already linked

This commit is contained in:
DevSoftTech Server 2026-08-14 00:07:12 +05:30
parent 2103215077
commit be2c78914f
3 changed files with 18 additions and 0 deletions

View File

@ -255,6 +255,12 @@ window.AbhaMobileModal = (function () {
$('#abhaMobileCompareBtn').on('click', function () {
if (!verifiedProfile) return;
var profile = verifiedProfile;
// Already linked: nothing else opens, so keep this window up for the operator to close.
if (profile.need_confirmation === false && Number(profile.patient_id || 0) > 0) {
alertBox('success', 'This ABHA is already linked to HMS patient <strong>' + escapeHtml(profile.p_code || '') + '</strong>. The page behind has been updated. Close this window when you are done.');
if (typeof onVerified === 'function') onVerified(profile);
return;
}
$('#abhaMobileModal').one('hidden.bs.modal', function () {
if (typeof onVerified === 'function') onVerified(profile);
});

View File

@ -172,6 +172,12 @@ window.AbhaQrModal = (function () {
$('#abhaQrContinueBtn').on('click', function () {
if (!scannedProfile) return;
var profile = scannedProfile;
// Already linked: nothing else opens, so keep this window up for the operator to close.
if (profile.need_confirmation === false && Number(profile.patient_id || 0) > 0) {
alertBox('success', 'This ABHA is already linked to HMS patient <strong>' + escapeHtml(profile.p_code || '') + '</strong>. The page behind has been updated. Close this window when you are done.');
if (typeof onResolved === 'function') onResolved(profile);
return;
}
$('#abhaQrModal').one('hidden.bs.modal', function () {
if (typeof onResolved === 'function') onResolved(profile);
});

View File

@ -262,6 +262,12 @@ window.AbhaVerifyModal = (function () {
$('#abhaVerifyCompareBtn').on('click', function () {
if (!verifiedProfile) return;
var profile = verifiedProfile;
// Already linked: nothing else opens, so keep this window up for the operator to close.
if (profile.need_confirmation === false && Number(profile.patient_id || 0) > 0) {
alertBox('success', 'This ABHA is already linked to HMS patient <strong>' + escapeHtml(profile.p_code || '') + '</strong>. The page behind has been updated. Close this window when you are done.');
if (typeof onVerified === 'function') onVerified(profile);
return;
}
$('#abhaVerifyModal').one('hidden.bs.modal', function () {
if (typeof onVerified === 'function') onVerified(profile);
});