From 69e412dab3a712a0f94e583248163fac2ef48854 Mon Sep 17 00:00:00 2001 From: Josh Eckels Date: Mon, 16 Jun 2025 16:55:23 -0700 Subject: [PATCH] Avoid complaints about formularyMap when load fails (#969) --- ehr/resources/web/ehr/DataEntryUtils.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ehr/resources/web/ehr/DataEntryUtils.js b/ehr/resources/web/ehr/DataEntryUtils.js index b3219d0f7..846c6a1e7 100644 --- a/ehr/resources/web/ehr/DataEntryUtils.js +++ b/ehr/resources/web/ehr/DataEntryUtils.js @@ -734,8 +734,12 @@ EHR.DataEntryUtils = new function(){ autoLoad: true, listeners: { delay: 100, - load: function(store){ - store.getFormularyMap(); + load: function(store, records, successful) { + // Avoid logging complaints about an empty formulary when the browser navigates away mid-load + // The store gives the user feedback already for 500 or similar errors from the server + if (successful) { + store.getFormularyMap(); + } } }, getFormularyRecords: function(code){