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"];
56 <?
html_header_show();?
>
59 <link rel
=stylesheet href
="<?php echo $css_header;?>" type
="text/css">
62 <body bgcolor
="#ffffff" topmargin
=0 rightmargin
=0 leftmargin
=2 bottommargin
=0 marginwidth
=2 marginheight
=0>
65 <a href
="javascript:window.close();" target
=Main
><font
class=title
><?php
xl('Billing Report','e')?
></font
></a
>
71 if ($my_authorized == "on" ) {
76 if ($unbilled == "on") {
81 if ($code_type == "all") {
85 $list = getBillsListBetween($from_date,$to_date,$my_authorized,$unbilled,$code_type);
91 if (!isset($_GET["mode"])) {
92 if (!isset($_GET["from_date"])) {
93 $from_date=date("Y-m-d");
95 $from_date = $_GET["from_date"];
97 if (!isset($_GET["to_date"])) {
98 $to_date = date("Y-m-d");
100 $to_date = $_GET["to_date"];
102 if (!isset($_GET["code_type"])) {
105 $code_type = $_GET["code_type"];
107 if (!isset($_GET["unbilled"])) {
110 $unbilled = $_GET["unbilled"];
112 if (!isset($_GET["authorized"])) {
113 $my_authorized = "on";
115 $my_authorized = $_GET["authorized"];
118 $from_date = $_GET["from_date"];
119 $to_date = $_GET["to_date"];
120 $code_type = $_GET["code_type"];
121 $unbilled = $_GET["unbilled"];
122 $my_authorized = $_GET["authorized"];
127 if ($my_authorized == "on" ) {
130 $my_authorized = "%";
132 if ($unbilled == "on") {
137 if ($code_type == "all") {
141 $list = getBillsListBetween($from_date,$to_date,$my_authorized,$unbilled,$code_type);
148 if (isset($_GET["mode"]) && $_GET["mode"] == "bill") {
149 billCodesList($list);
157 if ($ret = getBillsBetween($from_date,$to_date,$my_authorized,$unbilled,$code_type)) {
161 foreach ($ret as $iter) {
162 if ($old_pid != $iter{"pid"}) {
163 $name = getPatientData($iter{"pid"});
165 print "</tr></table>\n";
167 print "<table border=0><tr>\n"; // small table
169 print "<table border=0><tr>\n"; // small table
172 print "<tr><td colspan=5><hr><span class=bold>" . $name{"fname"} . " " . $name{"lname"} . "</span><br><br>\n";
173 //==================================
176 print "<font class=bold>Patient Data:</font><br>";
177 printRecDataOne($patient_data_array, getRecPatientData ($iter{"pid"}), $COLS);
179 print "<font class=bold>Employer Data:</font><br>";
180 printRecDataOne($employer_data_array, getRecEmployerData ($iter{"pid"}), $COLS);
182 print "<font class=bold>Primary Insurance Data:</font><br>";
183 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"primary"), $COLS);
185 print "<font class=bold>Secondary Insurance Data:</font><br>";
186 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"secondary"), $COLS);
188 print "<font class=bold>Tertiary Insurance Data:</font><br>";
189 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"tertiary"), $COLS);
194 //==================================
195 print "</td></tr><tr>\n";
196 $old_pid = $iter{"pid"};
199 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";
201 if ($res_count == $N) {
207 print "</tr></table>\n"; // small table