From 81a353ce802e4bce4b6fd6deb0136165ca7c4670 Mon Sep 17 00:00:00 2001 From: stephen waite Date: Sat, 24 Apr 2021 17:28:17 -0400 Subject: [PATCH] a few billing fixes (#4352) * denote copays * move patient.inc to patient.inc.php * fix typo to align amounts in billing view * add comment for copays displayed in red * php style * php style * Revert "move patient.inc to patient.inc.php" This reverts commit 7eb12565e8b5fa093eb103f4435a6cd6be1390eb. * remove auto calc'ed copays from get_patient_balance --- interface/patient_file/history/encounters.php | 4 +++- library/patient.inc | 7 ++++++- src/Billing/InvoiceSummary.php | 8 ++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/interface/patient_file/history/encounters.php b/interface/patient_file/history/encounters.php index 664f0cf3a..f9ae51bab 100644 --- a/interface/patient_file/history/encounters.php +++ b/interface/patient_file/history/encounters.php @@ -728,6 +728,8 @@ function efmouseover(elem, ptid, encid, formname, formid) { // Pick up any remaining unmatched invoice items from the accounting // system. Display them in red, as they should be unusual. + // Except copays aren't unusual but displaying them in red + // helps billers spot them quickly :) if (!empty($arinvoice)) { foreach ($arinvoice as $codekey => $val) { if ($binfo[0]) { @@ -752,7 +754,7 @@ function efmouseover(elem, ptid, encid, formname, formid) { echo "" . $binfo[0] . "\n"; for ($i = 1; $i < 5; ++$i) { - echo "" . $binfo[$i] . "\n"; + echo "" . $binfo[$i] . "\n"; } } /* end if authorized */ else { echo "(" . xlt("No access") . ")\n"; diff --git a/library/patient.inc b/library/patient.inc index 732f5f2f9..616e94aae 100644 --- a/library/patient.inc +++ b/library/patient.inc @@ -7,8 +7,10 @@ * @link http://www.open-emr.org * @author Brady Miller * @author Sherwin Gaddis + * @author Stephen Waite * @copyright Copyright (c) 2018-2019 Brady Miller * @copyright Copyright (c) 2019 Sherwin Gaddis + * @copyright Copyright (c) 2018-2021 Stephen Waite * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ @@ -1716,7 +1718,10 @@ function get_patient_balance($pid, $with_insurance = false, $eid = false) "deleted IS NULL AND pid = ? AND encounter = ? AND payer_type = 0", array($pid, $encounter) ); - $copay = !empty($insarr[0]['copay']) ? $insarr[0]['copay'] * 1 : 0; + // going to comment this out for now since computing future copays doesn't + // equate to cash in hand, which shows in the Billing widget in dashboard 4-23-21 + // $copay = !empty($insarr[0]['copay']) ? $insarr[0]['copay'] * 1 : 0; + $amt = !empty($brow['amount']) ? $brow['amount'] * 1 : 0; $pay = !empty($drow['payments']) ? $drow['payments'] * 1 : 0; $ptbal = $copay + $amt - $pay; diff --git a/src/Billing/InvoiceSummary.php b/src/Billing/InvoiceSummary.php index b08a31922..51b5e943f 100644 --- a/src/Billing/InvoiceSummary.php +++ b/src/Billing/InvoiceSummary.php @@ -5,7 +5,7 @@ * @author Rod Roark * @author Stephen Waite * @copyright Copyright (c) 2005-2020 Rod Roark - * @copyright Copyright (c) 2018-2019 Stephen Waite + * @copyright Copyright (c) 2018-2021 Stephen Waite * @link https://www.open-emr.org * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ @@ -141,7 +141,11 @@ class InvoiceSummary while ($row = sqlFetchArray($res)) { $code = $row['code']; if (!$code) { - $code = "Unknown"; + if ($row['account_code'] == "PCP") { + $code = "Copay"; + } else { + $code = "Unknown"; + } } if ($row['modifier']) { -- 2.11.4.GIT