-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add print button and put patient's details at top of visit history page #7270 #7359
Changes from all commits
3f25984
7115e95
5f969a0
b353d0e
02eaac5
f4a9197
ad9d215
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:https://www.open-emr.org | ||
|
@@ -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(); | ||
|
@@ -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 } ?> | ||
| ||
<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'); ?>: | ||
|
@@ -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 . ")" . " DOB: " . $dob ; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need escaping:
|
||
} | ||
?> | ||
</span> | ||
|
||
<div class="table-responsive"> | ||
<table class="table table-hover jumbotron py-4 mt-3"> | ||
|
@@ -368,7 +389,7 @@ function changePageSize() { | |
$drow = sqlFetchArray($dres); | ||
} | ||
|
||
// $count = 0; | ||
$numRes = 0; | ||
|
||
$sqlBindArray = array(); | ||
if ($attendant_type == 'pid') { | ||
|
@@ -401,7 +422,7 @@ function changePageSize() { | |
|
||
$countRes = sqlStatement($countQuery, $sqlBindArray); | ||
$count = sqlFetchArray($countRes); | ||
$numRes = $count['c']; | ||
$numRes += $count['c']; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this didn't actually change the code logic, was thinking it did, but on further examination it keeps the code the same. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh yes, apologies: - i've been working on this code to sort out the problems where the documents are displayed on every page, issue #7275, and this new line has crept in from that work. It's not needed simply to add the print functionality. I'll fix the new PR |
||
|
||
|
||
if ($pagesize > 0) { | ||
|
@@ -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); | ||
} | ||
|
||
|
@@ -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); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks if the attendant_type is not a patient (IE therapy group encounters are being viewed. We need to surround all of this: