What Is an Entity Code in Medical Billing?
An entity code in medical billing is a two-character identifier used in EDI transactions (such as the 837 claim) to define the role of each party involved in a healthcare claim. These codes identify whether a party is the billing provider, rendering provider, patient, subscriber, or referring provider.
Entity codes ensure that payer systems correctly interpret claim data and match each provider, patient, and organization to the appropriate role during claim processing.
Let say an insurance payer denies a claim because of an entity qualifier or entity code mismatch. The biller stares at it for a moment, runs a quick search, gets a vague answer about EDI loops and segments, and eventually calls the clearinghouse for help. Twenty minutes later, the fix is made, and the claim goes out again.
That scenario repeats itself in billing offices more often than it should. Entity codes are not a complicated concept once they are explained properly. But because they live mostly inside the technical structure of electronic claim transactions rather than on the face of a paper claim, many billers who work with claims every day have never had the concept laid out clearly.
Entity codes tell an electronic claim transaction which party each party is. Not by name. By role. They identify whether a given name and NPI on the claim belongs to the billing provider, the rendering provider, the referring provider, the patient, the subscriber, or a handful of other parties that might be involved in a healthcare transaction. Without entity codes, the receiving system cannot sort out which NPI belongs to whom or which address corresponds to which party.
This guide covers what entity codes are, where they appear, which ones show up most frequently in medical billing, and why getting them wrong causes claims to be rejected.
Entity Codes Live Inside EDI Transactions
To understand entity codes, it helps to understand where they actually live. In medical billing, claims are submitted electronically using the HIPAA-mandated EDI 837 transaction set. The 837P is the professional claim format used by physician practices. The 837I is the institutional claim format used by hospitals. Both are structured documents made up of loops and segments that organize every piece of information on the claim into a predictable format that receiving systems can parse.
Within those EDI transactions, each party involved in the claim is introduced with an entity identifier code, sometimes called an entity qualifier or entity type code. This is a short code that tells the receiving system the role of the name, address, and identification information that follows it.
The American National Standards Institute, which maintains the X12 EDI standards used in healthcare, defines dozens of entity qualifier codes. In practice, a much smaller set appears on medical claims regularly. Knowing those codes and what they mean is what turns entity code errors from mysterious rejections into straightforward fixes.
Entity Codes vs. Entity Type Codes: A Quick Clarification
One source of terminology confusion is the difference between entity qualifier codes and entity type codes. Both appear in the EDI 837, and both describe parties to the transaction, but they do different things.
Entity qualifier codes, the two-character codes like 82, 85, DN, PR, and IL, identify the role of a party. Entity type codes describe whether that party is a person or an organization. A rendering provider who is an individual physician has an entity type code 1. A billing provider that is a group practice has an entity type code 2. When entity type code 1 is used for a group NPI, or entity type code 2 is used for an individual NPI, payers that validate this field will reject the claim.
Most practice management systems handle entity type codes automatically based on how provider records are set up. But in practices where provider records were manually configured or migrated from an older system, the entity type code may be set incorrectly. It is worth checking in the provider setup if entity code rejections are occurring and the entity qualifier looks correct.
Entity codes are a small part of the claim structure that has a disproportionate impact when they are wrong. They are not difficult to understand once the concept is clear, and most entity code errors follow predictable patterns that are entirely fixable with the right provider setup and data entry practices. Billing teams that understand what each code represents and where it belongs spend less time chasing rejections and more time working claims that actually need clinical or coverage investigation.
Key Attributes of Entity Codes in Medical Billing
Entity codes are defined by several key attributes that determine how claims are processed:
- Role Identification: Defines the function of each party (e.g., billing provider, rendering provider, patient)
- EDI Placement: Appears within specific loops and segments of the 837 transaction
- NPI Association: Links each entity code to the correct National Provider Identifier (NPI)
- Data Validation: Used by payer systems to validate claim structure and provider relationships
- Compliance Requirement: Required for HIPAA-compliant electronic claim submission
These attributes ensure that every claim is structured correctly and interpreted accurately by clearinghouses and payers.
The Entity Codes That Appear Most Often in Medical Billing

