Skip to content

Commit

Permalink
Final 502 batch payments. Yeah right! (openemr#3828)
Browse files Browse the repository at this point in the history
- honor follow up flag for denied claims
- add a link in EOB Invoice to only change/save selected Done with(last level closed)
- some styling
  • Loading branch information
sjpadgett committed Aug 8, 2020
1 parent b3a3a8d commit babec93
Show file tree
Hide file tree
Showing 8 changed files with 221 additions and 195 deletions.
1 change: 1 addition & 0 deletions interface/billing/edit_payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@
<!DOCTYPE html>
<html>
<head>
<title><?php echo xlt('Confirm Payment'); ?></title>
<?php Header::setupHeader(['datetime-picker', 'common']); ?>

<script>
Expand Down
8 changes: 4 additions & 4 deletions interface/billing/payment_master.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ function generate_list_payment_category($tag_name, $list_id, $currvalue, $title,
<label class="control-label" for="deposit_date"><?php echo xlt('Deposit Date'); ?>:</label>
<input type='text' class='form-control datepicker' name='deposit_date' id='deposit_date' onKeyDown="PreventIt(event)" value="<?php echo attr(oeFormatShortDate($DepositDate));?>" autocomplete="off"/>
</div>
<div class="forms col-xs-6">
<div class="forms col-xs-5">
<label class="control-label" for="description"><?php echo xlt('Description'); ?>:</label>
<input type="text" name="description" id="description" onKeyDown="PreventIt(event)" value="<?php echo attr($Description);?>" class="form-control" />
</div>
<div class="forms col-xs-2">
<div class="forms col-xs-3">
<label class="control-label" for="GlobalReset"><?php echo xlt('Distributed to Global'); ?>:</label>
<div class="input-group">
<span class="input-group-addon">
Expand Down Expand Up @@ -348,11 +348,11 @@ function generate_list_payment_category($tag_name, $list_id, $currvalue, $title,
<label class="control-label" for="deposit_date"><?php echo xlt('Deposit Date'); ?>:</label>
<input type="text" class='form-control' name="deposit_date" id="deposit_date" value="<?php echo attr(oeFormatShortDate($DepositDate)); ?>" disabled />
</div>
<div class="forms col-xs-6">
<div class="forms col-xs-5">
<label class="control-label" for="description"><?php echo xlt('Description'); ?>:</label>
<input type="text" name="description" id="description" value="<?php echo attr($Description); ?>" class="form-control" disabled />
</div>
<div class="forms col-xs-2">
<div class="forms col-xs-3">
<label class="control-label" for="GlobalResetView"><?php echo xlt('Distributed to Global'); ?>:</label>
<input id="GlobalResetView" name="global_reset_view" class="form-control" value="<?php echo ($global_amount * 1 == 0) ? attr("0.00") : attr(number_format($global_amount, 2, '.', ',')); ?>" disabled />
</div>
Expand Down
3 changes: 1 addition & 2 deletions interface/billing/search_payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
<!DOCTYPE html>
<html>
<head>

<title><?php echo xlt("Search Payment") ?></title>
<?php Header::setupHeader(['jquery-ui', 'datetime-picker', 'common']); ?>

<?php include_once("{$GLOBALS['srcdir']}/payment_jav.inc.php"); ?>
Expand Down Expand Up @@ -412,7 +412,6 @@ function SearchPayingEntityAction()
overflow-x: hidden !Important;
}
</style>
<title><?php echo xlt("Search Payments"); ?></title>
<?php
$arrOeUiSettings = array(
'heading_title' => xl('Payments'),
Expand Down
57 changes: 35 additions & 22 deletions interface/billing/sl_eob_invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode)
$payer_type = $matches[1];
}

if (($_POST['form_save'] || $_POST['form_cancel'])) {
if ($_POST['form_save'] || $_POST['form_cancel'] || $_POST['isLastClosed']) {
if ($_POST['form_save']) {
if (!CsrfUtils::verifyCsrfToken($_POST["csrf_token_form"])) {
CsrfUtils::csrfNotVerified();
Expand Down Expand Up @@ -415,16 +415,26 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode)
echo " }\n";
echo " }\n";
} else {
echo "<script language='JavaScript'>\n";
}
echo "<script>\n";
if ($info_msg) {
echo " alert(" . js_escape($info_msg) . ");\n";
}
if (!$debug && !$save_stay) {
if (!$debug && !$save_stay && !$_POST['isLastClosed']) {
echo "doClose();\n";
}
echo "</script></body></html>\n";
if (!$save_stay) {
if (!$debug && ($save_stay || $_POST['isLastClosed'])) {
if ($_POST['isLastClosed']) {
// save last closed level
$form_done = 0 + $_POST['form_done'];
$form_stmt_count = 0 + $_POST['form_stmt_count'];
sqlStatement("UPDATE form_encounter SET last_level_closed = ?, stmt_count = ? WHERE pid = ? AND encounter = ?", array($form_done, $form_stmt_count, $patient_id, $encounter_id));
}
// will reload page w/o reposting
echo "location.replace(location)\n";
}
echo "</script>\n";
if (!$save_stay && !$_POST['isLastClosed']) {
exit();
}
}
Expand All @@ -442,19 +452,20 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode)
</div>
<div class="row">
<form action='sl_eob_invoice.php?id=<?php echo attr_url($trans_id); ?>' method='post' onsubmit='return validate(this)'>
<input type="hidden" name="csrf_token_form" value="<?php echo attr(CsrfUtils::collectCsrfToken()); ?>"/>
<input type="hidden" name="isPosting" value="<?php echo attr($from_posting); ?>"/>
<input type="hidden" name="csrf_token_form" value="<?php echo attr(CsrfUtils::collectCsrfToken()); ?>" />
<input type="hidden" name="isPosting" value="<?php echo attr($from_posting); ?>" />
<input type="hidden" name="isLastClosed" value="" />
<fieldset>
<legend><?php echo xlt('Invoice Actions'); ?></legend>
<div class="col-xs-12 oe-custom-line">
<div class="col-xs-3">
<div class="col-xs-2">
<label class="control-label" for="form_name"><?php echo xlt('Patient'); ?>:</label>
<input type="text" class="form-control" class="form-control" class="form-control" id='form_name'
name='form_name'
value="<?php echo attr($ferow['fname']) . ' ' . attr($ferow['mname']) . ' ' . attr($ferow['lname']); ?>"
disabled>
</div>
<div class="col-xs-3">
<div class="col-xs-2">
<label class="control-label" for="form_provider"><?php echo xlt('Provider'); ?>:</label>
<?php
$tmp = sqlQuery("SELECT fname, mname, lname " .
Expand All @@ -479,7 +490,7 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode)
<input type="text" class="form-control" class="form-control" id='svc_date' name='form_provider'
value='<?php echo attr($svcdate); ?>' disabled>
</div>
<div class="col-xs-2">
<div class="col-xs-4">
<label class="control-label" for="insurance_name"><?php echo xlt('Insurance'); ?>:</label>
<?php
for ($i = 1; $i <= 3; ++$i) {
Expand All @@ -495,7 +506,7 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode)
</div>
</div>
<div class="col-xs-12 oe-custom-line">
<div class="col-xs-3">
<div class="col-xs-2">
<label class="control-label" for="form_stmt_count"><?php echo xlt('Statements Sent'); ?>
:</label>
<input type='text' name='form_stmt_count' id='form_stmt_count' class="form-control"
Expand All @@ -507,17 +518,17 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode)
<input type='text' name="form_last_bill" id='form_last_bill' class="form-control"
value ='<?php echo attr($billdate); ?>' disabled/>
</div>
<div class="col-xs-3">
<div class="col-xs-2">
<label class="control-label" for="form_reference"><?php echo xlt('Check/EOB No.'); ?>:</label>
<input type='text' name='form_reference' id='form_reference' class="form-control" value=''/>
</div>
<div class="form-group col-lg">
<label class="col-form-label" for="form_check_date"><?php echo xlt('Check/EOB Date'); ?>:</label>
<input type='text' name='form_check_date' id='form_check_date" class='form-control datepicker' value=''/>
</div>
<div class="col-xs-2">
<label class="control-label" for="form_check_date"><?php echo xlt('Check/EOB Date'); ?>:</label>
<input type='text' name='form_check_date' id='form_check_date' class='form-control datepicker' value='' />
</div>
<div class="col-xs-4">
<label class="control-label" for="form_deposit_date"><?php echo xlt('Deposit Date'); ?>:</label>
<input type='text' name='form_deposit_date' id='form_deposit_date' class='form-control datepicker' value=''/>
<input type='text' name='form_deposit_date' id='form_deposit_date' class='form-control datepicker' value='' />
<input type='hidden' name='form_payer_id' value=''/>
<input type='hidden' name='form_orig_reference' value=''/>
<input type='hidden' name='form_orig_check_date' value=''/>
Expand All @@ -528,7 +539,7 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode)
<div class="col-xs-12 oe-custom-line">
<div class="col-xs-4">
<label class="control-label" for="type_code"><?php echo xlt('Now posting for'); ?>:</label>
<div style="padding-left:15px">
<div style="padding-left:5px">
<?php
$last_level_closed = 0 + $ferow['last_level_closed'];
?>
Expand All @@ -555,8 +566,11 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode)
</div>
</div>
<div class="col-xs-4">
<label class="control-label" for=""><?php echo xlt('Done with'); ?>:</label>
<div style="padding-left:15px">
<label class="control-label" for=""><?php echo xlt('Done with'); ?></label>
<a class="btn btn-sm btn-save"
onclick="document.forms[0].isLastClosed.value='3'; document.forms[0].submit()"><?php echo xlt("Save Level"); ?>
</a>
<div style="padding-left:5px">
<?php
// Write a checkbox for each insurance. It is to be checked when
// we no longer expect any payments from that company for the claim.
Expand All @@ -577,8 +591,7 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode)
<label class="control-label" for=""><?php echo xlt('Secondary billing'); ?>:</label>
<div style="padding-left:15px">
<label class="checkbox-inline">
<input name="form_secondary" type="checkbox"
value="1"><?php echo xlt('Needs secondary billing') ?>
<input name="form_secondary" type="checkbox" value="1"><?php echo xlt('Needs secondary billing') ?>
</label>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion interface/billing/sl_eob_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,8 @@ function reSubmit() {
}
function editInvoice(e, id) {
let url = './sl_eob_invoice.php?isPosting=1&id=' + encodeURIComponent(id);
dlgopen(url,'','modal-lg',750,false,'', {
dlgopen(url,'','modal-full',700,false,'', {
sizeHeight: 'full',
onClosed: 'reSubmit'
});
}
Expand Down
1 change: 1 addition & 0 deletions library/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ function dlgopen(url, winname, width, height, forceNewWindow, title, opts) {
// DOM Ready. Handle events and cleanup.
if (opts.type === 'iframe') {
var modalwin = where.jQuery('body').find("[name='" + winname + "']");
jQuery('div.modal-dialog', modalwin).css({'margin': '1.25rem auto'});
modalwin.on('load', function (e) {
setTimeout(function () {
if (opts.sizeHeight === 'auto') {
Expand Down
4 changes: 3 additions & 1 deletion library/invoice_summary.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function ar_get_invoice_summary($patient_id, $encounter_id, $with_detail = false
// Get payments and adjustments. (includes copays)
$res = sqlStatement("SELECT " .
"a.code_type, a.code, a.modifier, a.memo, a.payer_type, a.adj_amount, a.pay_amount, a.reason_code, " .
"a.post_time, a.session_id, a.sequence_no, a.account_code, " .
"a.post_time, a.session_id, a.sequence_no, a.account_code, a.follow_up_note, " .
"s.payer_id, s.reference, s.check_date, s.deposit_date " .
",i.name " .
"FROM ar_activity AS a " .
Expand Down Expand Up @@ -169,6 +169,8 @@ function ar_get_invoice_summary($patient_id, $encounter_id, $with_detail = false
if ($row['adj_amount'] != 0 || $row['pay_amount'] == 0) {
$tmp['chg'] = 0 - $row['adj_amount'];
// $tmp['rsn'] = (empty($row['memo']) || empty($row['session_id'])) ? 'Unknown adjustment' : $row['memo'];
$row['memo'] = (!empty($row['follow_up_note']) && empty($row['memo'])) ?
(xlt("Payment note") . ": " . trim($row['follow_up_note'])) : $row['memo'];
$tmp['rsn'] = empty($row['memo']) ? 'Unknown adjustment' : $row['memo'];
$tmp['rsn'] = str_replace("Ins1", $ins_data['primary'], $tmp['rsn']);
$tmp['rsn'] = str_replace("Ins2", $ins_data['secondary'], $tmp['rsn']);
Expand Down
Loading

0 comments on commit babec93

Please sign in to comment.