~brady-g-miller/openemr/master

« back to all changes in this revision

Viewing changes to interface/patient_file/summary/demographics.php

  • Committer: bradymiller
  • Author(s): Dinesh
  • Date: 2013-03-30 08:18:02 UTC
  • Revision ID: git-v1:fd45e7ff69566d0778db88e6e1a278c5ff85d920
Patient balance computation improvements on patient summary page.

 -Addressed code review suggestions.

Signed-off-by: Dinesh <dinesh@capminds.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 require_once("../history/history.inc.php");
23
23
 require_once("$srcdir/formatting.inc.php");
24
24
 require_once("$srcdir/edi.inc");
 
25
 require_once("$srcdir/invoice_summary.inc.php");
25
26
 require_once("$srcdir/clinical_rules.php");
26
27
 
27
28
  if ($GLOBALS['concurrent_layout'] && isset($_GET['set_pid'])) {
589
590
?>
590
591
        <br>
591
592
<?php
 
593
                //PATIENT BALANCE,INS BALANCE naina@capminds.com
 
594
                $patientbalance = get_patient_balance($pid, false);
 
595
                //Debit the patient balance from insurance balance
 
596
                $insurancebalance = get_patient_balance($pid, true) - $patientbalance;
 
597
           $totalbalance=$patientbalance + $insurancebalance;
592
598
 if ($GLOBALS['oer_config']['ws_accounting']['enabled']) {
593
599
 // Show current balance and billing note, if any.
594
 
  echo "        <div style='margin-left: 10px; margin-right: 10px'>" .
595
 
   "<span class='bold'><font color='#ee6600'>" .
596
 
   htmlspecialchars(xl('Balance Due'),ENT_NOQUOTES) .
597
 
   ": " . htmlspecialchars(oeFormatMoney(get_patient_balance($pid)),ENT_NOQUOTES) .
598
 
   "</font></span><br>";
 
600
  echo "<table border='0'><tr><td>" .
 
601
  "<table ><tr><td><span class='bold'><font color='red' size='3pt'>" .
 
602
   xlt('Patient Balance Due') .
 
603
   " : " . text(oeFormatMoney($patientbalance)) .
 
604
   "</font></span></td></tr>".
 
605
     "<tr><td><span class='bold'><font color='red' size='3pt'>" .
 
606
   xlt('Insurance Balance Due') .
 
607
   " : " . text(oeFormatMoney($insurancebalance)) .
 
608
   "</font></span></td></tr>".
 
609
   "<tr><td><span class='bold'><font color='red' size='3pt'>" .
 
610
   xlt('Total Balance Due').
 
611
   " : " . text(oeFormatMoney($totalbalance)) .
 
612
   "</font></span></td></td></tr>";
599
613
  if ($result['genericname2'] == 'Billing') {
600
 
   echo "<span class='bold'><font color='red'>" .
601
 
    htmlspecialchars(xl('Billing Note'),ENT_NOQUOTES) . ":" .
602
 
    htmlspecialchars($result['genericval2'],ENT_NOQUOTES) .
603
 
    "</font></span><br>";
 
614
   echo "<tr><td><span class='bold'><font color='red'>" .
 
615
    xlt('Billing Note') . ":" .
 
616
    text($result['genericval2']) .
 
617
    "</font></span></td></tr>";
604
618
  } 
605
619
  if ($result3['provider']) {   // Use provider in case there is an ins record w/ unassigned insco
606
 
   echo "<span class='bold'>" .
607
 
    htmlspecialchars(xl('Primary Insurance'),ENT_NOQUOTES) . ': ' . htmlspecialchars($insco_name,ENT_NOQUOTES) .
 
620
   echo "<tr><td><span class='bold'>" .
 
621
    xlt('Primary Insurance') . ': ' . text($insco_name) .
608
622
    "</span>&nbsp;&nbsp;&nbsp;";
609
623
   if ($result3['copay'] > 0) {
610
624
    echo "<span class='bold'>" .
611
 
     htmlspecialchars(xl('Copay'),ENT_NOQUOTES) . ': ' .  htmlspecialchars($result3['copay'],ENT_NOQUOTES) .
 
625
    xlt('Copay') . ': ' .  text($result3['copay']) .
612
626
     "</span>&nbsp;&nbsp;&nbsp;";
613
627
   }
614
628
   echo "<span class='bold'>" .
615
 
    htmlspecialchars(xl('Effective Date'),ENT_NOQUOTES) . ': ' .  htmlspecialchars(oeFormatShortDate($result3['effdate'],ENT_NOQUOTES)) .
616
 
    "</span>";
 
629
    xlt('Effective Date') . ': ' .  text(oeFormatShortDate($result3['effdate'])) .
 
630
    "</span></td></tr>";
617
631
  }
618
 
  echo "</div><br>";
 
632
  echo "</table></td></tr></td></tr></table><br>";
619
633
 }
620
634
?>
621
635
        </div> <!-- required for expand_collapse_widget -->