Rather than a theoretical walkthrough of every possible entity code, what follows covers the specific codes that billing teams actually encounter and that cause claim rejections when they are wrong.
PR: Patient
The PR entity code identifies the patient receiving the services. In the EDI 837, the PR loop carries the patient’s name, date of birth, gender, and address. The patient information loop is separate from the subscriber loop because the patient and the subscriber are not always the same person.
When a parent brings a child in for care, and the parent holds the insurance, the subscriber is the parent, and the patient is the child. The claim needs both a subscriber loop and a separate patient loop. Each is tagged with its correct entity code. When a claim has only a subscriber loop and no separate patient loop, and the patient is a different person from the subscriber, the claim will often fail eligibility matching because the insurance company cannot identify whose care is being billed.
IL: Insured or Subscriber
The IL entity code identifies the subscriber, the person who holds the insurance policy. This is the party whose member ID, group number, and plan information appear on the insurance card. When the patient is the policyholder, IL and PR may refer to the same person. When a child is being treated under a parent’s policy, IL identifies the parent and PR identifies the child.
Getting the IL and PR relationship right is the most common fix in entity code troubleshooting. Billing teams who enter the child’s name and date of birth in the subscriber fields, rather than the parent’s information, generate claims that do not match the payer’s enrollment records for the subscriber. The eligibility check fails, or the claim is rejected because the subscriber information does not correspond to any active policy in the payer’s system.
82: Rendering Provider
Entity code 82 identifies the rendering provider, the clinician who actually performed the service. This is the individual whose NPI goes in the rendering provider loop. In group practices, the rendering NPI is the individual physician’s NPI, not the group’s NPI.
A claim that has only a group NPI and no rendering provider NPI will process incorrectly at many payers. Some payers pay at lower rates or deny claims that cannot attribute the service to a specific credentialed rendering provider. Medicare specifically requires the rendering provider’s individual NPI on professional claims. Leaving it off is a compliance gap that also causes payment delays.
85: Billing Provider
Entity code 85 identifies the billing provider, the entity submitting the claim and receiving payment. For group practices, this is typically the group practice with its group NPI and tax ID. For solo practitioners, the billing provider and the rendering provider are the same person. For employed physicians in a hospital-based setting, the billing entity may be the hospital system rather than the individual physician.
The billing provider NPI is used for credentialing and contract purposes. The rendering provider NPI is used to attribute the service. Both need to be present and correctly assigned on most claims. When a claim has the rendering provider’s individual NPI in the billing provider loop, payments can go to the wrong NPI, create contract matching issues, or generate credentialing mismatch errors.
DN: Referring Provider
Entity code DN identifies the referring physician. Not every claim requires a referring provider. But for managed care plans with referral requirements, for certain diagnostic services, and for Medicare claims where a referral was made, the referring provider loop must be present and must identify the correct physician by name and NPI.
A claim submitted without a referring provider NPI to a payer that requires one will be rejected. A claim submitted with a referring provider NPI that does not match an active, enrolled provider in the payer’s system will often be rejected as well. When a referring physician is not enrolled with a specific commercial payer, some payers accept claims without the referring NPI, while others require it regardless of the referring physician’s enrollment status. Know each payer’s requirement before defaulting to leaving the field empty.
77: Service Location
Entity code 77 identifies the service facility location where the service was performed. This is distinct from the billing provider address. A physician practice that owns multiple clinic locations, or a physician who performs procedures at a hospital outpatient department, needs the service facility address correctly populated so the claim places the service at the right physical location.
Place of service codes on the claim tell payers the setting type. The service facility address in the 77 loop tells them the specific physical address. Some payers verify that the place of service code matches the type of facility at the address in the 77 loop. A mismatch between the two, such as a place of service code for an office with a hospital address in the service facility loop, can trigger an edit or denial.
FA: Facility
Entity code FA identifies the facility, typically the hospital or ambulatory surgery center, where a procedure was performed. This code appears on institutional claims and on professional claims for facility-based procedures. The FA loop carries the facility’s NPI and address.
Common Entity Codes in Medical Billing
| Entity Code | Role | Description |
| PR | Patient | Identifies the patient receiving services |
| IL | Subscriber | Identifies the insurance policyholder |
| 82 | Rendering Provider | The provider who performed the service |
| 85 | Billing Provider | The entity submitting the claim |
| DN | Referring Provider | The physician who referred the patient |
| 77 | Service Location | Physical location where services were performed |
| FA | Facility | Facility where procedures occurred |
How Entity Code Errors Cause Claim Rejections
When an entity code is wrong, missing, or applied to the wrong NPI, the receiving system cannot correctly interpret who is who on the claim. The system may try to match the wrong NPI against its provider enrollment database and fail. It may route payment to the wrong entity. It may reject the claim outright with a rejection reason that references the entity code directly or that describes a downstream consequence like an invalid NPI or a provider not found.
The most common root causes of entity code errors in practice management systems are:
- Rendering provider NPI entered in the billing provider field or vice versa. Common practice is that provider records are set up incorrectly at implementation and are never audited.
- Subscriber and patient information are swapped when the patient is a dependent. The parents’ information should populate the IL subscriber loop, and the child’s information should populate the PR patient loop.
- Missing referring provider loop when the payer requires one. The field was left blank because the physician was self-referred, or the staff did not know a referring NPI was required.
- Wrong NPI type. Individual NPI used where a group NPI is required, or the group NPI used where an individual NPI is required. Both are valid NPIs, but in different entity roles.
- The service facility address is missing or populated with the billing provider address when the service was performed at a different location.
Real-World Impact of Entity Code Errors on Revenue Cycle
Entity code errors may seem technical, but their impact on the revenue cycle is significant.
In practice, these errors can lead to:
- Repeated claim rejections for the same provider
- Delays in payment processing and increased AR days
- Incorrect payment routing due to billing/rendering mismatches
- Increased administrative workload for billing teams
At Medhasty, we often find that recurring entity code errors stem from system-level setup issues rather than individual claim mistakes. Once corrected at the source, rejection rates drop significantly, and claim processing becomes more predictable.
Common Entity Code Errors and Rejections
Entity code errors are a frequent cause of claim rejections in EDI 837 transactions. These errors typically occur when entity roles, NPIs, or relationships between parties are incorrect.
Common entity code errors include:
- Entity qualifier mismatch (incorrect role assignment)
- Rendering provider NPI is placed in the billing provider loop
- Subscriber and patient roles reversed
- Missing referring provider when required
- Incorrect entity type code (individual vs organization)
👉 These errors prevent payer systems from validating the claim correctly, resulting in rejections or delayed payments.
Finding and Fixing Entity Code Errors
When a claim is rejected for an entity code issue, the rejection message from the clearinghouse will usually identify the specific loop and segment where the error occurred. That information looks technical, but it is actually precise. A rejection that says NM1 loop 2310B entity qualifier mismatch is pointing to the rendering provider loop, which is where the 82 entity code and the rendering NPI should appear.
The fix process involves opening the rejected claim in the practice management system, locating the affected loop or field, correcting the entity code or the NPI assignment, and resubmitting. Most clearinghouses show the raw EDI transaction alongside a readable claim view, which makes it easier to identify which field was wrong without needing to parse raw X12 code.
Practices that see repeated entity code rejections for the same type of error are dealing with a setup problem, not a one-off data entry mistake. If every claim for a particular rendering provider is rejected because the entity code is wrong, the provider record in the practice management system was configured incorrectly. The fix is at the provider setup level, not at the individual claim level.
How to Fix Entity Code Errors in Medical Billing
Fixing entity code errors requires identifying the issue at both the claim and system levels:
- Review the Rejection Message
Identify the loop and segment (e.g., NM1 loop 2310B) where the error occurred. - Verify Entity Code and Role
Confirm that each entity code matches the correct role (billing, rendering, patient, etc.). - Check NPI Assignment
Ensure the correct NPI is assigned to the appropriate entity. - Validate Patient and Subscriber Information
Confirm that PR (patient) and IL (subscriber) roles are correctly assigned. - Correct Provider Setup (If Recurring)
Fix provider records in your practice management system to prevent repeated errors. - Resubmit the Claim
After corrections, resubmit the claim through the clearinghouse.
Most entity code issues are not one-time errors — they originate from incorrect system setup.
How Entity Codes Relate to EDI 837 and Claim Processing
Entity codes are part of the broader EDI 837 claim structure, which organizes all claim data into loops and segments for electronic processing.
Within this structure:
- Entity codes define roles
- Loops define relationships between entities
- Segments define specific data elements
Together, these components ensure that healthcare claims are transmitted, validated, and processed accurately across clearinghouses and payer systems.
How Medhasty Helps Fix and Prevent Entity Code Errors
Medhasty Medical Billing Services works with healthcare practices to identify and resolve entity code issues at both the claim and system level.
Our approach includes:
- Reviewing provider setup to ensure correct NPI and entity role mapping
- Auditing rejected claims to identify recurring entity code mismatches
- Validating EDI 837 configurations and clearinghouse responses
- Implementing workflow checks to prevent future errors
By addressing the root cause, not just individual claim errors, we help practices reduce rejections and improve overall billing efficiency.
Final Thoughts
Entity codes sit in the background, but they control how every claim gets interpreted. When they’re right, claims move cleanly through clearinghouses and payer systems. When they’re wrong, even a perfectly coded visit can stall or reject.
The takeaway is simple. Entity codes are not guesswork. Each one maps to a specific role, and each role must align with the correct NPI, name, and address. Once a billing team understands that structure, most “mysterious” rejections stop being mysterious.
In day-to-day operations, the real win comes from prevention. Clean provider setup, accurate patient and subscriber entry, and routine audits eliminate most entity code issues before a claim ever leaves the system. That means fewer rejections, faster payments, and less time spent fixing avoidable errors.
At the end of the day, entity codes are not just technical details. They are part of the foundation of clean claims. Get them right once, systemwide, and the entire revenue cycle runs smoother.
Frequently Asked Questions About Entity Codes
What is an entity code in an 837 claim?
An entity code in an 837 claim identifies the role of each party, such as billing provider, rendering provider, patient, or subscriber.
What causes entity code rejection?
Entity code rejections occur when roles, NPIs, or entity relationships are incorrectly assigned in the claim.
What is the difference between PR and IL?
PR represents the patient, while IL represents the subscriber or policyholder.
What is an entity qualifier in EDI?
An entity qualifier is a code used in EDI transactions to define the role of a party, such as a billing provider, rendering provider, or subscriber.
What is an entity code mismatch?
An entity code mismatch occurs when the assigned role does not align with the correct NPI or claim structure, causing claim rejection.