more organization of autoloaded files (#424)
[openemr.git] / interface / patient_file / encounter / superbill_codes.php
blob5f908113f45d775167d5e8291b13123f628c56a8
1 <?php
2 include_once("../../globals.php");
3 include_once("../../../custom/code_types.inc.php");
4 include_once("$srcdir/billing.inc");
6 //the number of rows to display before resetting and starting a new column:
7 $N=10;
9 $mode = $_GET['mode'];
10 $type = $_GET['type'];
11 $modifier = $_GET['modifier'];
12 $units = $_GET['units'];
13 $fee = $_GET['fee'];
14 $code = $_GET['code'];
15 $text = $_GET['text'];
17 if (isset($mode)) {
18 if ($mode == "add") {
19 if (strtolower($type) == "copay") {
20 addBilling($encounter, $type, sprintf("%01.2f", $code), strip_escape_custom($text), $pid, $userauthorized,$_SESSION['authUserID'],$modifier,$units,sprintf("%01.2f", 0 - $code));
22 elseif (strtolower($type) == "other") {
23 addBilling($encounter, $type, $code, strip_escape_custom($text), $pid, $userauthorized,$_SESSION['authUserID'],$modifier,$units,sprintf("%01.2f", $fee));
25 else {
26 addBilling($encounter, $type, $code, strip_escape_custom($text), $pid, $userauthorized,$_SESSION['authUserID'],$modifier,$units,$fee);
31 <html>
32 <head>
33 <?php html_header_show();?>
34 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
35 </head>
36 <body class="body_bottom">
38 <table border=0 cellspacing=0 cellpadding=0 >
39 <tr>
40 <td valign=top>
42 <dl>
44 <dt>
46 <a href="superbill_custom_full.php" onclick="top.restoreSession()">
47 <span class=title><?php xl('Superbill','e'); ?></span>
48 <font class=more><?php echo $tmore;?></font></a>
50 <a href="encounter_bottom.php" onclick="top.restoreSession()">
52 <font class=more><?php echo $tback;?></font></a>
54 </dt>
55 </td></tr>
56 </table>
58 <table border=0 width=100% cellpadding=0 cellspacing=1>
59 <?php
60 $res = sqlStatement("select * from codes where superbill = 1 order by code_type, code, code_text");
62 $codes = array();
63 echo " <tr>\n";
64 foreach ($code_types as $key => $value) {
65 $codes[$key] = array();
66 echo " <th align='left'>$key Codes</th>\n";
68 echo " </tr>\n";
70 for ($iter = 0; $row = sqlFetchArray($res); $iter++){
71 foreach ($code_types as $key => $value) {
72 if ($value['id'] == $row['code_type']) {
73 $codes[$key][] = $row;
74 break;
79 $index=0;
81 $numlines = 0;
82 foreach ($codes as $value)
83 $numlines = max($numlines, count($value));
85 while ($index < $numlines) {
86 echo " <tr>\n";
87 foreach ($codes as $key => $value) {
88 echo " <td valign='top'>\n";
89 if(!empty($value[$index])) {
90 $code = $value[$index];
91 echo " <dd><a class='text' ";
92 echo "href='superbill_codes.php?back=1&mode=add" .
93 "&type=" . urlencode($key) .
94 "&modifier=" . urlencode($code{"modifier"}) .
95 "&units=" . urlencode($code{"units"}) .
96 "&fee=" . urlencode($code{"fee"}) .
97 "&code=" . urlencode($code{"code"}) .
98 "&text=" . urlencode($code{"code_text"}) .
99 "' onclick='top.restoreSession()'>";
100 echo "<b>" . $code['code'] . "</b>" . "&nbsp;" . $code['modifier'] . "&nbsp;" . $code['code_text'] ;
101 echo "</a></dd>\n";
103 echo " </td>\n";
105 echo " </tr>\n";
106 ++$index;
111 </table>
113 </dl>
115 </body>
116 </html>