X12 HL Segment Loop 2000C Error w/ Availity

anonymous wrote on Monday, March 08, 2010:

I am getting rejections from patients who are not the subscriber and it’s dealing with the following segment when submitting to Availity:

HL*3*2*23*0 ==> Segment Has Data Element Errors. Error in element: HL02 invalid code value; bad data: 2.back to 997-IT IS CAUSING THIS SEGMENT TO BE INVALID BECAUSE THERE IS NOT A PARENT HL TO LOOK FOR 

The reason for the rejection is because the trailing *0 should be *1 to indicate that there are segments to follow… because it’s set to *0 it’s telling availity that there no other segments. I took a look at the code and found the following:

  if (! $claim->isSelfOfInsured()) {
    $out .= “HL” .        // Loop 2000C Patient Information
      “*$HLcount” .
      “*$HLSubscriber” .
      “*23” .
      “*0” .


    $out .= “PAT” .
      “*” . $claim->insuredRelationship() .

    $out .= “NM1” .       // Loop 2010CA Patient
      “*QC” .
      “*1” .
      “*” . $claim->patientLastName() .
      “*” . $claim->patientFirstName() .
      “*” . $claim->patientMiddleName() .

    $out .= “N3” .
      “*” . $claim->patientStreet() .

    $out .= “N4” .
      “*” . $claim->patientCity() .
      “*” . $claim->patientState() .
      “*” . $claim->patientZip() .

    $out .= “DMG” .
      “*D8” .
      “*” . $claim->patientDOB() .
      “*” . $claim->patientSex() .
  } // end of patient different from insured

Now, If I change the HL segment to punch out *1 instead of *0… I am sure that would work just want to make sure that it’s not messing with any other part of the X12 logic and I wouldn’t be able to tell until I get an analysis back from Availity. So, I just want to see if any body else out there has experience this error before. This practice is using OpenEMR v3.2.0 on CentOS.


sunsetsystems wrote on Tuesday, March 09, 2010:

I think you need a better explanation from Availity.  The spec indicates that HL04 should be 0 in loop 2000C.



Which openemr file is the one that generates the code?