From 9de263b52e923aff1fc8cb4c4476cbf36331df71 Mon Sep 17 00:00:00 2001 From: bradymiller Date: Sat, 16 Jun 2012 16:17:24 -0700 Subject: [PATCH] Support for storing code type in justify column of billing sql table --- interface/forms/fee_sheet/new.php | 2 +- library/Claim.class.php | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/interface/forms/fee_sheet/new.php b/interface/forms/fee_sheet/new.php index 1dadc3060..6edb4c85f 100644 --- a/interface/forms/fee_sheet/new.php +++ b/interface/forms/fee_sheet/new.php @@ -46,7 +46,7 @@ function endFSCategory() { function genDiagJS($code_type, $code) { global $code_types; if ($code_types[$code_type]['diag']) { - echo "diags.push('" . attr($code) . "');\n"; + echo "diags.push('" . attr($code_type) . "|" . attr($code) . "');\n"; } } diff --git a/library/Claim.class.php b/library/Claim.class.php index bb85e8681..ff65883a4 100644 --- a/library/Claim.class.php +++ b/library/Claim.class.php @@ -1128,7 +1128,15 @@ class Claim { $atmp = explode(':', $row['justify']); foreach ($atmp as $tmp) { if (!empty($tmp)) { - $diag = str_replace('.', '', $tmp); + $code_data = explode('|',$tmp); + if (!empty($code_data[1])) { + //Strip the prepended code type label + $diag = str_replace('.', '', $code_data[1]); + } + else { + //No prepended code type label + $diag = str_replace('.', '', $code_data[0]); + } $da[$diag] = $diag; } } @@ -1166,7 +1174,15 @@ class Claim { $atmp = explode(':', $this->procs[$prockey]['justify']); foreach ($atmp as $tmp) { if (!empty($tmp)) { - $diag = str_replace('.', '', $tmp); + $code_data = explode('|',$tmp); + if (!empty($code_data[1])) { + //Strip the prepended code type label + $diag = str_replace('.', '', $code_data[1]); + } + else { + //No prepended code type label + $diag = str_replace('.', '', $code_data[0]); + } $i = 0; foreach ($da as $value) { ++$i; -- 2.11.4.GIT