Skip to content

Commit

Permalink
add print button and put patient's details at top of visit history p…
Browse files Browse the repository at this point in the history
…age openemr#7270 (openemr#7359)

* add print button and put patient's details at top of visit history page

* add comment to say it fixes issue openemr#7270

* fix styling errors in PR

* fix styling errors in PR

* fix styling errors in PR

* Update encounters.php to handle attendant_type

attendant_type in this PR was not accounted for in the patient / dob display.

* Update encounters.php remove unused class reference

Removed unused class reference.

---------

Co-authored-by: Stephen Nielson <[email protected]>
  • Loading branch information
ruthkonyn and adunsulag authored Apr 22, 2024
1 parent e122860 commit 2500b2c
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions interface/patient_file/history/encounters.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/**
* Encounter list.
* rm: print button to print page & generate pdf; include patients name, id and dob on the page. issue #7270
*
*
* @package OpenEMR
* @link http://www.open-emr.org
Expand Down Expand Up @@ -180,6 +182,12 @@ function generatePageElement($start, $pagesize, $billing, $issue, $text)
<script src="<?php echo $GLOBALS['webroot'] ?>/library/js/ajtooltip.js"></script>

<script>

$(function () {
// print the history - as displayed
top.printLogSetup(document.getElementById('printbutton'));
});

// open dialog to edit an invoice w/o opening encounter.
function editInvoice(e, id) {
e.stopPropagation();
Expand Down Expand Up @@ -272,6 +280,8 @@ function changePageSize() {
<?php } else { ?>
<a href='encounters.php?billing=1&issue=<?php echo $issue . $getStringForPage; ?>' class="btn btn-small btn-info" onclick='top.restoreSession()' style='font-size: 11px'><?php echo xlt('To Billing View'); ?></a>
<?php } ?>
&nbsp; &nbsp;
<a href='#' id='printbutton' class='btn btn-secondary btn-print'> <?php echo xlt('Print page'); ?> </a>

<span class="float-right">
<?php echo xlt('Results per page'); ?>:
Expand All @@ -297,6 +307,17 @@ function changePageSize() {
</span>

<br />
<span class="heading" >
<?php
if ($attendant_type == 'pid') {
// RM put patienes name, id and dob at top of the history -->
$name = getPatientNameFirstLast($pid);
$dob = text(oeFormatShortDate(getPatientData($pid, "DOB")['DOB']));
$external_id = getPatientData($pid, "pubpid")['pubpid'];
echo $name . " (" . $external_id . ")" . "&nbsp; &nbsp; DOB: " . $dob ;
}
?>
</span>

<div class="table-responsive">
<table class="table table-hover jumbotron py-4 mt-3">
Expand Down Expand Up @@ -368,7 +389,7 @@ function changePageSize() {
$drow = sqlFetchArray($dres);
}

// $count = 0;
$numRes = 0;

$sqlBindArray = array();
if ($attendant_type == 'pid') {
Expand Down Expand Up @@ -401,7 +422,7 @@ function changePageSize() {

$countRes = sqlStatement($countQuery, $sqlBindArray);
$count = sqlFetchArray($countRes);
$numRes = $count['c'];
$numRes += $count['c'];


if ($pagesize > 0) {
Expand Down Expand Up @@ -460,7 +481,7 @@ function changePageSize() {

// This generates document lines as appropriate for the date order.
while ($drow && $raw_encounter_date && $drow['docdate'] > $raw_encounter_date) {
showDocument($drow);
showDocument($drow);
$drow = sqlFetchArray($dres);
}

Expand Down Expand Up @@ -813,7 +834,7 @@ function changePageSize() {
} // end while

// Dump remaining document lines if count not exceeded.
while ($drow /* && $count <= $N */) {
while ($drow) {
showDocument($drow);
$drow = sqlFetchArray($dres);
}
Expand Down

0 comments on commit 2500b2c

Please sign in to comment.