2 include_once("../globals.php");
4 include_once("$srcdir/patient.inc");
5 include_once("$srcdir/billrep.inc");
6 include_once("$srcdir/forms.inc");
7 include_once("$srcdir/billing.inc");
8 include_once("$srcdir/pnotes.inc");
9 include_once("$srcdir/report.inc");
11 //how many columns to use when displaying information
16 if (!isset($_GET["mode"])) {
17 if (!isset($_GET["from_date"])) {
18 $from_date=date("Y-m-d");
20 $from_date = $_GET["from_date"];
22 if (!isset($_GET["to_date"])) {
23 $to_date = date("Y-m-d");
25 $to_date = $_GET["to_date"];
27 if (!isset($_GET["code_type"])) {
30 $code_type = $_GET["code_type"];
32 if (!isset($_GET["unbilled"])) {
35 $unbilled = $_GET["unbilled"];
37 if (!isset($_GET["authorized"])) {
38 $my_authorized = "on";
40 $my_authorized = $_GET["authorized"];
43 $from_date = $_GET["from_date"];
44 $to_date = $_GET["to_date"];
45 $code_type = $_GET["code_type"];
46 $unbilled = $_GET["unbilled"];
47 $my_authorized = $_GET["authorized"];
58 <link rel
=stylesheet href
="<?php echo $css_header;?>" type
="text/css">
61 <body bgcolor
="#ffffff" topmargin
=0 rightmargin
=0 leftmargin
=2 bottommargin
=0 marginwidth
=2 marginheight
=0>
64 <a href
="javascript:window.close();" target
=Main
><font
class=title
><?php
xl('Billing Report','e')?
></font
></a
>
70 if ($my_authorized == "on" ) {
75 if ($unbilled == "on") {
80 if ($code_type == "all") {
84 $list = getBillsListBetween($from_date,$to_date,$my_authorized,$unbilled,$code_type);
90 if (!isset($_GET["mode"])) {
91 if (!isset($_GET["from_date"])) {
92 $from_date=date("Y-m-d");
94 $from_date = $_GET["from_date"];
96 if (!isset($_GET["to_date"])) {
97 $to_date = date("Y-m-d");
99 $to_date = $_GET["to_date"];
101 if (!isset($_GET["code_type"])) {
104 $code_type = $_GET["code_type"];
106 if (!isset($_GET["unbilled"])) {
109 $unbilled = $_GET["unbilled"];
111 if (!isset($_GET["authorized"])) {
112 $my_authorized = "on";
114 $my_authorized = $_GET["authorized"];
117 $from_date = $_GET["from_date"];
118 $to_date = $_GET["to_date"];
119 $code_type = $_GET["code_type"];
120 $unbilled = $_GET["unbilled"];
121 $my_authorized = $_GET["authorized"];
126 if ($my_authorized == "on" ) {
129 $my_authorized = "%";
131 if ($unbilled == "on") {
136 if ($code_type == "all") {
140 $list = getBillsListBetween($from_date,$to_date,$my_authorized,$unbilled,$code_type);
147 if (isset($_GET["mode"]) && $_GET["mode"] == "bill") {
148 billCodesList($list);
156 if ($ret = getBillsBetween($from_date,$to_date,$my_authorized,$unbilled,$code_type)) {
160 foreach ($ret as $iter) {
161 if ($old_pid != $iter{"pid"}) {
162 $name = getPatientData($iter{"pid"});
164 print "</tr></table>\n";
166 print "<table border=0><tr>\n"; // small table
168 print "<table border=0><tr>\n"; // small table
171 print "<tr><td colspan=5><hr><span class=bold>" . $name{"fname"} . " " . $name{"lname"} . "</span><br><br>\n";
172 //==================================
175 print "<font class=bold>Patient Data:</font><br>";
176 printRecDataOne($patient_data_array, getRecPatientData ($iter{"pid"}), $COLS);
178 print "<font class=bold>Employer Data:</font><br>";
179 printRecDataOne($employer_data_array, getRecEmployerData ($iter{"pid"}), $COLS);
181 print "<font class=bold>Primary Insurance Data:</font><br>";
182 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"primary"), $COLS);
184 print "<font class=bold>Secondary Insurance Data:</font><br>";
185 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"secondary"), $COLS);
187 print "<font class=bold>Tertiary Insurance Data:</font><br>";
188 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"tertiary"), $COLS);
193 //==================================
194 print "</td></tr><tr>\n";
195 $old_pid = $iter{"pid"};
198 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";
200 if ($res_count == $N) {
206 print "</tr></table>\n"; // small table