xiaoanri wrote on Saturday, September 27, 2008:
I have tried the old version of gen_x12_837.inc.php and did not see any difference in the "HI" segment. Also checked and OfficeAlly configuration, it was standard. I compared the section in gen_x12_837.php file (from 2.9.0 vs 2.8.3) and found they are exactly the same:
$da = $claim->diagArray();
++$edicount;
$out .= “HI”; // Health Diagnosis Codes
$diag_type_code = ‘BK’;
foreach ($da as $diag) {
$out .= “*$diag_type_code:” . $diag;
$diag_type_code = ‘BF’;
}
$out .= “~\n”;
Then I looked at the Claim.class.php file in library folder, and found the relative section was changed:
In version 2.8.3, from line 748:
// Returns an array of unique primary diagnoses. Periods are stripped.
function diagArray() {
$da = array();
foreach ($this->procs as $row) {
$tmp = explode(’:’, $row[‘justify’]);
if (count($tmp)) {
$diag = str_replace(’.’, ‘’, $tmp[0]);
$da[$diag] = $diag;
}
}
return $da;
}
// Compute the 1-relative index in diagArray for the given procedure.
function diagIndex($prockey) {
$da = $this->diagArray();
$tmp = explode(’:’, $this->procs[$prockey][‘justify’]);
if (empty($tmp)) return ‘’;
$diag = str_replace(’.’, ‘’, $tmp[0]);
$i = 0;
foreach ($da as $value) {
++$i;
if (strcmp($value,$diag) == 0) return $i;
}
return ‘’;
}
In version 2.9.0, from line 880:
// Returns an array of unique diagnoses. Periods are stripped.
function diagArray() {
$da = array();
foreach ($this->procs as $row) {
$atmp = explode(’:’, $row[‘justify’]);
foreach ($atmp as $tmp) {
if (!empty($tmp)) {
$diag = str_replace(’.’, ‘’, $tmp);
$da[$diag] = $diag;
}
}
}
return $da;
}
// Compute one 1-relative index in diagArray for the given procedure.
// This function is obsolete, use diagIndexArray() instead.
function diagIndex($prockey) {
$da = $this->diagArray();
$tmp = explode(’:’, $this->procs[$prockey][‘justify’]);
if (empty($tmp)) return ‘’;
$diag = str_replace(’.’, ‘’, $tmp[0]);
$i = 0;
foreach ($da as $value) {
++$i;
if (strcmp($value,$diag) == 0) return $i;
}
return ‘’;
}
// Compute array of 1-relative diagArray indices for the given procedure.
function diagIndexArray($prockey) {
$dia = array();
$da = $this->diagArray();
$atmp = explode(’:’, $this->procs[$prockey][‘justify’]);
foreach ($atmp as $tmp) {
if (!empty($tmp)) {
$diag = str_replace(’.’, ‘’, $tmp);
$i = 0;
foreach ($da as $value) {
++$i;
if (strcmp($value,$diag) == 0) $dia[] = $i;
}
}
}
return $dia;
}
Then I tried to replace line 886 in new version:
" if (!empty($tmp)) {"
with line 753 in old version:
" if (count($tmp)) {"
That change added the "BK:" after the "HI", instead of "~HI~NM1…", now I got "~HI*BK:~NM1…". There is still no diagnosis code after "BK:". Also of interest is I assume the secondary diagnosis code should show after "BF:" after looking at the code, but found none of the prior X12 files I sent out before with OEMR 2.8.3 had secondary diagonosis or BF code. I do not know if this is my own problem or a common problem?
Do not know what to do next. Any comments appreciated!
Hui