2 include_once("../globals.php");
4 include_once("$srcdir/patient.inc");
5 include_once("$srcdir/../interface/reports/report.inc.php");
6 include_once("$srcdir/billrep.inc");
7 include_once("$srcdir/forms.inc");
8 include_once("$srcdir/billing.inc");
9 include_once("$srcdir/pnotes.inc");
10 include_once("$srcdir/report.inc");
12 //how many columns to use when displaying information
17 if (!isset($_GET["mode"])) {
18 if (!isset($_GET["from_date"])) {
19 $from_date=date("Y-m-d");
21 $from_date = $_GET["from_date"];
23 if (!isset($_GET["to_date"])) {
24 $to_date = date("Y-m-d");
26 $to_date = $_GET["to_date"];
28 if (!isset($_GET["code_type"])) {
31 $code_type = $_GET["code_type"];
33 if (!isset($_GET["unbilled"])) {
36 $unbilled = $_GET["unbilled"];
38 if (!isset($_GET["authorized"])) {
39 $my_authorized = "on";
41 $my_authorized = $_GET["authorized"];
44 $from_date = $_GET["from_date"];
45 $to_date = $_GET["to_date"];
46 $code_type = $_GET["code_type"];
47 $unbilled = $_GET["unbilled"];
48 $my_authorized = $_GET["authorized"];
57 <?
html_header_show();?
>
60 <link rel
=stylesheet href
="<?php echo $css_header;?>" type
="text/css">
63 <body bgcolor
="#ffffff" topmargin
=0 rightmargin
=0 leftmargin
=2 bottommargin
=0 marginwidth
=2 marginheight
=0>
66 <a href
="javascript:window.close();" target
=Main
><font
class=title
><?php
xl('Billing Report','e')?
></font
></a
>
72 if ($my_authorized == "on" ) {
77 if ($unbilled == "on") {
82 if ($code_type == "all") {
86 $list = getBillsListBetween($code_type);
92 if (!isset($_GET["mode"])) {
93 if (!isset($_GET["from_date"])) {
94 $from_date=date("Y-m-d");
96 $from_date = $_GET["from_date"];
98 if (!isset($_GET["to_date"])) {
99 $to_date = date("Y-m-d");
101 $to_date = $_GET["to_date"];
103 if (!isset($_GET["code_type"])) {
106 $code_type = $_GET["code_type"];
108 if (!isset($_GET["unbilled"])) {
111 $unbilled = $_GET["unbilled"];
113 if (!isset($_GET["authorized"])) {
114 $my_authorized = "on";
116 $my_authorized = $_GET["authorized"];
119 $from_date = $_GET["from_date"];
120 $to_date = $_GET["to_date"];
121 $code_type = $_GET["code_type"];
122 $unbilled = $_GET["unbilled"];
123 $my_authorized = $_GET["authorized"];
128 if ($my_authorized == "on" ) {
131 $my_authorized = "%";
133 if ($unbilled == "on") {
138 if ($code_type == "all") {
142 $list = getBillsListBetween($code_type);
149 if (isset($_GET["mode"]) && $_GET["mode"] == "bill") {
150 billCodesList($list);
158 if ($ret = getBillsBetween($code_type)) {
162 foreach ($ret as $iter) {
163 if ($old_pid != $iter{"pid"}) {
164 $name = getPatientData($iter{"pid"});
166 print "</tr></table>\n";
168 print "<table border=0><tr>\n"; // small table
170 print "<table border=0><tr>\n"; // small table
173 print "<tr><td colspan=5><hr><span class=bold>" . $name{"fname"} . " " . $name{"lname"} . "</span><br><br>\n";
174 //==================================
177 print "<font class=bold>Patient Data:</font><br>";
178 printRecDataOne($patient_data_array, getRecPatientData ($iter{"pid"}), $COLS);
180 print "<font class=bold>Employer Data:</font><br>";
181 printRecDataOne($employer_data_array, getRecEmployerData ($iter{"pid"}), $COLS);
183 print "<font class=bold>Primary Insurance Data:</font><br>";
184 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"primary"), $COLS);
186 print "<font class=bold>Secondary Insurance Data:</font><br>";
187 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"secondary"), $COLS);
189 print "<font class=bold>Tertiary Insurance Data:</font><br>";
190 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"tertiary"), $COLS);
195 //==================================
196 print "</td></tr><tr>\n";
197 $old_pid = $iter{"pid"};
200 print "<td width=100><span class=text>" . $iter{"code_type"} . ": </span></td><td width=100><span class=text>" . $iter{"code"} . "</span></td><td width=100><span class=small>(" . date("Y-m-d",strtotime($iter{"date"})) . ")</span></td>\n";
202 if ($res_count == $N) {
208 print "</tr></table>\n"; // small table