4 * report.php displays the misc_billing_form in the encounter view
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();
25 $data = formFetch("form_misc_billing_options", $id);
28 foreach ($data as $key => $value) {
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))
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'];
54 $value = "Supervising";
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';
73 if ($key == "replacement_claim" && $value == "2") {
79 $key = ucwords(str_replace("_", " ", $key));
80 print "<td><span class=bold>" . xlt($key) . ": </span><span class=text>" . text($value) . "</span></td>";
83 if ($count == $cols) {
90 print "</tr></table>";