2 /* Copyright (C) 2012 Julia Longtin */
7 require_once("../globals.php");
9 require_once("$srcdir/patient.inc");
10 require_once("$srcdir/../interface/reports/report.inc.php");
11 require_once("$srcdir/billrep.inc");
12 require_once("$srcdir/forms.inc");
13 require_once("$srcdir/billing.inc");
14 require_once("$srcdir/report.inc");
16 //how many columns to use when displaying information
20 if (!isset($_GET["mode"])) {
21 if (!isset($_GET["from_date"])) {
22 $from_date=date("Y-m-d");
24 $from_date = $_GET["from_date"];
27 if (!isset($_GET["to_date"])) {
28 $to_date = date("Y-m-d");
30 $to_date = $_GET["to_date"];
33 if (!isset($_GET["code_type"])) {
36 $code_type = $_GET["code_type"];
39 if (!isset($_GET["unbilled"])) {
42 $unbilled = $_GET["unbilled"];
45 if (!isset($_GET["authorized"])) {
46 $my_authorized = "on";
48 $my_authorized = $_GET["authorized"];
51 $from_date = $_GET["from_date"];
52 $to_date = $_GET["to_date"];
53 $code_type = $_GET["code_type"];
54 $unbilled = $_GET["unbilled"];
55 $my_authorized = $_GET["authorized"];
62 <?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>
69 <a href
="javascript:window.close();" target
=Main
><font
class=title
><?php
echo xlt('Billing Report')?
></font
></a
>
73 if ($my_authorized == "on") {
79 if ($unbilled == "on") {
85 if ($code_type == "all") {
89 $list = getBillsListBetween($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"];
98 if (!isset($_GET["to_date"])) {
99 $to_date = date("Y-m-d");
101 $to_date = $_GET["to_date"];
104 if (!isset($_GET["code_type"])) {
107 $code_type = $_GET["code_type"];
110 if (!isset($_GET["unbilled"])) {
113 $unbilled = $_GET["unbilled"];
116 if (!isset($_GET["authorized"])) {
117 $my_authorized = "on";
119 $my_authorized = $_GET["authorized"];
122 $from_date = $_GET["from_date"];
123 $to_date = $_GET["to_date"];
124 $code_type = $_GET["code_type"];
125 $unbilled = $_GET["unbilled"];
126 $my_authorized = $_GET["authorized"];
129 if ($my_authorized == "on") {
132 $my_authorized = "%";
135 if ($unbilled == "on") {
141 if ($code_type == "all") {
145 $list = getBillsListBetween($code_type);
147 if (isset($_GET["mode"]) && $_GET["mode"] == "bill") {
148 billCodesList($list);
155 if ($ret = getBillsBetweenReport($code_type)) {
159 foreach ($ret as $iter) {
160 if ($old_pid != $iter{"pid"}) {
161 $name = getPatientData($iter{"pid"});
163 print "</tr></table>\n";
165 print "<table border=0><tr>\n"; // small table
167 print "<table border=0><tr>\n"; // small table
171 print "<tr><td colspan=5><hr><span class=bold>" . text($name{"fname"}) . " " . text($name{"lname"}) . "</span><br><br>\n";
172 //==================================
175 print "<font class=bold>" . xlt("Patient Data") . ":</font><br>";
176 printRecDataOne($patient_data_array, getRecPatientData($iter{"pid"}), $COLS);
178 print "<font class=bold>" . xlt("Employer Data") . ":</font><br>";
179 printRecDataOne($employer_data_array, getRecEmployerData($iter{"pid"}), $COLS);
181 print "<font class=bold>" . xlt("Primary Insurance Data") . ":</font><br>";
182 printRecDataOne($insurance_data_array, getRecInsuranceData($iter{"pid"}, "primary"), $COLS);
184 print "<font class=bold>" . xlt("Secondary Insurance Data") . ":</font><br>";
185 printRecDataOne($insurance_data_array, getRecInsuranceData($iter{"pid"}, "secondary"), $COLS);
187 print "<font class=bold>" . xlt("Tertiary Insurance Data") . ":</font><br>";
188 printRecDataOne($insurance_data_array, getRecInsuranceData($iter{"pid"}, "tertiary"), $COLS);
190 //==================================
191 print "</td></tr><tr>\n";
192 $old_pid = $iter{"pid"};
195 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";
197 if ($res_count == $N) {
205 print "</tr></table>\n"; // small table