<?php //display all of the notes for the day, as well as others that are active from previous dates, up to a certain number, $N $N = 15; // Get the billing note if there is one. $billing_note = ""; $colorbeg = ""; $colorend = ""; $sql = "select genericname2, genericval2 " . "from patient_data where pid = ? limit 1"; $resnote = sqlQuery($sql, array($patient_id)); if ($resnote && $resnote['genericname2'] == 'Billing') { $billing_note = $resnote['genericval2']; $colorbeg = "<span style='color:red'>"; $colorend = "</span>"; } //Display what the patient owes $balance = get_patient_balance($patient_id); if ($balance != "0") { $formatted = sprintf(xl('$') . '%01.2f', $balance); echo " <tr class='text billing'>\n"; echo " <td>" . $colorbeg . htmlspecialchars(xl('Balance Due'), ENT_NOQUOTES) . $colorend . "</td><td>" . $colorbeg . htmlspecialchars($formatted, ENT_NOQUOTES) . $colorend . "</td>\n"; echo " </tr>\n"; } if ($billing_note) { echo " <tr class='text billing'>\n"; echo " <td>" . $colorbeg . htmlspecialchars(xl('Billing Note'), ENT_NOQUOTES) . $colorend . "</td><td>" . $colorbeg . htmlspecialchars($billing_note, ENT_NOQUOTES) . $colorend . "</td>\n"; echo " </tr>\n"; } //retrieve all active notes $result = getPnotesByDate("", 1, "id,date,body,user,title,assigned_to", $patient_id, "all", 0, '', $docid, '', $orderid); if ($result != null) { $notes_count = 0;
$linkMethod = "javascript"; $bodyClass = "notab"; $widgetAuth = false; $fixedWidth = true; if ($GLOBALS['force_billing_widget_open']) { $forceExpandAlways = true; } else { $forceExpandAlways = false; } expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel, $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth, $forceExpandAlways); ?> <br> <?php if ($GLOBALS['oer_config']['ws_accounting']['enabled']) { // Show current balance and billing note, if any. echo "<div style='margin-left: 10px; margin-right: 10px'>" . "<span class='bold'><font color='#ee6600'>" . htmlspecialchars(xl('Balance Due'), ENT_NOQUOTES) . ": " . htmlspecialchars(oeFormatMoney(get_patient_balance($pid)), ENT_NOQUOTES) . "</font></span><br>"; if ($result['genericname2'] == 'Billing') { echo "<span class='bold'><font color='red'>" . htmlspecialchars(xl('Billing Note'), ENT_NOQUOTES) . ":" . htmlspecialchars($result['genericval2'], ENT_NOQUOTES) . "</font></span><br>"; } if ($result3['provider']) { // Use provider in case there is an ins record w/ unassigned insco echo "<span class='bold'>" . htmlspecialchars(xl('Primary Insurance'), ENT_NOQUOTES) . ': ' . htmlspecialchars($insco_name, ENT_NOQUOTES) . "</span> "; if ($result3['copay'] > 0) { echo "<span class='bold'>" . htmlspecialchars(xl('Copay'), ENT_NOQUOTES) . ': ' . htmlspecialchars($result3['copay'], ENT_NOQUOTES) . "</span> "; } echo "<span class='bold'>" . htmlspecialchars(xl('Effective Date'), ENT_NOQUOTES) . ': ' . htmlspecialchars(oeFormatShortDate($result3['effdate'], ENT_NOQUOTES)) . "</span>"; } echo "</div><br>"; } ?> </div>
$bodyClass = "notab"; $widgetAuth = false; $fixedWidth = true; if ($GLOBALS['force_billing_widget_open']) { $forceExpandAlways = true; } else { $forceExpandAlways = false; } expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel, $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth, $forceExpandAlways); ?> <br> <?php //PATIENT BALANCE,INS BALANCE naina@capminds.com $patientbalance = get_patient_balance($pid, false); //Debit the patient balance from insurance balance $insurancebalance = get_patient_balance($pid, true) - $patientbalance; $totalbalance = $patientbalance + $insurancebalance; if ($GLOBALS['oer_config']['ws_accounting']['enabled']) { // Show current balance and billing note, if any. echo "<table border='0'><tr><td>" . "<table ><tr><td><span class='bold'><font color='red'>" . xlt('Patient Balance Due') . " : " . text(oeFormatMoney($patientbalance)) . "</font></span></td></tr>" . "<tr><td><span class='bold'><font color='red'>" . xlt('Insurance Balance Due') . " : " . text(oeFormatMoney($insurancebalance)) . "</font></span></td></tr>" . "<tr><td><span class='bold'><font color='red'>" . xlt('Total Balance Due') . " : " . text(oeFormatMoney($totalbalance)) . "</font></span></td></td></tr>"; if ($result['genericname2'] == 'Billing') { echo "<tr><td><span class='bold'><font color='red'>" . xlt('Billing Note') . ":" . text($result['genericval2']) . "</font></span></td></tr>"; } if ($result3['provider']) { // Use provider in case there is an ins record w/ unassigned insco echo "<tr><td><span class='bold'>" . xlt('Primary Insurance') . ': ' . text($insco_name) . "</span> "; if ($result3['copay'] > 0) { echo "<span class='bold'>" . xlt('Copay') . ': ' . text($result3['copay']) . "</span> "; } echo "<span class='bold'>" . xlt('Effective Date') . ': ' . text(oeFormatShortDate($result3['effdate'])) . "</span></td></tr>"; }
if (!$thisauth) { echo "<p>(" . htmlspecialchars(xl('Demographics not authorized'), ENT_NOQUOTES) . ")</p>\n"; echo "</body>\n</html>\n"; exit; } if ($thisauth == 'write') { foreach (pic_array() as $var) { print $var; } echo "<td><span class='title'>" . htmlspecialchars(getPatientName($pid), ENT_NOQUOTES) . "</span> </td>"; if (acl_check('admin', 'super')) { echo "<td><a class='css_button iframe' href='../deleter.php?patient=" . htmlspecialchars($pid, ENT_QUOTES) . "'>" . "<span>" . htmlspecialchars(xl('Delete'), ENT_NOQUOTES) . "</span></a></td>"; } if ($GLOBALS['oer_config']['ws_accounting']['enabled']) { // Show current balance and billing note, if any. echo "<td> <span class='bold'><font color='#ee6600'>" . htmlspecialchars(xl('Balance Due'), ENT_NOQUOTES) . ": " . htmlspecialchars(oeFormatMoney(get_patient_balance($pid)), ENT_NOQUOTES) . "</font><br />"; if ($result['genericname2'] == 'Billing') { htmlspecialchars(xl('Billing Note'), ENT_NOQUOTES) . ":"; echo "<span class='bold'><font color='red'>" . htmlspecialchars($result['genericval2'], ENT_NOQUOTES) . "</font></span>"; } echo "</span></td>"; } } // Get the document ID of the patient ID card if access to it is wanted here. $document_id = 0; if ($GLOBALS['patient_id_category_name']) { $tmp = sqlQuery("SELECT d.id, d.date, d.url FROM " . "documents AS d, categories_to_documents AS cd, categories AS c " . "WHERE d.foreign_id = ? " . "AND cd.document_id = d.id " . "AND c.id = cd.category_id " . "AND c.name LIKE ? " . "ORDER BY d.date DESC LIMIT 1", array($pid, $GLOBALS['patient_id_category_name'])); if ($tmp) { $document_id = $tmp['id']; } }