forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
diagnosis_full.php
99 lines (87 loc) · 2.99 KB
/
diagnosis_full.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
require_once("../../globals.php");
require_once("$srcdir/billing.inc");
require_once("$srcdir/formdata.inc.php");
$targparm = $GLOBALS['concurrent_layout'] ? "" : "target='Main'";
if (isset($mode)) {
if ($mode == "add") {
addBilling($encounter, $type, $code, strip_escape_custom($text),$pid, $userauthorized,$_SESSION['authUserID']);
}
elseif ($mode == "delete") {
deleteBilling($id);
}
elseif ($mode == "clear") {
clearBilling($id);
}
}
?>
<html>
<head>
<?php html_header_show();?>
<link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
</head>
<body class="body_top">
<?php if ($GLOBALS['concurrent_layout']) { ?>
<a href="encounter_bottom.php" onclick="top.restoreSession()">
<?php } else { ?>
<a href="patient_encounter.php" target="Main" onclick="top.restoreSession()">
<?php } ?>
<span class=title><?php xl('Billing','e'); ?></span>
<font class=more><?php echo $tback;?></font></a>
<table border=0 cellpadding=3 cellspacing=0>
<?php
if ($result = getBillingByEncounter($pid,$encounter,"*") ) {
$billing_html = array();
foreach ($result as $iter) {
if ($iter["code_type"] == "ICD9") {
$html = "<tr>";
$html .= "<td valign=\"middle\"></td>" .
"<td><div><a $targparm class='small' href='diagnosis_full.php' onclick='top.restoreSession()'><b>" .
$iter{"code"} . "</b> " . ucwords(strtolower($iter{"code_text"})) .
"</a></div></td>\n";
$billing_html[$iter["code_type"]] .= $html;
$counter++;
}
elseif ($iter["code_type"] == "COPAY") {
$billing_html[$iter["code_type"]] .= "<tr><td></td>" .
"<td><a $targparm class='small' href='diagnosis_full.php' onclick='top.restoreSession()'><b>" .
$iter{"code"}."</b> " . ucwords(strtolower($iter{"code_text"})) .
"</a></td>\n";
}
else {
$billing_html[$iter["code_type"]] .= "<tr><td></td>" .
"<td><a $targparm class='small' href='diagnosis_full.php' onclick='top.restoreSession()'><b>" .
$iter{"code"} . "</b> " . ucwords(strtolower($iter{"code_text"})) .
"</a><span class=\"small\">";
$js = explode(":",$iter['justify']);
$counter = 0;
foreach ($js as $j) {
if(!empty($j)) {
if ($counter == 0) {
$billing_html[$iter["code_type"]] .= " (<b>$j</b>)";
}
else {
$billing_html[$iter["code_type"]] .= " ($j)";
}
$counter++;
}
}
$billing_html[$iter["code_type"]] .= "</span></td>";
$billing_html[$iter["code_type"]] .= "<td>" .
"<a class=\"link_submit\" href='diagnosis_full.php?mode=clear&id=" .
$iter{"id"} . "' class='link' onclick='top.restoreSession()'>[" . xl('Clear Justification') .
"]</a></td>";
}
$billing_html[$iter["code_type"]] .= "<td>" .
"<a class=\"link_submit\" href='diagnosis_full.php?mode=delete&id=" .
$iter{"id"} . "' class='link' onclick='top.restoreSession()'>[Delete]</a></td>";
$billing_html[$iter["code_type"]] .= "</tr>\n";
}
foreach ($billing_html as $key => $val) {
print "<tr><td>$key</td><td><table>$val</table><td></tr><tr><td height=\"5\"></td></tr>\n";
}
}
?>
</table>
</body>
</html>