From 04dbf43e344c2a558752c823662f118d66b4c1f9 Mon Sep 17 00:00:00 2001 From: Sherwin Gaddis Date: Fri, 2 Dec 2022 14:34:01 -0500 Subject: [PATCH] Add EVENT_RENDER_POST_PAGELOAD hook to Demographics page (#5987) Use EVENT_RENDER_POST_PAGELOAD to inject content at the end of the HTML document. --- interface/patient_file/summary/demographics.php | 4 +++- src/Events/PatientDemographics/RenderEvent.php | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/interface/patient_file/summary/demographics.php b/interface/patient_file/summary/demographics.php index b6433fd1e..82c63d17d 100644 --- a/interface/patient_file/summary/demographics.php +++ b/interface/patient_file/summary/demographics.php @@ -1844,6 +1844,8 @@ $oemr_ui = new OemrUI($arrOeUiSettings); ]; checkSkipConditions(); + + var isPost = ; var listId = '#' + ; $(function() { @@ -1855,5 +1857,5 @@ $oemr_ui = new OemrUI($arrOeUiSettings); }); - +dispatch(new RenderEvent($pid), RenderEvent::EVENT_RENDER_POST_PAGELOAD, 10); ?> diff --git a/src/Events/PatientDemographics/RenderEvent.php b/src/Events/PatientDemographics/RenderEvent.php index ceb687cb4..996d788c6 100644 --- a/src/Events/PatientDemographics/RenderEvent.php +++ b/src/Events/PatientDemographics/RenderEvent.php @@ -36,6 +36,13 @@ class RenderEvent extends Event const EVENT_SECTION_LIST_RENDER_AFTER = 'patientDemographics.render.section.after'; /** + * This event occurs after a patient demographics page has been rendered + * It allows event listeners to render additional functionality after the page + * has loaded. + */ + const EVENT_RENDER_POST_PAGELOAD = 'patientDemographics.render.post_page_load'; + + /** * @var null|integer * * Represents the patient we are viewing in the patient demographics -- 2.11.4.GIT