Bug Report: SBR02 Subscriber Relationship Code Missing for Non-Self Subscribers in 837P Generator

Component: src/Billing/X125010837P.php

Affected Versions: Unknown — likely affects all current versions

Severity: High — causes claim rejections at clearinghouse level for all dependent (non-self) subscriber claims


Description:

In X125010837P.php, the SBR segment (Loop 2000B, Subscriber Information) generates an empty SBR02 element for any claim where the patient is not the subscriber (spouse, child, other dependent). This causes clearinghouse rejections with errors such as:

  • “Entity’s Group Name — This code requires use of an Entity Code”
  • “Information submitted inconsistent with billing guidelines”
  • “Unrecognized data was found in Loop 2010BB”

Root Cause:

Line ~402 in X125010837P.php:

php

"*" . ($claim->isSelfOfInsured() ? '18' : '') .

This ternary returns '18' for self subscribers but an empty string for all other relationships (spouse, child, other). The X12 005010X222A1 standard requires a valid relationship code in SBR02 for all claims.


The Fix:

The Claim class already contains a correct insuredRelationship() method in Claim.php that properly maps all relationship types:

php

public function insuredRelationship($ins = 0)
{
    $tmp = strtolower(($this->payers[$ins]['data']['subscriber_relationship'] ?? ''));
    if (strcmp($tmp, 'self') == 0)   return '18';
    if (strcmp($tmp, 'spouse') == 0) return '01';
    if (strcmp($tmp, 'child') == 0)  return '19';
    if (strcmp($tmp, 'other') == 0)  return 'G8';
    return $tmp;
}

Replace the ternary with a call to this existing method:

Before:

php

"*" . ($claim->isSelfOfInsured() ? '18' : '') .

After:

php

"*" . $claim->insuredRelationship() .

Impact:

  • All claims where the patient is a spouse, child, or other dependent of the subscriber generate an empty SBR02
  • Many payers (UMR, Aetna, UnitedHealthcare) reject these claims at the clearinghouse level
  • Some payers (BCBS Texas in our experience) may accept the blank code, masking the issue
  • The bug affects every practice using OpenEMR to bill dependent claims

Steps to Reproduce:

  1. Create a patient who is a dependent (spouse or child) on another person’s insurance
  2. Set subscriber relationship to “Spouse” or “Child” in the insurance record
  3. Generate an 837P batch file
  4. Inspect the SBR segment — SBR02 will be empty (SBR*P**groupnumber...)

Expected: SBR*P*01*groupnumber... (spouse) or SBR*P*19*groupnumber... (child)

Actual: SBR*P**groupnumber... (empty relationship code)


Tested Fix: Confirmed working in production. Replacing the ternary with $claim->insuredRelationship() correctly generates 01 for spouse and 19 for child relationships without any other side effects.


Reported by Jeff Guillory, NP Health Clinic PLLC, Lumberton TX

Subject: SBR02 Relationship Code — Reverting Fix After Payer Rejections

We recently patched X125010837P.php to populate SBR02 with the relationship code for non-self subscribers (spouse → 01, child → 19) using the existing insuredRelationship() method in Claim.php.

After submitting live claims, we received clearinghouse rejections from UMR (error 0x810024) and BCBS Texas (error 0x39392f2) explicitly rejecting 01 in SBR02 when the patient is not the subscriber. BCBS Texas specifically states SBR02 should not be used when HL04 is 1 (patient ≠ subscriber).

We are reverting to the original blank behavior. The blank SBR02 for dependents has been accepted by Aetna, BCBS Texas, Humana, and UHC without issue.

Conclusion: SBR02 for dependent claims should remain blank. The X12 standard marks it situational, and major payers prefer it absent when the subscriber and patient differ. Populating it causes active rejections.

Posting in case others encounter the same issue.

I apologize. I will be sure to test more thoroughly before posting in the future.