Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more billing fixes #4365

Merged
merged 8 commits into from May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions custom/code_types.inc.php
Expand Up @@ -218,7 +218,7 @@ function fees_are_used()
}

/**
* Checks is modifiers are applicable to any of the code types.
* Checks if modifiers are applicable to any of the code types.
* (If a code type is not set to show in the fee sheet, then is ignored)
*
* @param boolean $fee_sheet Will ignore code types that are not shown in the fee sheet
Expand Down Expand Up @@ -697,7 +697,8 @@ function lookup_code_descriptions($codes, $desc_detail = "code_text")
continue;
}

list($codetype, $code) = explode(':', $codestring);
// added $modifier for HCPCS and other internal codesets so can grab exact entry in codes table
list($codetype, $code, $modifier) = explode(':', $codestring);
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would document this exception on line 679 (and that will only work with internal codesets)

$table_id = $code_types[$codetype]['external'] ?? '';
if (isset($code_external_tables[$table_id])) {
$table_info = $code_external_tables[$table_id];
Expand Down Expand Up @@ -743,6 +744,12 @@ function lookup_code_descriptions($codes, $desc_detail = "code_text")
$sql .= $table_name . "." . $code_col . "=? ";
array_push($sqlArray, $code);

// Add the modifier if necessary for CPT and HCPCS which differentiates code
if ($modifier) {
$sql .= " AND modifier = ? ";
array_push($sqlArray, $modifier);
}

// We need to include the filter clauses
// For SNOMED and SNOMED-CT this ensures that we get the Preferred Term or the Fully Specified Term as appropriate
// It also prevents returning "inactive" results
Expand Down
2 changes: 1 addition & 1 deletion interface/forms/fee_sheet/new.php
Expand Up @@ -526,7 +526,7 @@ function echoProductLines()
//
if (!$alertmsg && (!empty($_POST['bn_save']) || !empty($_POST['bn_save_close']) || !empty($_POST['bn_save_stay']))) {
$main_provid = 0 + ($_POST['ProviderID'] ?? 0);
$main_supid = 0 + ($_POST['SupervisorID'] ?? 0);
$main_supid = 0 + (int)($_POST['SupervisorID'] ?? 0);

$fs->save(
$_POST['bill'],
Expand Down
4 changes: 2 additions & 2 deletions interface/patient_file/report/custom_report.php
Expand Up @@ -822,7 +822,7 @@ function zip_content($source, $destination, $content = '', $create = true)
if ($res[1] == 'newpatient') {
// display billing info
$bres = sqlStatement(
"SELECT b.date, b.code, b.code_text " .
"SELECT b.date, b.code, b.code_text, b.modifier " .
"FROM billing AS b, code_types AS ct WHERE " .
"b.pid = ? AND " .
"b.encounter = ? AND " .
Expand All @@ -834,7 +834,7 @@ function zip_content($source, $destination, $content = '', $create = true)
);
while ($brow = sqlFetchArray($bres)) {
echo "<div class='font-weight-bold d-inline-block'>&nbsp;" . xlt('Procedure') . ": </div><div class='text d-inline-block'>" .
text($brow['code']) . " " . text($brow['code_text']) . "</div><br />\n";
text($brow['code']) . ":" . text($brow['modifier']) . " " . text($brow['code_text']) . "</div><br />\n";
}
}

Expand Down
8 changes: 5 additions & 3 deletions interface/reports/criteria.tab.php
Expand Up @@ -254,9 +254,11 @@
<li class="list-group-item bg-light d-flex justify-content-between align-items-center">
<a class="link_submit" href="#" onclick="javascript:return SubmitTheScreen();"><strong><?php echo xlt('Update List') ?></strong></a><i id='update-tooltip' class="fa fa-info-circle fa-lg text-primary" aria-hidden="true"></i>
</li>
<li class="list-group-item bg-light">
<a class='link_submit' href="#" onclick="javascript:return SubmitTheScreenExportOFX();"><strong><?php echo xlt('Export OFX'); ?></strong></a>
</li>
<?php if (file_exists("$webserver_root/custom/BillingExport.php")) { ?>
<li class="list-group-item bg-light">
<a class='link_submit' href="#" onclick="javascript:return SubmitTheScreenExportOFX();"><strong><?php echo xlt('Export OFX'); ?></strong></a>
</li>
<?php } ?>
<li class="list-group-item bg-light">
<a class='link_submit' href="#" onclick="javascript:return SubmitTheScreenPrint();"><strong><?php echo xlt('View Printable Report'); ?></strong></a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion library/FeeSheet.class.php
Expand Up @@ -1127,7 +1127,7 @@ public function save(
} elseif (!$del) { // Otherwise it's a new item...
$logarr = array($code_type, $code, '', $pricelevel, $fee, $units, $provid, '');
$this->logFSMessage(xl('Item added'), '', $logarr);
$code_text = lookup_code_descriptions($code_type . ":" . $code);
$code_text = lookup_code_descriptions($code_type . ":" . $code . ":" . $modifier);
BillingUtilities::addBilling(
$this->encounter,
$code_type,
Expand Down
2 changes: 1 addition & 1 deletion library/report.inc
Expand Up @@ -277,7 +277,7 @@ function printPatientBilling($pid)
while ($result = sqlFetchArray($res)) {
echo "<span class='bold'>" . text(oeFormatSDFT(strtotime($result["date"]))) . " : </span>";
echo "<span class='text'>(" . text($result["code_type"]) . ") ";
echo $result['code_type'] == 'COPAY' ? text(oeFormatMoney($result['code'])) : text($result['code']);
echo $result['code_type'] == 'COPAY' ? text(oeFormatMoney($result['code'])) : (text($result['code']) . ":" . text($result['modifier']));
echo " - " . wordwrap(text($result['code_text']), 70, "\n", true) . "</span>";
echo "<br />\n";
}
Expand Down
12 changes: 0 additions & 12 deletions src/Billing/Claim.php
Expand Up @@ -1458,18 +1458,6 @@ public function diagArray($strip_periods = true)
}
}

// The above got all the diagnoses used for justification, in the order
// used for justification. Next we go through all diagnoses, justified
// or not, to make sure they all get into the claim. We do it this way
// so that the more important diagnoses appear first.
foreach ($this->diags as $diag) {
if ($strip_periods) {
$diag = str_replace('.', '', $diag);
}

$da[$diag] = $diag;
}

return $da;
}

Expand Down