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
- Create a patient with Medicare Part B as primary insurance
- Add a Medicare Supplement (e.g., Cigna Medicare Supplement, Aetna Senior Supplemental, AARP, Mutual of Omaha Supplement) as secondary insurance
- Generate an 837p claim file for this patient
- 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:
SBR*S*18*******MB~
Actual Behavior
The SBR05 field is blank because MB is not available as a policy type option:
SBR*S*18*******~
The clearinghouse returns the following rejection:
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
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
{# 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_typein theinsurance_datatable can run the following SQL to bulk-fix affected records:
sql
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
requiredattribute on the select field may need to be enforced via JavaScript validation in addition to HTML5requireddepending on how OpenEMR handles form submission, as some forms use AJAX submission that bypasses native HTML5 validation.
References
Reported by Jeff Guillory, NP Health Clinic, Lumberton TX Discovered during 837p claim rejection analysis