From: Kevin McCormick Date: Thu, 15 Nov 2012 02:14:08 +0000 (-0600) Subject: edihistory -- claim status, fixed locating response in 277 file issues; csvTable... X-Git-Tag: whats-been-changed~485^2 X-Git-Url: https://repo.or.cz/w/openemr.git/commitdiff_plain/3d14e83f59662affdbd73d560ac18cfca855a7b4 edihistory -- claim status, fixed locating response in 277 file issues; csvTable, end date variable --- diff --git a/library/edihistory/ibr_277_read.php b/library/edihistory/ibr_277_read.php index a089f542e..2e020f977 100644 --- a/library/edihistory/ibr_277_read.php +++ b/library/edihistory/ibr_277_read.php @@ -1756,11 +1756,6 @@ function ibr_277_bhtblock($segments, $delimiters, $clm01 = '', $bht03 = '', $st0 if (!$clm01 && !$bht03 && !$st02) { csv_edihist_log ("ibr_277_bhtblock: no specifier arguments given"); return false; - } elseif (($bht03 == '0123' || strlen($bht03) != 13) && !$clm01 && !$st02) { - // OpenEMR presently gives all BHT03 value of '0123' in batch files - //echo "ibr_277_bhtblock: bht03 useless $bht03 with no clm01 or st02".PHP_EOL; - csv_edihist_log ("bht03 useless $bht03 with no isa13 or st02"); - return false; } elseif (strpos($st02, '_')) { $dpos = strpos($st02, '_'); $srchval = substr($st02, $dpos+1); @@ -1776,11 +1771,15 @@ function ibr_277_bhtblock($segments, $delimiters, $clm01 = '', $bht03 = '', $st0 } elseif (strlen($clm01) && !strpos($clm01, '-')) { $useenc = true; $srchval = strval($clm01); + } else { + csv_edihist_log ("error: status response - unable to determine search string"); + return false; } // $isastr = 'ISA'.$elem_d; $ststr = 'ST'.$elem_d; $trnstr = 'TRN'.$elem_d.'2'.$elem_d; + $bhtstr = 'BHT'.$elem_d; $sestr = 'SE'.$elem_d; $idx = -1; // @@ -1808,15 +1807,26 @@ function ibr_277_bhtblock($segments, $delimiters, $clm01 = '', $bht03 = '', $st0 } continue; } + // use the BHT03 reference from the file + if (substr($segstr, 0, 4) == $bhtstr && $usebht ) { + $seg = explode($elem_d, $segstr); + if ($seg[3] === $srchval) { + $isfound = true; + $slice_ar[0] = $stpos; + } + } // - if (substr($segstr, 0, 6) == $trnstr) { - $seg = explode($elem_d, $segstr); - if ($seg[2] == $srchval) { - $isfound = true; - $slice_ar[0] = $stpos; - } - + if (substr($segstr, 0, 6) == $trnstr) { + if ($useclm) { + $seg = explode($elem_d, $segstr); + if ($seg[2] == $srchval) { + $isfound = true; + $slice_ar[0] = $stpos; + } + } + if ($useenc) { + $seg = explode($elem_d, $segstr); if (substr($seg[2], -strlen($srchval)) == $srchval) { $isfound = true; $slice_ar[0] = $stpos; diff --git a/library/edihistory/ibr_io.php b/library/edihistory/ibr_io.php index b585236d4..3ed076def 100644 --- a/library/edihistory/ibr_io.php +++ b/library/edihistory/ibr_io.php @@ -72,7 +72,7 @@ function ibr_html_heading($option, $title='') { // //if (!is_string($title)) { $title=''; } $title = (is_string($title)) ? $title : ''; - $srcdir = $GLOBALS['srcdir']; + //$srcdir = $GLOBALS['srcdir']; $webdir = $GLOBALS['webroot']; $str_html = "".PHP_EOL."".PHP_EOL."".PHP_EOL; @@ -326,7 +326,7 @@ function ibr_disp_csvtable() { // $row_pct = ($rowp) ? $rowp/100 : 1; if ($ds == NULL || $ds === FALSE ) { $ds = ''; } - if ($de == NULL) { $e = ($ds) ? date("Y/M/D", time()) : ''; } + if ($de == NULL) { $de = ($ds) ? date("Y/M/D", time()) : ''; } if ($csvfile == NULL || $csvfile === FALSE ) { // here we have an error and must quit $str_html= "

Error in CSV table name

".PHP_EOL; @@ -483,7 +483,8 @@ function ibr_disp_status_resp() { $st = ''; $pe = ''; if (isset($_GET['pidenc']) && strlen($_GET['pidenc'])) { $pe = filter_input(INPUT_GET, 'pidenc', FILTER_SANITIZE_STRING); - } elseif (isset($_GET['rspstnum']) && strpos($_GET['rspstnum'], '_')) { + } + if (isset($_GET['rspstnum']) && strpos($_GET['rspstnum'], '_')) { // the rspstnum is the 277 ISA13_ST02 $st = filter_input(INPUT_GET, 'rspstnum', FILTER_SANITIZE_STRING); }