Skip to content

Commit

Permalink
improvements for blank forms
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsetsystems committed Jul 17, 2009
1 parent c1ab4c4 commit e9523ab
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 40 deletions.
77 changes: 43 additions & 34 deletions interface/patient_file/printed_fee_sheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
require_once("$srcdir/patient.inc");
require_once("$srcdir/classes/Address.class.php");
require_once("$srcdir/classes/InsuranceCompany.class.php");


// This value is initially a maximum, and will be recomputed to
// distribute lines evenly among the pages.
$lines_per_page = 55;
$lines_in_stats = 16;

$lines_in_stats = 8;

// This tells us if patient/encounter data is to be filled in.
//
Expand Down Expand Up @@ -94,7 +97,7 @@

// Adjust lines per page to distribute lines evenly among the pages.
$pages = intval(($percol + $lines_in_stats + $lines_per_page - 1) / $lines_per_page);
$lines_per_page = intval($percol + $lines_in_stats + $pages - 1) / $pages;
$lines_per_page = intval(($percol + $lines_in_stats + $pages - 1) / $pages);

// Figure out page and column breaks.
$pages = 1;
Expand All @@ -112,6 +115,8 @@
array_splice($SBCODES, $lines*2 + $page_start_index, 0, '*C|');
array_splice($SBCODES, $lines*1 + $page_start_index, 0, '*C|');
}

