migrated ubiquitous libraries to composer autoloader (#421)
[openemr.git] / interface / patient_file / encounter / diagnosis_full.php
blob53c0a22e4e1af2f4af14628d9f5e330a9cd1f2d7
1 <?php
2 require_once("../../globals.php");
3 require_once("$srcdir/billing.inc");
5 if (isset($mode)) {
6 if ($mode == "add") {
7 addBilling($encounter, $type, $code, strip_escape_custom($text),$pid, $userauthorized,$_SESSION['authUserID']);
9 elseif ($mode == "delete") {
10 deleteBilling($id);
12 elseif ($mode == "clear") {
13 clearBilling($id);
17 <html>
18 <head>
19 <?php html_header_show();?>
20 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
21 </head>
23 <body class="body_top">
25 <a href="encounter_bottom.php" onclick="top.restoreSession()">
27 <span class=title><?php xl('Billing','e'); ?></span>
28 <font class=more><?php echo $tback;?></font></a>
30 <table border=0 cellpadding=3 cellspacing=0>
32 <?php
33 if ($result = getBillingByEncounter($pid,$encounter,"*") ) {
34 $billing_html = array();
35 foreach ($result as $iter) {
36 if ($iter["code_type"] == "ICD9") {
37 $html = "<tr>";
38 $html .= "<td valign=\"middle\"></td>" .
39 "<td><div><a class='small' href='diagnosis_full.php' onclick='top.restoreSession()'><b>" .
40 $iter{"code"} . "</b> " . ucwords(strtolower($iter{"code_text"})) .
41 "</a></div></td>\n";
42 $billing_html[$iter["code_type"]] .= $html;
43 $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";
51 else {
52 $billing_html[$iter["code_type"]] .= "<tr><td></td>" .
53 "<td><a class='small' href='diagnosis_full.php' onclick='top.restoreSession()'><b>" .
54 $iter{"code"} . "</b> " . ucwords(strtolower($iter{"code_text"})) .
55 "</a><span class=\"small\">";
56 $js = explode(":",$iter['justify']);
57 $counter = 0;
58 foreach ($js as $j) {
59 if(!empty($j)) {
60 if ($counter == 0) {
61 $billing_html[$iter["code_type"]] .= " (<b>$j</b>)";
63 else {
64 $billing_html[$iter["code_type"]] .= " ($j)";
66 $counter++;
70 $billing_html[$iter["code_type"]] .= "</span></td>";
71 $billing_html[$iter["code_type"]] .= "<td>" .
72 "<a class=\"link_submit\" href='diagnosis_full.php?mode=clear&id=" .
73 $iter{"id"} . "' class='link' onclick='top.restoreSession()'>[" . xl('Clear Justification') .
74 "]</a></td>";
77 $billing_html[$iter["code_type"]] .= "<td>" .
78 "<a class=\"link_submit\" href='diagnosis_full.php?mode=delete&id=" .
79 $iter{"id"} . "' class='link' onclick='top.restoreSession()'>[Delete]</a></td>";
80 $billing_html[$iter["code_type"]] .= "</tr>\n";
83 foreach ($billing_html as $key => $val) {
84 print "<tr><td>$key</td><td><table>$val</table><td></tr><tr><td height=\"5\"></td></tr>\n";
89 </table>
91 </body>
92 </html>