7 * @link http://www.open-emr.org
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("../../globals.php");
14 require_once("../../../custom/code_types.inc.php");
16 use OpenEMR\Billing\BillingUtilities
;
17 use OpenEMR\Common\Csrf\CsrfUtils
;
18 use OpenEMR\Core\Header
;
20 //the number of rows to display before resetting and starting a new column:
23 $mode = $_GET['mode'];
24 $type = $_GET['type'];
25 $modifier = $_GET['modifier'];
26 $units = $_GET['units'];
28 $code = $_GET['code'];
29 $text = $_GET['text'];
32 if (!CsrfUtils
::verifyCsrfToken($_GET["csrf_token_form"])) {
33 CsrfUtils
::csrfNotVerified();
37 if (strtolower($type) == "copay") {
38 BillingUtilities
::addBilling($encounter, $type, sprintf("%01.2f", $code), $text, $pid, $userauthorized, $_SESSION['authUserID'], $modifier, $units, sprintf("%01.2f", 0 - $code));
39 } elseif (strtolower($type) == "other") {
40 BillingUtilities
::addBilling($encounter, $type, $code, $text, $pid, $userauthorized, $_SESSION['authUserID'], $modifier, $units, sprintf("%01.2f", $fee));
42 BillingUtilities
::addBilling($encounter, $type, $code, $text, $pid, $userauthorized, $_SESSION['authUserID'], $modifier, $units, $fee);
49 <?php Header
::setupHeader(); ?
>
51 <body
class="body_bottom">
53 <table
class="table-borderless" cellspacing
="0" cellpadding
="0">
55 <td
class="align-top">
61 <a href
="superbill_custom_full.php" onclick
="top.restoreSession()">
62 <span
class='title'><?php
echo xlt('Superbill'); ?
></span
>
63 <span
class='more'><?php
echo text($tmore); ?
></span
></a
>
65 <a href
="encounter_bottom.php" onclick
="top.restoreSession()"><span
class='more'><?php
echo text($tback); ?
></span
></a
>
71 <table
class='w-100 table-borderless' cellpadding
='0' cellspacing
='1'>
73 $res = sqlStatement("select * from codes where superbill = 1 order by code_type, code, code_text");
77 foreach ($code_types as $key => $value) {
78 $codes[$key] = array();
79 echo " <th class='text-left'>" . text($key) . " Codes</th>\n";
84 for ($iter = 0; $row = sqlFetchArray($res); $iter++
) {
85 foreach ($code_types as $key => $value) {
86 if ($value['id'] == $row['code_type']) {
87 $codes[$key][] = $row;
96 foreach ($codes as $value) {
97 $numlines = max($numlines, count($value));
100 while ($index < $numlines) {
102 foreach ($codes as $key => $value) {
103 echo " <td class='align-top'>\n";
104 if (!empty($value[$index])) {
105 $code = $value[$index];
106 echo " <dd><a class='text' ";
107 echo "href='superbill_codes.php?back=1&mode=add" .
108 "&type=" . attr_url($key) .
109 "&modifier=" . attr_url($code["modifier"]) .
110 "&units=" . attr_url($code["units"]) .
111 "&fee=" . attr_url($code["fee"]) .
112 "&code=" . attr_url($code["code"]) .
113 "&text=" . attr_url($code["code_text"]) .
114 "&csrf_token_form=" . attr_url(CsrfUtils
::collectCsrfToken()) .
115 "' onclick='top.restoreSession()'>";
116 echo "<b>" . text($code['code']) . "</b>" . " " . text($code['modifier']) . " " . text($code['code_text']);