Fix for bug reported in 'Charges panel not allowing me to delete items'
[openemr.git] / interface / patient_file / encounter / diagnosis_full.php
blobc8b29aa4f8c40ce5b9e36b9bddab0153a52565eb
1 <?php
2 require_once("../../globals.php");
3 require_once("$srcdir/billing.inc");
5 $mode = $_GET['mode'];
6 $id = $_GET['id'];
8 if (isset($mode)) {
9 if ($mode == "add") {
10 addBilling($encounter, $type, $code, strip_escape_custom($text), $pid, $userauthorized, $_SESSION['authUserID']);
11 } elseif ($mode == "delete") {
12 deleteBilling($id);
13 } elseif ($mode == "clear") {
14 clearBilling($id);
18 <html>
19 <head>
20 <?php html_header_show();?>
21 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
22 </head>
24 <body class="body_top">
26 <a href="encounter_bottom.php" onclick="top.restoreSession()">
28 <span class=title><?php xl('Billing', 'e'); ?></span>
29 <font class=more><?php echo $tback;?></font></a>
31 <table border=0 cellpadding=3 cellspacing=0>
33 <?php
34 if ($result = getBillingByEncounter($pid, $encounter, "*")) {
35 $billing_html = array();
36 foreach ($result as $iter) {
37 if ($iter["code_type"] == "ICD9") {
38 $html = "<tr>";
39 $html .= "<td valign=\"middle\"></td>" .
40 "<td><div><a class='small' href='diagnosis_full.php' onclick='top.restoreSession()'><b>" .
41 $iter{"code"} . "</b> " . ucwords(strtolower($iter{"code_text"})) .
42 "</a></div></td>\n";
43 $billing_html[$iter["code_type"]] .= $html;
44 $counter++;
45 } elseif ($iter["code_type"] == "COPAY") {
46 $billing_html[$iter["code_type"]] .= "<tr><td></td>" .
47 "<td><a class='small' href='diagnosis_full.php' onclick='top.restoreSession()'><b>" .
48 $iter{"code"}."</b> " . ucwords(strtolower($iter{"code_text"})) .
49 "</a></td>\n";
50 } else {
51 $billing_html[$iter["code_type"]] .= "<tr><td></td>" .
52 "<td><a class='small' href='diagnosis_full.php' onclick='top.restoreSession()'><b>" .
53 $iter{"code"} . "</b> " . ucwords(strtolower($iter{"code_text"})) .
54 "</a><span class=\"small\">";
55 $js = explode(":", $iter['justify']);
56 $counter = 0;
57 foreach ($js as $j) {
58 if (!empty($j)) {
59 if ($counter == 0) {
60 $billing_html[$iter["code_type"]] .= " (<b>$j</b>)";
61 } else {
62 $billing_html[$iter["code_type"]] .= " ($j)";
65 $counter++;
69 $billing_html[$iter["code_type"]] .= "</span></td>";
70 $billing_html[$iter["code_type"]] .= "<td>" .
71 "<a class=\"link_submit\" href='diagnosis_full.php?mode=clear&id=" .
72 $iter{"id"} . "' class='link' onclick='top.restoreSession()'>[" . xl('Clear Justification') .
73 "]</a></td>";
76 $billing_html[$iter["code_type"]] .= "<td>" .
77 "<a class=\"link_submit\" href='diagnosis_full.php?mode=delete&id=" .
78 $iter{"id"} . "' class='link' onclick='top.restoreSession()'>[Delete]</a></td>";
79 $billing_html[$iter["code_type"]] .= "</tr>\n";
82 foreach ($billing_html as $key => $val) {
83 print "<tr><td>$key</td><td><table>$val</table><td></tr><tr><td height=\"5\"></td></tr>\n";
88 </table>
90 </body>
91 </html>