3 * Print billing report.
6 * @link http://www.open-emr.org
7 * @author Julia Longtin
8 * @author Stephen Waite <stephen.waite@cmsvt.com>
9 * @copyright Copyright (c) 2012 Julia Longtin
10 * @copyright Copyright (c) 2018 Stephen Waite <stephen.waite@cmsvt.com>
11 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
14 require_once("../globals.php");
15 require_once("$srcdir/patient.inc");
16 require_once("$srcdir/../interface/reports/report.inc.php");
17 require_once("$srcdir/billrep.inc");
18 require_once("$srcdir/forms.inc");
19 require_once("$srcdir/report.inc");
21 //how many columns to use when displaying information
25 if (!isset($_GET["mode"])) {
26 if (!isset($_GET["from_date"])) {
27 $from_date=date("Y-m-d");
29 $from_date = $_GET["from_date"];
32 if (!isset($_GET["to_date"])) {
33 $to_date = date("Y-m-d");
35 $to_date = $_GET["to_date"];
38 if (!isset($_GET["code_type"])) {
41 $code_type = $_GET["code_type"];
44 if (!isset($_GET["unbilled"])) {
47 $unbilled = $_GET["unbilled"];
50 if (!isset($_GET["authorized"])) {
51 $my_authorized = "on";
53 $my_authorized = $_GET["authorized"];
56 $from_date = $_GET["from_date"];
57 $to_date = $_GET["to_date"];
58 $code_type = $_GET["code_type"];
59 $unbilled = $_GET["unbilled"];
60 $my_authorized = $_GET["authorized"];
67 <?php
html_header_show();?
>
69 <link rel
=stylesheet href
="<?php echo $css_header;?>" type
="text/css">
72 <body bgcolor
="#ffffff" topmargin
=0 rightmargin
=0 leftmargin
=2 bottommargin
=0 marginwidth
=2 marginheight
=0>
74 <a href
="javascript:window.close();" target
=Main
><font
class=title
><?php
echo xlt('Billing Report')?
></font
></a
>
78 if ($my_authorized == "on") {
84 if ($unbilled == "on") {
90 if ($code_type == "all") {
94 $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"];
103 if (!isset($_GET["to_date"])) {
104 $to_date = date("Y-m-d");
106 $to_date = $_GET["to_date"];
109 if (!isset($_GET["code_type"])) {
112 $code_type = $_GET["code_type"];
115 if (!isset($_GET["unbilled"])) {
118 $unbilled = $_GET["unbilled"];
121 if (!isset($_GET["authorized"])) {
122 $my_authorized = "on";
124 $my_authorized = $_GET["authorized"];
127 $from_date = $_GET["from_date"];
128 $to_date = $_GET["to_date"];
129 $code_type = $_GET["code_type"];
130 $unbilled = $_GET["unbilled"];
131 $my_authorized = $_GET["authorized"];
134 if ($my_authorized == "on") {
137 $my_authorized = "%";
140 if ($unbilled == "on") {
146 if ($code_type == "all") {
150 $list = getBillsListBetween($code_type);
152 if (isset($_GET["mode"]) && $_GET["mode"] == "bill") {
153 billCodesList($list);
160 if ($ret = getBillsBetweenReport($code_type)) {
164 foreach ($ret as $iter) {
165 if ($old_pid != $iter{"pid"}) {
166 $name = getPatientData($iter{"pid"});
168 print "</tr></table>\n";
170 print "<table border=0><tr>\n"; // small table
172 print "<table border=0><tr>\n"; // small table
176 print "<tr><td colspan=5><hr><span class=bold>" . text($name{"fname"}) . " " . text($name{"lname"}) . "</span><br><br>\n";
177 //==================================
180 print "<font class=bold>" . xlt("Patient Data") . ":</font><br>";
181 printRecDataOne($patient_data_array, getRecPatientData($iter{"pid"}), $COLS);
183 print "<font class=bold>" . xlt("Employer Data") . ":</font><br>";
184 printRecDataOne($employer_data_array, getRecEmployerData($iter{"pid"}), $COLS);
186 print "<font class=bold>" . xlt("Primary Insurance Data") . ":</font><br>";
187 printRecDataOne($insurance_data_array, getRecInsuranceData($iter{"pid"}, "primary"), $COLS);
189 print "<font class=bold>" . xlt("Secondary Insurance Data") . ":</font><br>";
190 printRecDataOne($insurance_data_array, getRecInsuranceData($iter{"pid"}, "secondary"), $COLS);
192 print "<font class=bold>" . xlt("Tertiary Insurance Data") . ":</font><br>";
193 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>" . 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";
202 if ($res_count == $N) {
210 print "</tr></table>\n"; // small table