$lheight = sprintf('%d', $page_height / $lines_per_page);
?>
<html>
<head>
Expand All @@ -137,7 +142,8 @@
border-width: 0 0 0 0;
border-color: #999999;
}
td.fsgroup {
td.fsgroup {
height: <?php echo $lheight; ?>pt;
font-family: sans-serif;
font-weight: bold;
font-size: <?php echo $fontsize ?>pt;
Expand All @@ -148,6 +154,7 @@
border-color: #999999;
}
td.fshead {
height: <?php echo $lheight; ?>pt;
font-family: sans-serif;
font-weight: bold;
font-size: <?php echo $fontsize ?>pt;
Expand All @@ -157,6 +164,7 @@
border-color: #999999;
}
td.fscode {
height: <?php echo $lheight; ?>pt;
font-family: sans-serif;
font-weight: normal;
font-size: <?php echo $fontsize ?>pt;
Expand Down Expand Up @@ -189,35 +197,35 @@ function genColumn($ix) {
return ++$ix;
}
if ($cmd == '*B') { // Borderless and empty
echo "<tr><td colspan='5' class='fscode' style='border-width:0 1px 0 0;padding-top:1px;' nowrap>&nbsp;</td></tr>\n";
echo " <tr><td colspan='5' class='fscode' style='border-width:0 1px 0 0;padding-top:1px;' nowrap>&nbsp;</td></tr>\n";
}
else if ($cmd == '*G') {
$title = htmlspecialchars($a[1]);
if (!$title) $title='&nbsp;';
echo "<tr><td colspan='5' align='center' class='fsgroup' style='vertical-align:middle' nowrap>$title</td></tr>\n";
echo " <tr><td colspan='5' align='center' class='fsgroup' style='vertical-align:middle' nowrap>$title</td></tr>\n";
}
else if ($cmd == '*H') {
$title = htmlspecialchars($a[1]);
if (!$title) $title='&nbsp;';
echo "<tr><td colspan='5' class='fshead' style='vertical-align:middle' nowrap>$title</td></tr>\n";
echo " <tr><td colspan='5' class='fshead' style='vertical-align:middle' nowrap>$title</td></tr>\n";
}
else {
$title = htmlspecialchars($a[1]);
if (!$title) $title='&nbsp;';
$b = explode(':', $cmd);
echo "<tr>";
echo "<td class='fscode' style='vertical-align:middle;width:14pt' nowrap>&nbsp;</td>\n";
echo " <tr>\n";
echo " <td class='fscode' style='vertical-align:middle;width:14pt' nowrap>&nbsp;</td>\n";
if (count($b) <= 1) {
$code = $b[0];
if (!$code) $code='&nbsp;';
echo "<td class='fscode' style='vertical-align:middle' nowrap>$code</td>\n";
echo "<td colspan='3' class='fscode' style='vertical-align:middle' nowrap>$title</td>\n";
echo " <td class='fscode' style='vertical-align:middle' nowrap>$code</td>\n";
echo " <td colspan='3' class='fscode' style='vertical-align:middle' nowrap>$title</td>\n";
}
else {
echo "<td colspan='2' class='fscode' style='vertical-align:middle' nowrap>" . $b[0] . '/' . $b[1] . "</td>\n";
echo "<td colspan='2' class='fscode' style='vertical-align:middle' nowrap>$title</td>\n";
echo " <td colspan='2' class='fscode' style='vertical-align:middle' nowrap>" . $b[0] . '/' . $b[1] . "</td>\n";
echo " <td colspan='2' class='fscode' style='vertical-align:middle' nowrap>$title</td>\n";
}
echo "</tr>\n";
echo " </tr>\n";
}
}
return $ix;
Expand Down Expand Up @@ -265,7 +273,7 @@ function printme() {
<table class='bordertbl' cellspacing='0' cellpadding='0' width='100%'>
<tr>
<td valign='top'>
<table border='0' cellspacing='0' cellpadding='0' width='100%' style='height:<?php echo $page_height ?>pt'>
<table border='0' cellspacing='0' cellpadding='0' width='100%'>
<tr>
<td class='toprow' style='width:10%'></td>
<td class='toprow' style='width:10%'></td>
Expand All @@ -279,7 +287,7 @@ function printme() {
<?php if ($pages == 0) { // if this is the last page ?>

<tr>
<td colspan='3' valign='top' class='fshead' style='height:50pt'>
<td colspan='3' valign='top' class='fshead' style='height:<?php echo $lheight * 2; ?>pt'>
Patient:<br />
<?php
if ($form_fill) {
Expand All @@ -295,7 +303,7 @@ function printme() {
</td>
</tr>
<tr>
<td colspan='3' valign='top' class='fshead' style='height:25pt'>
<td colspan='3' valign='top' class='fshead' style='height:<?php echo $lheight; ?>pt'>
Doctor:<br />
<?php
$encdata = false;
Expand Down Expand Up @@ -323,7 +331,7 @@ function printme() {
</td>
</tr>
<tr>
<td colspan='4' valign='top' class='fshead' style='height:25pt'>
<td colspan='4' valign='top' class='fshead' style='height:<?php echo $lheight; ?>pt'>
<?php
if (empty($GLOBALS['ippf_specific'])) {
echo "Insurance:\n";
Expand Down Expand Up @@ -361,22 +369,22 @@ function printme() {
</td>
</tr>
<tr>
<td colspan='4' valign='top' class='fshead' style='height:25pt'>
<td colspan='4' valign='top' class='fshead' style='height:<?php echo $lheight; ?>pt'>
Prior balance:<br />
</td>
</tr>
<tr>
<td colspan='4' valign='top' class='fshead' style='height:25pt'>
<td colspan='4' valign='top' class='fshead' style='height:<?php echo $lheight; ?>pt'>
Today's charges:<br />
</td>
</tr>
<tr>
<td colspan='4' valign='top' class='fshead' style='height:25pt'>
<td colspan='4' valign='top' class='fshead' style='height:<?php echo $lheight; ?>pt'>
Today's payment:<br />
</td>
</tr>
<tr>
<td colspan='4' valign='top' class='fshead' style='height:25pt'>
<td colspan='4' valign='top' class='fshead' style='height:<?php echo $lheight; ?>pt'>
Notes:<br />
</td>
</tr>
Expand All @@ -386,7 +394,7 @@ function printme() {
</table>
</td>
<td valign='top'>
<table border='0' cellspacing='0' cellpadding='0' width='100%' style='height:<?php echo $page_height ?>pt'>
<table border='0' cellspacing='0' cellpadding='0' width='100%'>
<tr>
<td class='toprow' style='width:10%'></td>
<td class='toprow' style='width:10%'></td>
Expand All @@ -400,12 +408,12 @@ function printme() {
<?php if ($pages == 0) { // if this is the last page ?>

<tr>
<td colspan='4' valign='top' class='fshead' style='height:100pt'>
<td colspan='4' valign='top' class='fshead' style='height:<?php echo $lheight * 4; ?>pt'>
Additional procedures:<br />
</td>
</tr>
<tr>
<td colspan='4' valign='top' class='fshead' style='height:100pt'>
<td colspan='4' valign='top' class='fshead' style='height:<?php echo $lheight * 4; ?>pt'>
Diagnosis:<br />
</td>
</tr>
Expand All @@ -415,7 +423,7 @@ function printme() {
</table>
</td>
<td valign='top'>
<table border='0' cellspacing='0' cellpadding='0' width='100%' style='height:<?php echo $page_height ?>pt'>
<table border='0' cellspacing='0' cellpadding='0' width='100%'>
<tr>
<td class='toprow' style='width:10%'></td>
<td class='toprow' style='width:10%'></td>
Expand All @@ -429,13 +437,13 @@ function printme() {
<?php if ($pages == 0) { // if this is the last page ?>

<tr>
<td valign='top' colspan='4' class='fshead' style='height:150pt;border-width:0 1px 0 0'>
<td valign='top' colspan='4' class='fshead' style='height:<?php echo $lheight * 6; ?>pt;border-width:0 1px 0 0'>
&nbsp;
</td>
</tr>
<tr>
<td valign='top' colspan='4' class='fshead' style='height:50pt'>
M.D. Signature:<br />
<td valign='top' colspan='4' class='fshead' style='height:<?php echo $lheight * 2; ?>pt'>
Signature:<br />
</td>
</tr>

Expand All @@ -446,9 +454,11 @@ function printme() {
</tr>

</table>

<?php } // end while ?>


<?php
if ($pages > 0) echo "<p style='page-break-after: always' />\n";
} // end while
?>
<div id='hideonprint'>
<p>
<input type='button' value='<?php xl('Print','e'); ?>' onclick='printme()' />
Expand All @@ -459,8 +469,7 @@ function printme() {
&nbsp;&nbsp;
<input type='submit' name='form_submit' value='Refresh' />
</div>

</form>
</center>
</body>
</html>
</html>
10 changes: 5 additions & 5 deletions interface/patient_file/summary/demographics_print.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<body bgcolor='#ffffff'>
<form>

<p class='mainhead'><?php xl('Demographics Form','e'); ?></p>
<p class='mainhead'><?php xl('Registration Form','e'); ?></p>

<?php

Expand Down Expand Up @@ -142,15 +142,15 @@ function end_group() {
// Handle starting of a new row.
if (($titlecols > 0 && $cell_count >= $CPR) || $cell_count == 0) {
end_row();
echo " <tr>";
echo " <tr style='height:30pt'>";
}

if ($item_count == 0 && $titlecols == 0) $titlecols = 1;

// Handle starting of a new label cell.
if ($titlecols > 0) {
end_cell();
echo "<td colspan='$titlecols'";
echo "<td colspan='$titlecols' width='10%'";
echo ($frow['uor'] == 2) ? " class='required'" : " class='bold'";
if ($cell_count == 2) echo " style='padding-left:10pt'";
echo ">";
Expand All @@ -167,8 +167,8 @@ function end_group() {
// Handle starting of a new data cell.
if ($datacols > 0) {
end_cell();
echo "<td colspan='$datacols'";
if ($cell_count > 0) echo " style='padding-left:5pt'";
echo "<td colspan='$datacols' width='40%' class='under'";
if ($cell_count > 0) echo " style='padding-left:5pt;'";
echo ">";
$cell_count += $datacols;
}
Expand Down
29 changes: 28 additions & 1 deletion library/options.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ function generate_print_field($frow, $currvalue) {
$empty_title = "Unassigned";
}


// generic single-selection list
if ($data_type == 1 || $data_type == 26) {
if (empty($fld_length)) {
Expand All @@ -478,20 +477,28 @@ function generate_print_field($frow, $currvalue) {
$tmp = xl_list_label($lrow['title']);
if (empty($tmp)) $tmp = "($currvalue)";
}
/*****************************************************************
echo "<input type='text'" .
" size='$fld_length'" .
" value='$tmp'" .
" class='under'" .
" />";
*****************************************************************/
if ($tmp === '') $tmp = '&nbsp;';
echo $tmp;
}

// simple text field
else if ($data_type == 2 || $data_type == 15) {
/*****************************************************************
echo "<input type='text'" .
" size='$fld_length'" .
" value='$currescaped'" .
" class='under'" .
" />";
*****************************************************************/
if ($currescaped === '') $currescaped = '&nbsp;';
echo $currescaped;
}

// long or multi-line text field
Expand All @@ -504,11 +511,15 @@ function generate_print_field($frow, $currvalue) {

// date
else if ($data_type == 4) {
/*****************************************************************
echo "<input type='text' size='10'" .
" value='$currescaped'" .
" title='$description'" .
" class='under'" .
" />";
*****************************************************************/
if ($currescaped === '') $currescaped = '&nbsp;';
echo $currescaped;
}

// provider list
Expand All @@ -520,11 +531,15 @@ function generate_print_field($frow, $currvalue) {
$tmp = ucwords($urow['fname'] . " " . $urow['lname']);
if (empty($tmp)) $tmp = "($currvalue)";
}
/*****************************************************************
echo "<input type='text'" .
" size='$fld_length'" .
" value='$tmp'" .
" class='under'" .
" />";
*****************************************************************/
if ($tmp === '') $tmp = '&nbsp;';
echo $tmp;
}

// pharmacy list
Expand All @@ -542,11 +557,15 @@ function generate_print_field($frow, $currvalue) {
}
if (empty($tmp)) $tmp = "($currvalue)";
}
/*****************************************************************
echo "<input type='text'" .
" size='$fld_length'" .
" value='$tmp'" .
" class='under'" .
" />";
*****************************************************************/
if ($tmp === '') $tmp = '&nbsp;';
echo $tmp;
}

// squads
Expand All @@ -563,11 +582,15 @@ function generate_print_field($frow, $currvalue) {
}
if (empty($tmp)) $tmp = "($currvalue)";
}
/*****************************************************************
echo "<input type='text'" .
" size='$fld_length'" .
" value='$tmp'" .
" class='under'" .
" />";
*****************************************************************/
if ($tmp === '') $tmp = '&nbsp;';
echo $tmp;
}

// Address book.
Expand All @@ -581,11 +604,15 @@ function generate_print_field($frow, $currvalue) {
$tmp = $uname;
if (empty($tmp)) $tmp = "($currvalue)";
}
/*****************************************************************
echo "<input type='text'" .
" size='$fld_length'" .
" value='$tmp'" .
" class='under'" .
" />";
*****************************************************************/
if ($tmp === '') $tmp = '&nbsp;';
echo $tmp;
}

// a set of labeled checkboxes
Expand Down

0 comments on commit e9523ab

Please sign in to comment.