Formatting and printing a superbill

jason0 wrote on Friday, June 24, 2011:

Hi,

I am trying to fiddle with the relative sizes and format of the stock superbill in 4.0.  I am using firefox version 3.5.latest.

I tried using the print function of the popup and I can definitely say my page settings for firefox affect the outcome.  When I set my page settings to 75% scale and landscape mode, I almost get two pages at three columns per page.  but when I set the scale to 100% in portrait mode, boy does it get wonky. 

1) is the assumed page format of the superbill Letter sized in portrait mode?  Because it’s apparently supposed to print three columns, but on mine it can’t fit two on one sheet.
2) The page height shows as 700.  Is this in points?  Does html formatting somehow map to printer formatting?  If so, why is this number 700 when Letter size is 612 x 792? (8.5 inches by 11)
3) does anyone have advice as to what the print settings in the browser ought to be?

-jason

tmccormi wrote on Tuesday, June 28, 2011:

The superbill attempts to calculate the font size and formatting based on the content being read in from the services tables and service categories and a fee sheet options.   The page length and other settings are PICA I think (72 dot per inch) but not sure.  In anycase, if the textual descriptions are too long the code tries to ‘fit to page’ and fails to do that completely. resulting in bad formatting.   So, simple fix, arbitrarily truncate the code description to 30 chars.   If no one objects I will deliver this fix this week.

--- a/interface/patient_file/printed_fee_sheet.php
+++ b/interface/patient_file/printed_fee_sheet.php
@@ -75,7 +75,7 @@ if (empty($SBCODES)) {
       "WHERE superbill = '" . $prow['option_id'] . "' AND active = 1 " .
       "ORDER BY code_text");
     while ($row = sqlFetchArray($res)) {
-      $SBCODES[] = $row['code'] . '|' . $row['code_text'];
+      $SBCODES[] = $row['code'] . '|' . substr($row['code_text'],0,30);
     }
   }
 
@@ -89,7 +89,7 @@ if (empty($SBCODES)) {
       "ORDER BY d.name, dt.selector, dt.drug_id");
     while ($trow = sqlFetchArray($tres)) {
       $tmp = $trow['selector'];
-      if ($trow['name'] !== $trow['selector']) $tmp .= ' ' . $trow['name'];
+      if ($trow['name'] !== $trow['selector']) $tmp .= ' ' . substr($trow['name'],0,30);
       $prodcode = empty($trow['ndc_number']) ? ('(' . $trow['drug_id'] . ')') :
         $trow['ndc_number'];
       $SBCODES[] = "$prodcode|$tmp";