Skip to content

Commit

Permalink
PDF patient report fixes - author is Terry Hill.
Browse files Browse the repository at this point in the history
Signed-off-by: Arnab Naha <[email protected]>
  • Loading branch information
arnabnaha authored and bradymiller committed Nov 17, 2014
1 parent 4438e58 commit 831fa9b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
9 changes: 4 additions & 5 deletions interface/forms/LBF/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@
// This function is invoked from printPatientForms in report.inc
// when viewing a "comprehensive patient report". Also from
// interface/patient_file/encounter/forms.php.
//

function lbf_report($pid, $encounter, $cols, $id, $formname) {
require_once($GLOBALS["srcdir"] . "/options.inc.php");
echo "<table>\n";

$arr = array();
$fres = sqlStatement("SELECT field_id, field_value FROM lbf_data WHERE form_id = ?", array($id) );
while ($frow = sqlFetchArray($fres)) {
$arr[$frow['field_id']] = $frow['field_value'];
$arr[$frow['field_id']] = wordwrap($frow['field_value'], 30, "\n", true);
}
display_layout_rows($formname, $arr);

echo "</table>\n";
}
}
?>
4 changes: 2 additions & 2 deletions interface/patient_file/report/custom_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,8 @@ function next_prev(action){
}
// Setup Headers and Footers for html2PDF only Download
// in HTML view it's just one line at the top of page 1
echo '<page_header> ' . xlt("PATIENT") . ':' . text($titleres['lname']) . ', ' . text($titleres['fname']) . ' - ' . $titleres['DOB_TS'] . '</page_header> ';
echo '<page_footer>' . xlt('Generated on') . ' ' . oeFormatShortDate() . ' - ' . text($facility['name']) . ' ' . text($facility['phone']) . '</page_footer>';
echo '<page_header style="text-align:right;> ' . xlt("PATIENT") . ':' . text($titleres['lname']) . ', ' . text($titleres['fname']) . ' - ' . $titleres['DOB_TS'] . '</page_header> ';
echo '<page_footer style="text-align:right;>' . xlt('Generated on') . ' ' . oeFormatShortDate() . ' - ' . text($facility['name']) . ' ' . text($facility['phone']) . '</page_footer>';

// Use logo if it exists as 'practice_logo.gif' in the site dir
// old code used the global custom dir which is no longer a valid
Expand Down
4 changes: 2 additions & 2 deletions interface/themes/style_pdf.css
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ font-weight: bold;
width:100%;
}
#report_custom table {
width:100%;
width:80%;
}
#report_custom hr {
border: 2px dotted black;
Expand Down Expand Up @@ -589,7 +589,7 @@ font-weight: bold;
}
#report_custom .encounter_form {
margin: 10px;
padding: 10px;
padding: 0px;
border-top: 1px solid gray;
}
#report_custom img.bigimage {
Expand Down
4 changes: 2 additions & 2 deletions library/options.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ function generate_display_field($frow, $currvalue) {

// simple text field
else if ($data_type == 2) {
$s = htmlspecialchars($currvalue,ENT_NOQUOTES);
$s = nl2br(htmlspecialchars($currvalue,ENT_NOQUOTES));
}

// long or multi-line text field
Expand Down Expand Up @@ -1573,7 +1573,7 @@ function generate_display_field($frow, $currvalue) {
if ($count++) $s .= "<br />";

// Added 5-09 by BM - Translate label if applicable
$s .= htmlspecialchars(xl_list_label($lrow['title']),ENT_NOQUOTES);
$s .= nl2br(htmlspecialchars(xl_list_label($lrow['title'])),ENT_NOQUOTES);

}
}
Expand Down
2 changes: 1 addition & 1 deletion library/report.inc
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ function printPatientBilling($pid) {
echo "<span class=bold>" . oeFormatSDFT(strtotime($result{"date"})) . " : </span>";
echo "<span class=text>(".$result{"code_type"}.") ";
echo $result['code_type'] == 'COPAY' ? oeFormatMoney($result['code']) : $result['code'];
echo " - ". $result['code_text']."</span>";
echo " - ". wordwrap($result['code_text'], 70, "\n", true)."</span>";
echo "<br>\n";
}
}
Expand Down

0 comments on commit 831fa9b

Please sign in to comment.