# Bug: Missing MB (Medigap/Medicare Supplement) Policy Type Causes SBR05 Rejection in 837p Claims

**URL:** <https://community.open-emr.org/t/bug-missing-mb-medigap-medicare-supplement-policy-type-causes-sbr05-rejection-in-837p-claims/26736>\
**Category:** Management and Administration\
**Created:** [April 27, 2026, 11:30pm UTC](https://community.open-emr.org/t/bug-missing-mb-medigap-medicare-supplement-policy-type-causes-sbr05-rejection-in-837p-claims/26736 "2026-04-27T23:30:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nursejeff](https://community.open-emr.org/user_avatar/community.open-emr.org/nursejeff/32/12437_2.png) [@nursejeff](https://community.open-emr.org/u/nursejeff)\
**Post date:** [April 27, 2026, 11:30pm UTC](https://community.open-emr.org/t/bug-missing-mb-medigap-medicare-supplement-policy-type-causes-sbr05-rejection-in-837p-claims/26736/1 "2026-04-27T23:30:06Z")

</div>

## Summary

The `MB` insurance type code for Medigap/Medicare Supplement plans is missing from `InsurancePolicyTypes.php`. This causes the SBR05 field in outbound 837p claim files to be left blank when a patient has Medicare Part B as primary and a Medicare supplement plan as secondary. The result is a clearinghouse rejection for every affected claim.

## Environment

- OpenEMR Version: 7.0.2
- Billing Standard: 837p / 005010X222A1
- Clearinghouse: Availity

## Steps to Reproduce

1. Create a patient with **Medicare Part B** as primary insurance
2. Add a **Medicare Supplement** (e.g., Cigna Medicare Supplement, Aetna Senior Supplemental, AARP, Mutual of Omaha Supplement) as secondary insurance
3. Generate an 837p claim file for this patient
4. Submit to clearinghouse

## Expected Behavior

The generated 837p SBR segment for the secondary insurance should contain `MB` in the SBR05 field, indicating the secondary is a Medigap/Medicare Supplement plan:

```auto
SBR*S*18 ******* MB~

```

## Actual Behavior

The SBR05 field is blank because `MB` is not available as a policy type option:

```auto
SBR*S*18 ******* ~

```

The clearinghouse returns the following rejection:

```auto
Element SBR05 is missing. It is required when SBR01 is not 'P' and payer is Medicare.
Segment SBR is defined in the guideline at position 2900.

```

## Root Cause

`src/Billing/InsurancePolicyTypes.php` does not include the `MB` policy type code. The 837p standard defines `MB` as a valid and commonly required value for Medicare Secondary Payer (MSP) situations involving Medigap/supplement plans. Without it appearing in the UI dropdown, staff have no way to set this value, and the SBR05 field is left empty in the generated 837p.

The affected file currently defines these policy types:

| Code | Description |
| --- | --- |
| 12 | Working Aged Beneficiary with Employer Group Health Plan |
| 13 | End-Stage Renal Disease Beneficiary in MCP with Employer’s Group Plan |
| 14 | No-fault Insurance including Auto is Primary |
| 15 | Worker’s Compensation |
| 16 | Public Health Service or Other Federal Agency |
| 41 | Black Lung |
| 42 | Veterans Administration |
| 43 | Disabled Beneficiary Under Age 65 with LGHP |
| 47 | Other Liability Insurance is Primary |

`MB` (Medigap/Medicare Supplement) is absent despite being one of the most common Medicare secondary payer scenarios in clinical practice.

## Impact

This bug affects **any practice** that:

- Treats Medicare patients who also carry a Medicare supplement (Medigap) policy
- Bills Medicare as primary and a supplement as secondary

In our practice alone, we identified **35 patients** whose claims were being rejected because of this missing code. Medicare supplement plans (Aetna Senior Supplemental, Cigna Medicare Supplement, AARP UHC Supplement, Mutual of Omaha Supplement, etc.) are extremely common among Medicare-age patients, making this a widespread issue.

## Fix

### 1. `src/Billing/InsurancePolicyTypes.php`

Add the `MB` constant and include it in the `POLICY_TYPES` array and `getTranslatedPolicyTypes()` method:

php

```auto
const POLICY_TYPE_OTHER_LIABILITY_INSURANCE_IS_PRIMARY = '47';
const POLICY_TYPE_MEDIGAP_MEDICARE_SUPPLEMENT = 'MB'; // ADD THIS

const POLICY_TYPES = [
    // ... existing types ...
    self::POLICY_TYPE_OTHER_LIABILITY_INSURANCE_IS_PRIMARY,
    self::POLICY_TYPE_MEDIGAP_MEDICARE_SUPPLEMENT // ADD THIS
];

public static function getTranslatedPolicyTypes()
{
    return [
        // ... existing entries ...
        self::POLICY_TYPE_OTHER_LIABILITY_INSURANCE_IS_PRIMARY => xlt('Other Liability Insurance is Primary'),
        self::POLICY_TYPE_MEDIGAP_MEDICARE_SUPPLEMENT => xlt('Medigap / Medicare Supplement') // ADD THIS
    ];
}

```

### 2. `templates/patient/insurance/_insurance_edit_screen_edit.html.twig`

Make the Secondary Medicare Type field required and add a blank default option to force conscious selection by staff:

twig

```auto
{# BEFORE #}
<span data-validation-field="policy_type">{{ 'Secondary Medicare Type'|xlt }}:</span>
...
<select class='form-control form-control-sm mb-1 sel2' name='form_policy_type'>
    {% for key,value in policy_types %}
        <option value="{{ key|attr }}">{{ value|text }}</option>
    {% endfor %}
</select>

{# AFTER #}
<span data-validation-field="policy_type" style="color:red;font-weight:bold;">{{ 'Secondary Medicare Type'|xlt }}:</span>
...
<select class='form-control form-control-sm mb-1 sel2' name='form_policy_type' required>
    <option value="">{{ 'Select Type'|xlt }}</option>
    {% for key,value in policy_types %}
        <option value="{{ key|attr }}">{{ value|text }}</option>
    {% endfor %}
</select>

```

## Additional Notes

- Practices that already have patients with Medicare supplement secondaries and blank `policy_type` in the `insurance_data` table can run the following SQL to bulk-fix affected records:

sql

```auto
UPDATE insurance_data id
JOIN insurance_companies ins ON id.provider = ins.id
SET id.policy_type = 'MB'
WHERE id.type = 'secondary'
AND (id.policy_type = '' OR id.policy_type IS NULL)
AND (
    ins.name LIKE '%supplement%'
    OR ins.name LIKE '%medigap%'
    OR ins.name LIKE '%senior%'
    OR ins.name LIKE '%aflac%aetna%'
);

```

- The `required` attribute on the select field may need to be enforced via JavaScript validation in addition to HTML5 `required` depending on how OpenEMR handles form submission, as some forms use AJAX submission that bypasses native HTML5 validation.

## References

- [837p Implementation Guide - Loop 2000B SBR Segment](https://www.cms.gov/medicare/billing/electronicbillingediforms/downloads/837p-CMS-1450.pdf)
- [CMS Medicare Secondary Payer MSP Type Codes](https://www.cms.gov/Medicare/Coordination-of-Benefits-and-Recovery/Coordination-of-Benefits-and-Recovery-Overview/Medicare-Secondary-Payer/Medicare-Secondary-Payer)

* * *

_Reported by Jeff Guillory, NP Health Clinic, Lumberton TX_ _Discovered during 837p claim rejection analysis_

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [April 27, 2026, 11:46pm UTC](https://community.open-emr.org/t/bug-missing-mb-medigap-medicare-supplement-policy-type-causes-sbr05-rejection-in-837p-claims/26736/2 "2026-04-27T23:46:42Z")

</div>

hi @nursejeff, medigap insurers are usually commercial so ‘CI’ will do. That file you referenced is for secondary medicare type codes.
