Add new modules loaded event (#7463)
[openemr.git] / interface / forms / misc_billing_options / report.php
blobaf306efdd02cc163a08e9ff0e6ca79f0bba798e8
1 <?php
3 /*
4 * report.php displays the misc_billing_form in the encounter view
6 * @package OpenEMR
7 * @link http://www.open-emr.org
8 * @author Terry Hill <terry@lilysystems.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (C) 2007 Bo Huynh
11 * @copyright Copyright (C) 2016 Terry Hill <terry@lillysystems.com>
12 * @copyright Copyright (C) 2017-2019 Brady Miller <brady.g.miller@gmail.com>
13 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
16 use OpenEMR\Billing\MiscBillingOptions;
18 require_once(dirname(__FILE__) . '/../../globals.php');
19 require_once($GLOBALS["srcdir"] . "/api.inc.php");
21 function misc_billing_options_report($pid, $encounter, $cols, $id)
23 $MBO = new OpenEMR\Billing\MiscBillingOptions();
24 $count = 0;
25 $data = formFetch("form_misc_billing_options", $id);
26 if ($data) {
27 print "<table><tr>";
28 foreach ($data as $key => $value) {
29 if (
30 $key == "id" || $key == "pid" || $key == "user" || $key == "groupname" ||
31 $key == "authorized" || $key == "activity" || $key == "date" || $value == "" ||
32 $value == "0" || $value == "0000-00-00 00:00:00" || $value == "0000-00-00" ||
33 ($key == "box_14_date_qual" && ($data['onset_date'] == 0)) ||
34 ($key == "box_15_date_qual" && ($data['date_initial_treatment'] == 0))
35 ) {
36 continue;
39 if (($key === 'box_14_date_qual') || $key === 'box_15_date_qual') {
40 $value = $MBO->qual_id_to_description($key, $value);
43 if ($key === 'provider_qualifier_code') {
44 $pqe = $data['provider_qualifier_code'];
45 if (!empty($pqe)) {
46 switch ($pqe) {
47 case ($pqe == "DN"):
48 $value = "Referring";
49 break;
50 case ($pqe == "DK"):
51 $value = "Ordering";
52 break;
53 case ($pqe == "DQ"):
54 $value = "Supervising";
55 break;
58 $key = 'Box 17 Qualifier';
62 if ($key === 'provider_id') {
63 $trow = sqlQuery("SELECT id, lname, fname FROM users WHERE " .
64 "id = ? ", array($value));
65 $value = $trow['fname'] . ' ' . $trow['lname'];
66 $key = 'Box 17 Provider';
69 if ($value == "1") {
70 $value = "Yes";
73 if ($key == "replacement_claim" && $value == "2") {
74 $key = "void_claim";
75 $value = "Yes";
79 $key = ucwords(str_replace("_", " ", $key));
80 print "<td><span class=bold>" . xlt($key) . ": </span><span class=text>" . text($value) . "</span></td>";
81 $count++;
83 if ($count == $cols) {
84 $count = 0;
85 print "</tr><tr>\n";
90 print "</tr></table>";