Keep ABHA modals open when patient already linked
This commit is contained in:
parent
2103215077
commit
be2c78914f
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user