Skip to content

Commit

Permalink
Add EVENT_RENDER_POST_PAGELOAD hook to Demographics page (openemr#5987)
Browse files Browse the repository at this point in the history
Use EVENT_RENDER_POST_PAGELOAD to inject content at the end of the HTML document.
  • Loading branch information
juggernautsei committed Dec 2, 2022
1 parent e6220ed commit 04dbf43
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion interface/patient_file/summary/demographics.php
Original file line number Diff line number Diff line change
Expand Up @@ -1844,6 +1844,8 @@ function setMyPatient() {
];
checkSkipConditions();



var isPost = <?php echo js_escape($showEligibility ?? false); ?>;
var listId = '#' + <?php echo js_escape($list_id); ?>;
$(function() {
Expand All @@ -1855,5 +1857,5 @@ function setMyPatient() {
});
</script>
</body>

<?php $ed->dispatch(new RenderEvent($pid), RenderEvent::EVENT_RENDER_POST_PAGELOAD, 10); ?>
</html>
7 changes: 7 additions & 0 deletions src/Events/PatientDemographics/RenderEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,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
*
Expand Down

0 comments on commit 04dbf43

Please sign in to comment.