From 2313d41445e4f92a64a70bc0e210afd73034786e Mon Sep 17 00:00:00 2001 From: Manoj Lakshan <48247516+ManojLL@users.noreply.github.com> Date: Mon, 15 Jul 2024 00:37:31 +0530 Subject: [PATCH] FLAG-67: fixed flag rendering on platform lower versions (#82) FLAG-67: fixed flag rendering on platform lower versions FLAG-67: change code styles --- .../main/webapp/fragments/patientflagsDashboard.gsp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/omod/src/main/webapp/fragments/patientflagsDashboard.gsp b/omod/src/main/webapp/fragments/patientflagsDashboard.gsp index 3f59abe8..b03614e1 100644 --- a/omod/src/main/webapp/fragments/patientflagsDashboard.gsp +++ b/omod/src/main/webapp/fragments/patientflagsDashboard.gsp @@ -13,9 +13,18 @@ patientId: ${patientId} }, function (response) { if (!response) { - ${ ui.message("coreapps.none ") } + ${ ui.message("coreapps.none ") }; } else { - jq("#flags").html(response.patientflags); + try { + if (typeof response === "string") { + jq("#flags").html(response.replace("{patientflags=", "").replace("}", "")); + } else { + jq("#flags").html(response.patientflags); + } + } catch (error) { + console.error("Error processing flags response: ", error); + jq("#flags").html("Error processing response"); + } } });