3 $fake_register_globals=false;
4 $sanitize_all_escapes=true;
6 include_once("../globals.php");
8 include_once("$srcdir/patient.inc");
9 include_once("$srcdir/../interface/reports/report.inc.php");
10 include_once("$srcdir/billrep.inc");
11 include_once("$srcdir/forms.inc");
12 include_once("$srcdir/billing.inc");
13 include_once("$srcdir/pnotes.inc");
14 include_once("$srcdir/report.inc");
16 //how many columns to use when displaying information
21 if (!isset($_GET["mode"])) {
22 if (!isset($_GET["from_date"])) {
23 $from_date=date("Y-m-d");
25 $from_date = $_GET["from_date"];
27 if (!isset($_GET["to_date"])) {
28 $to_date = date("Y-m-d");
30 $to_date = $_GET["to_date"];
32 if (!isset($_GET["code_type"])) {
35 $code_type = $_GET["code_type"];
37 if (!isset($_GET["unbilled"])) {
40 $unbilled = $_GET["unbilled"];
42 if (!isset($_GET["authorized"])) {
43 $my_authorized = "on";
45 $my_authorized = $_GET["authorized"];
48 $from_date = $_GET["from_date"];
49 $to_date = $_GET["to_date"];
50 $code_type = $_GET["code_type"];
51 $unbilled = $_GET["unbilled"];
52 $my_authorized = $_GET["authorized"];
61 <?php
html_header_show();?
>
64 <link rel
=stylesheet href
="<?php echo $css_header;?>" type
="text/css">
67 <body bgcolor
="#ffffff" topmargin
=0 rightmargin
=0 leftmargin
=2 bottommargin
=0 marginwidth
=2 marginheight
=0>
70 <a href
="javascript:window.close();" target
=Main
><font
class=title
><?php
echo xlt('Billing Report')?
></font
></a
>
76 if ($my_authorized == "on" ) {
81 if ($unbilled == "on") {
86 if ($code_type == "all") {
90 $list = getBillsListBetween($code_type);
96 if (!isset($_GET["mode"])) {
97 if (!isset($_GET["from_date"])) {
98 $from_date=date("Y-m-d");
100 $from_date = $_GET["from_date"];
102 if (!isset($_GET["to_date"])) {
103 $to_date = date("Y-m-d");
105 $to_date = $_GET["to_date"];
107 if (!isset($_GET["code_type"])) {
110 $code_type = $_GET["code_type"];
112 if (!isset($_GET["unbilled"])) {
115 $unbilled = $_GET["unbilled"];
117 if (!isset($_GET["authorized"])) {
118 $my_authorized = "on";
120 $my_authorized = $_GET["authorized"];
123 $from_date = $_GET["from_date"];
124 $to_date = $_GET["to_date"];
125 $code_type = $_GET["code_type"];
126 $unbilled = $_GET["unbilled"];
127 $my_authorized = $_GET["authorized"];
132 if ($my_authorized == "on" ) {
135 $my_authorized = "%";
137 if ($unbilled == "on") {
142 if ($code_type == "all") {
146 $list = getBillsListBetween($code_type);
153 if (isset($_GET["mode"]) && $_GET["mode"] == "bill") {
154 billCodesList($list);
162 if ($ret = getBillsBetweenReport($code_type)) {
166 foreach ($ret as $iter) {
167 if ($old_pid != $iter{"pid"}) {
168 $name = getPatientData($iter{"pid"});
170 print "</tr></table>\n";
172 print "<table border=0><tr>\n"; // small table
174 print "<table border=0><tr>\n"; // small table
177 print "<tr><td colspan=5><hr><span class=bold>" . text($name{"fname"}) . " " . text($name{"lname"}) . "</span><br><br>\n";
178 //==================================
181 print "<font class=bold>" . xlt("Patient Data") . ":</font><br>";
182 printRecDataOne($patient_data_array, getRecPatientData ($iter{"pid"}), $COLS);
184 print "<font class=bold>" . xlt("Employer Data") . ":</font><br>";
185 printRecDataOne($employer_data_array, getRecEmployerData ($iter{"pid"}), $COLS);
187 print "<font class=bold>" . xlt("Primary Insurance Data") . ":</font><br>";
188 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"primary"), $COLS);
190 print "<font class=bold>" . xlt("Secondary Insurance Data") . ":</font><br>";
191 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"secondary"), $COLS);
193 print "<font class=bold>" . xlt("Tertiary Insurance Data") . ":</font><br>";
194 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"tertiary"), $COLS);
199 //==================================
200 print "</td></tr><tr>\n";
201 $old_pid = $iter{"pid"};
204 print "<td width=100><span class=text>" . text($iter{"code_type"}) . ": </span></td><td width=100><span class=text>" . text($iter{"code"}) . "</span></td><td width=100><span class=small>(" . text(date("Y-m-d",strtotime($iter{"date"}))) . ")</span></td>\n";
206 if ($res_count == $N) {
212 print "</tr></table>\n"; // small table