Healthcare Claims Processing
Learn Healthcare Claims Processing as part of the Domain Knowledge learning path for software engineers and architects.
Healthcare claims processing is one of the most important business capabilities in the healthcare industry. It connects healthcare providers, insurance companies, patients, clearinghouses, and financial systems to determine how medical services are billed, evaluated, and paid.
For software engineers and solution architects, understanding claims processing is essential when designing healthcare platforms, insurance applications, revenue cycle management systems, payment services, and integrations between providers and payers.
In this article, we will explore the complete healthcare claims lifecycle, industry participants, electronic transaction standards, claim adjudication, denial management, system architecture, Java and Spring Boot implementation concepts, and practical design considerations.
1. What Is Healthcare Claims Processing?
Healthcare claims processing is the end-to-end workflow used to submit a request for payment for healthcare services, evaluate that request against applicable insurance benefits and payment rules, and determine the amount payable by the payer and the amount that may be the patient's responsibility.
A healthcare claim typically contains information about:
- The patient receiving healthcare services.
- The subscriber or member whose insurance coverage is being used.
- The healthcare provider delivering the services.
- Diagnoses associated with the services.
- Procedures, supplies, and other billed services.
- Service dates and locations.
- Charges and applicable codes.
- Insurance coverage and coordination of benefits.
- Payment decisions, adjustments, and patient responsibility.
Example
Imagine a patient visits a hospital for a medical procedure.
- The patient receives the service.
- The hospital records the encounter and captures the charges.
- The billing system generates a claim.
- The claim is submitted electronically, often through a clearinghouse.
- The insurance payer evaluates the claim.
- The payer determines the allowed amount, covered amount, adjustments, and patient responsibility.
- The payer sends a payment and/or remittance information.
- The hospital posts the payment and follows up on any remaining balance.
This workflow is part of the healthcare revenue cycle.
Important: A claim is a request for payment, not a guarantee that the provider will be paid the amount submitted.
2. Key Participants in Healthcare Claims
Healthcare claims processing involves several organizations and systems.
| Participant | Responsibility |
|---|---|
| Patient | Receives healthcare services and may owe deductibles, copayments, or coinsurance |
| Subscriber/member | Holds or is covered by an insurance policy or health plan |
| Provider | Delivers healthcare services and submits claims |
| Provider billing system | Converts clinical and financial information into claim records |
| Payer | Evaluates claims under applicable coverage, contract, and payment rules |
| Clearinghouse | Translates, validates, routes, and exchanges electronic healthcare transactions |
| Employer or plan sponsor | May sponsor a health plan and fund or administer benefits |
| Third-party administrator | Performs administrative functions for a health plan |
| Government program | May establish program-specific coverage, billing, and payment rules |
| Payment service or bank | Supports the movement and reconciliation of funds |
A payer may be a commercial insurer, a government program, or another organization responsible for processing healthcare benefits.
A clearinghouse is usually an intermediary. It can identify formatting and data issues before a claim reaches the payer, but it does not replace the payer's final adjudication process.
3. Claims Processing vs. Related Healthcare Concepts
Healthcare applications often exchange information across systems that have different responsibilities.
| Concept | Primary purpose |
|---|---|
| EHR | Stores clinical information such as diagnoses, notes, medications, and results |
| Patient Management System | Manages patient identity, appointments, registration, and related administrative workflows |
| Hospital Management System | Coordinates hospital operations, departments, beds, and supporting workflows |
| Medical billing system | Captures charges and prepares bills or claims |
| Claims processing system | Validates, evaluates, adjudicates, and tracks claims |
| Eligibility system | Checks insurance coverage and benefit information |
| Prior authorization system | Determines whether a service requires advance review and whether authorization has been granted |
| Payment and remittance system | Records payment information and reconciles financial outcomes |
These systems are related but are not interchangeable.
For example, an EHR may record that a patient received a service, while the claims platform determines how that service should be represented on a claim and tracks the payer's financial decision.
4. Types of Healthcare Claims
The structure and processing rules of a claim depend on the type of healthcare service and the payer.
4.1 Professional claims
Professional claims generally represent services provided by physicians and other qualified healthcare professionals.
Examples include:
- Office visits.
- Specialist consultations.
- Professional interpretation services.
- Certain outpatient procedures.
In the United States, professional claims commonly use the CMS-1500 paper form or its electronic equivalent, the X12 837 Professional transaction.
4.2 Institutional claims
Institutional claims generally represent facility services delivered by hospitals and other healthcare institutions.
Examples include:
- Hospital inpatient stays.
- Hospital outpatient services.
- Emergency department facility services.
- Certain skilled nursing or other institutional services.
Institutional claims commonly use the UB-04 paper form or the electronic X12 837 Institutional transaction.
4.3 Dental claims
Dental claims use dental-specific information and coding conventions. Electronic dental claims commonly use the X12 837 Dental transaction.
4.4 Primary and secondary claims
A patient may have more than one health coverage arrangement. In that situation, coordination of benefits determines the order in which applicable payers process the claim.
- Primary payer: Generally processes the claim first under the applicable coordination rules.
- Secondary payer: Evaluates the remaining eligible amount under its own coverage and coordination rules.
- Patient responsibility: May remain after all applicable payer decisions.
The secondary payer does not automatically pay every amount the primary payer leaves unpaid.
5. The End-to-End Claims Lifecycle
A typical claim moves through several stages, although the exact workflow varies by provider, payer, service type, and jurisdiction.
flowchart TD
A["Patient Registration"] --> B["Eligibility Verification"]
B --> C["Service Delivery"]
C --> D["Clinical Documentation"]
D --> E["Charge Capture"]
E --> F["Medical Coding"]
F --> G["Claim Generation"]
G --> H["Pre-submission Validation"]
H --> I["Clearinghouse Processing"]
I --> J["Payer Intake"]
J --> K["Claim Adjudication"]
K --> L{"Payer Decision"}
L -->|Approved or Partially Paid| M["Payment and Remittance"]
L -->|Denied| N["Denial Review"]
L -->|Needs More Information| O["Information or Documentation Workflow"]
M --> P["Payment Posting and Reconciliation"]
N --> Q["Correction, Appeal, or Follow-up"]
O --> Q
Q --> G
Stage 1: Patient registration
The provider collects patient demographics, insurance details, subscriber information, and other required registration data.
Common issues include:
- Incorrect member identification numbers.
- Incorrect patient demographics.
- Outdated insurance information.
- Missing subscriber relationships.
- Incorrect payer selection.
Poor registration data can cause downstream claim rejections or denials.
Stage 2: Eligibility verification
The provider checks whether the patient has applicable coverage for the service date.
Eligibility verification may identify:
- Whether coverage appears active.
- Member and plan information.
- Applicable benefit details.
- Copayments or deductibles, when returned.
- Other coverage information, when available.
In the United States, electronic eligibility inquiries commonly use the X12 270 transaction, with the payer's response represented by the X12 271 transaction.
Eligibility is not a guarantee of payment. A claim may still be denied because of exclusions, authorization requirements, coding issues, medical necessity rules, benefit limits, or other applicable conditions.
Stage 3: Service delivery and documentation
The provider delivers the healthcare service and records the relevant clinical information.
The documentation may support:
- The diagnosis.
- The service performed.
- Medical necessity.
- The provider's role.
- The date and location of service.
- Required supporting records.
Clinical documentation and claims data must be consistent, but they serve different purposes.
Stage 4: Charge capture
Charge capture identifies the billable services, procedures, supplies, and other applicable items associated with the encounter.
Potential charge-capture problems include:
- Missing charges.
- Duplicate charges.
- Incorrect quantities.
- Incorrect service dates.
- Inconsistent provider or department information.
Charge capture systems often receive data from EHRs, hospital systems, laboratory systems, imaging systems, and other clinical applications.
Stage 5: Medical coding
Medical coding translates documented clinical information into standardized codes used for billing, reporting, and payment processing.
Depending on the service and applicable rules, claims may use:
- ICD-10-CM: Diagnosis coding in the United States.
- ICD-10-PCS: Procedure coding for applicable inpatient hospital settings in the United States.
- CPT: Procedure and professional service codes.
- HCPCS Level II: Certain supplies, products, services, and other items.
- Revenue codes: Institutional billing classifications.
- Modifiers: Additional information about a service or procedure.
Coding requirements depend on the service setting, payer, applicable code set, and rules effective for the date of service.
Software can validate code formats and rule-based conditions, but it should not silently invent clinical diagnoses or replace qualified coding judgment.
Stage 6: Claim generation
The billing platform assembles the relevant data into a claim.
A claim can include:
- Patient and subscriber details.
- Billing provider and rendering provider information.
- Payer information.
- Diagnosis codes.
- Procedure or service codes.
- Service dates.
- Units and charges.
- Place of service.
- Modifiers and revenue codes, where applicable.
- Authorization references, when required.
- Other required identifiers and supporting information.
A claim may contain multiple service lines. The payer can evaluate the overall claim and individual lines according to applicable rules.
Stage 7: Pre-submission validation
Before submission, the claims platform checks whether the claim is complete and internally consistent.
Examples of validation rules:
- Required fields are populated.
- Member and provider identifiers have valid formats.
- Service dates are valid.
- Procedure and diagnosis codes are valid for the applicable date and context.
- Required modifiers or authorization references are present.
- Monetary amounts and quantities are internally consistent.
- Duplicate submission checks pass.
- Payer-specific requirements are satisfied.
Validation should distinguish between a technical formatting issue and a business rule that requires a different workflow.
Stage 8: Clearinghouse processing
Many providers submit electronic claims through a clearinghouse.
The clearinghouse may:
- Validate transaction structure.
- Check required data elements.
- Apply configured edits.
- Translate between supported formats.
- Route transactions to the intended payer.
- Return acknowledgments and error details.
A clearinghouse acceptance does not mean the payer has approved or paid the claim.
Stage 9: Payer intake and adjudication
The payer receives the claim and evaluates it using applicable benefit rules, provider contracts, coding requirements, coverage policies, and other relevant conditions.
The adjudication process may consider:
- Member coverage on the service date.
- Benefit exclusions and limitations.
- Provider network status and contract terms.
- Deductibles and copayments.
- Coinsurance.
- Medical necessity and documentation requirements.
- Authorization requirements.
- Coordination of benefits.
- Duplicate claims.
- Coding and billing edits.
- Applicable reimbursement rules.
The payer may approve the claim, pay it partially, deny it, request additional information, or apply another disposition defined by its workflow.
Stage 10: Payment, remittance, and reconciliation
After adjudication, the payer provides information about its decision and may issue payment.
The provider uses the remittance information to:
- Identify paid and unpaid claim lines.
- Understand adjustments and denial reasons.
- Post payments to the correct accounts.
- Update accounts receivable.
- Reconcile expected and actual payments.
- Identify underpayments or overpayments.
- Determine the remaining patient responsibility.
Payment and remittance are related but separate concepts. A remittance explains the financial decision; the actual funds may move through a separate payment mechanism.
6. Important X12 Healthcare Transactions
Electronic Data Interchange (EDI) enables healthcare organizations to exchange standardized business transactions.
The following X12 transactions are particularly important in United States healthcare administration.
| Transaction | Purpose |
|---|---|
| 270 | Eligibility and benefit inquiry |
| 271 | Eligibility and benefit response |
| 276 | Healthcare claim status request |
| 277 | Healthcare claim status response |
| 278 | Healthcare services review information, including applicable authorization and referral workflows |
| 837P | Professional healthcare claim |
| 837I | Institutional healthcare claim |
| 837D | Dental healthcare claim |
| 835 | Healthcare claim payment/remittance advice |
The exact implementation guide, version, companion guide, and payer requirements matter. Production integrations should not assume that all trading partners support identical rules.
6.1 Claim submission: 837
The 837 transaction carries electronic healthcare claim information.
A provider or its clearinghouse may transmit an 837 transaction to the payer. The transaction includes structured information about the billing entity, patient or subscriber, claim, diagnoses, and service lines.
The application must generate the correct transaction type and satisfy the applicable implementation guide and payer requirements.
6.2 Payment and remittance: 835
The 835 transaction communicates claim payment and remittance information.
It may include:
- Claim payment amounts.
- Service-line payment amounts.
- Contractual adjustments.
- Other adjustment information.
- Claim and service-line references.
- Remittance codes explaining adjustments or denials.
The provider's payment-posting system uses this information to reconcile the payer's decision with its internal accounts.
6.3 Eligibility: 270/271
The 270 transaction requests eligibility or benefit information. The 271 transaction returns the payer's response.
The response is a point-in-time information exchange, not a binding promise that a future claim will be paid.
6.4 Claim status: 276/277
The 276 transaction requests claim status, while the 277 transaction communicates claim status information.
These transactions support follow-up when a provider needs to determine whether a claim was received, is being processed, or has reached another reported status.
A claim-status response is not necessarily a final payment determination.
6.5 Authorization and referral: 278
The 278 transaction supports healthcare services review information, including applicable authorization and referral processes.
Authorization requirements depend on the service and payer. A reference number may need to be associated with a claim, but having an authorization does not automatically guarantee payment.
7. Claim Rejection vs. Claim Denial
One of the most important distinctions in claims processing is the difference between rejection and denial.
| Aspect | Rejection | Denial |
|---|---|---|
| Typical stage | Before or during intake validation | During or after payer adjudication |
| Common reason | Invalid structure, missing required data, or failed front-end edits | Coverage, coding, authorization, medical necessity, benefit, or other adjudication rule |
| Typical action | Correct the data and resubmit | Investigate the reason and determine the appropriate correction, appeal, or follow-up |
| Financial decision | Usually no completed adjudication decision | A payment decision has been made for all or part of the claim |
The exact meaning of a response depends on the transaction, trading partner, and processing stage. Some responses indicate only that a transaction or claim was received, not that it has been accepted for final adjudication.
Example: Rejection
A claim is rejected because a required member identifier is missing.
The billing system should:
- Record the rejection.
- Preserve the original submission and response.
- Identify the missing field.
- Correct the data using an authorized source.
- Create a corrected submission linked to the original attempt.
- Track the new submission and its acknowledgment.
Example: Denial
A claim is denied because the payer determines that a required authorization is missing.
The provider should investigate whether:
- Authorization was required.
- An authorization was obtained but not transmitted.
- The authorization reference was incorrect.
- The service was outside the authorization scope.
- A payer-specific correction or appeal process is available.
The application should not automatically appeal every denial. The correct action depends on the denial reason, evidence, deadlines, and payer rules.
8. Claim Adjudication and Financial Calculations
Claim adjudication determines the payment outcome based on the applicable rules and facts.
Consider a simplified example of one service line:
| Item | Amount |
|---|---|
| Provider's billed charge | $200 |
| Contractual adjustment | $60 |
| Allowed amount | $140 |
| Deductible applied | $40 |
| Remaining amount after deductible | $100 |
| Coinsurance at 20% of remaining allowed amount | $20 |
| Illustrative payer payment | $80 |
| Illustrative patient responsibility | $60 |
In this example:
- The provider billed $200.
- The allowed amount is $140.
- The $60 difference between the billed charge and allowed amount is treated as a contractual adjustment for this simplified scenario.
- The deductible is $40.
- The patient's 20% coinsurance on the remaining $100 is $20.
- The payer pays $80.
- The patient responsibility is $40 deductible plus $20 coinsurance, totaling $60.
The example assumes that the contractual adjustment is appropriate and that no other coverage, adjustment, or special rule changes the result. Real calculations depend on the contract, plan design, claim details, and applicable requirements.
Key financial terms
Billed amount: The amount submitted by the provider.
Allowed amount: The amount recognized under the applicable pricing or benefit rules.
Contractual adjustment: An adjustment arising from the provider's contract or other applicable pricing rules.
Deductible: The amount the member may need to pay for covered services before certain plan benefits begin paying.
Copayment: A specified amount the member pays for a covered service, subject to the plan's rules.
Coinsurance: A percentage of an applicable covered amount that the member is responsible for paying.
Payer payment: The amount the payer determines it owes for the claim or service line.
Patient responsibility: The amount assigned to the patient under the adjudicated claim and applicable rules.
These amounts must be represented separately in the data model. Treating the billed charge, allowed amount, payer payment, and patient responsibility as the same field leads to serious reconciliation errors.
9. Explanation of Benefits and Electronic Remittance Advice
Two financial documents are commonly encountered after adjudication.
Explanation of Benefits (EOB)
An EOB is generally a statement provided to the member explaining how the health plan processed a claim.
It may show:
- The service billed.
- The amount billed.
- The amount allowed.
- What the plan paid.
- Adjustments.
- The amount the member may owe.
An EOB is generally not a bill by itself.
Electronic Remittance Advice (ERA)
An ERA is the electronic remittance information used by providers and billing systems to understand the payer's financial decision.
The X12 835 transaction is a common electronic format for ERA information.
An ERA may contain claim-level and service-line-level amounts, adjustment reason codes, and references that help the provider match remittance details to its claims.
Why EOB and ERA should not be confused
An EOB is designed primarily to explain benefits to the member. An ERA supports the provider's payment-posting and reconciliation processes.
Although they may describe the same adjudication event, their audiences, formats, and workflows differ.
10. Denial Management and Appeals
Denial management is the process of identifying, categorizing, correcting, disputing, and preventing unpaid or underpaid claims.
Common denial categories include:
- Coverage or eligibility issues.
- Missing or invalid authorization.
- Coding errors.
- Medical necessity concerns.
- Duplicate claims.
- Timely filing issues.
- Missing documentation.
- Coordination of benefits.
- Provider enrollment or network issues.
- Benefit exclusions and limitations.
A typical denial-management workflow
flowchart TD
A["Receive Denial or Adjustment"] --> B["Normalize Reason Codes"]
B --> C["Classify Denial"]
C --> D["Check Claim and Supporting Data"]
D --> E{"Action Appropriate?"}
E -->|Correctable Data Issue| F["Correct and Resubmit"]
E -->|Disputable Decision| G["Prepare Appeal"]
E -->|Need More Information| H["Request Documentation"]
E -->|Not Recoverable or Not Pursued| I["Document Final Disposition"]
F --> J["Track Follow-up"]
G --> J
H --> J
J --> K["Measure Outcome and Root Cause"]
A robust denial-management platform should maintain:
- The original claim.
- The payer's response.
- Normalized reason codes.
- Internal classification.
- Evidence and supporting documents.
- Correction and resubmission history.
- Appeal deadlines and submission history.
- Final disposition.
- Root-cause information.
Corrected claim vs. appeal
A corrected claim is generally used when claim data needs to be corrected under the applicable payer's process.
An appeal is generally used when the provider disputes the payer's decision.
These processes are not interchangeable. Incorrectly sending an appeal when a corrected claim is required—or submitting a replacement claim when an appeal is needed—can create delays and additional processing problems.
11. Healthcare Claims Processing Architecture
A claims processing platform is often composed of multiple services rather than a single application.
flowchart TB
subgraph Provider["Provider Systems"]
A["EHR / Hospital System"]
B["Patient Management"]
C["Charge Capture"]
D["Coding and Billing"]
end
subgraph Claims["Claims Platform"]
E["Claim Intake API"]
F["Claim Validation"]
G["Claim Lifecycle Service"]
H["EDI Generation"]
I["Submission Orchestrator"]
J["Denial Management"]
end
subgraph Integration["Integration Layer"]
K["Message Broker"]
L["Clearinghouse Adapter"]
end
subgraph Payer["Payer Systems"]
M["Eligibility / Benefits"]
N["Claims Adjudication"]
O["Payment and Remittance"]
end
subgraph Finance["Provider Financial Systems"]
P["Payment Posting"]
Q["Accounts Receivable"]
R["Reconciliation and Reporting"]
end
A --> C
B --> E
C --> D
D --> E
E --> F
F --> G
G --> H
H --> I
I --> K
K --> L
L --> N
M --> B
N --> O
O --> L
L --> K
K --> G
G --> J
G --> P
P --> Q
Q --> R
11.1 Claim intake service
The claim intake service receives claim information from billing systems, partner applications, or other authorized sources.
Responsibilities include:
- Authentication and authorization.
- Schema validation.
- Request identification.
- Duplicate detection.
- Initial persistence.
- Correlation identifiers.
- Returning an appropriate acceptance or validation response.
The intake service should not claim that a payer has accepted or adjudicated a claim merely because the application has stored it successfully.
11.2 Claim validation service
The validation service checks claim structure, required fields, supported code values, date rules, and configurable business requirements.
Validation rules should be versioned where their behavior changes over time. For example, a code that was valid for one service date may be invalid for another.
Validation outcomes should contain actionable error codes rather than only free-text messages.
11.3 Claim lifecycle service
This service manages the claim's business state, identifiers, audit history, and relationships to submissions and payer responses.
It should preserve the distinction between:
- The logical claim.
- Each submission attempt.
- A payer's adjudication result.
- Each payment or remittance event.
- Corrected claims and appeal cases.
This separation is important because one logical claim may have multiple submission attempts and multiple downstream events.
11.4 EDI generation and integration service
The EDI service generates standards-compliant transactions, routes them through the configured clearinghouse or payer connection, and processes acknowledgments and responses.
The implementation should support:
- Trading-partner-specific configuration.
- Implementation-guide validation.
- Transaction control numbers.
- Secure transport.
- Acknowledgment correlation.
- Error handling.
- Replay and recovery.
- Audit logging.
Avoid embedding every payer-specific rule inside one large conditional block. Use well-defined adapters and versioned configuration.
11.5 Payment posting and reconciliation service
This service consumes remittance information, matches payments to claims, applies adjustments, and identifies unmatched or inconsistent financial records.
It should support partial payments, reversals, recoupments, adjustments, and remittance corrections where applicable.
Financial reconciliation should use stable identifiers and exact decimal arithmetic rather than floating-point calculations.
12. Designing the Claim Data Model
A healthcare claims database should represent the claim, service lines, submissions, adjudication results, and financial events separately.
A simplified relational model might include the following entities.
| Entity | Example attributes | Purpose |
|---|---|---|
Claim |
id, claimNumber, memberId, providerId, payerId, status |
Logical claim and current business state |
ClaimLine |
id, claimId, lineNumber, procedureCode, quantity, billedAmount |
Individual billed service or item |
ClaimDiagnosis |
claimId, diagnosisCode, sequence |
Diagnoses associated with the claim |
ClaimSubmission |
id, claimId, submissionNumber, transactionControlNumber, submittedAt |
Each outbound submission attempt |
ClaimResponse |
id, submissionId, responseType, receivedAt |
Acknowledgments and payer responses |
Adjudication |
id, claimId, allowedAmount, payerPayment, patientResponsibility |
Financial determination |
Remittance |
id, payerId, paymentReference, receivedAt |
Remittance or payment information |
RemittanceLine |
id, remittanceId, claimId, claimLineId, paidAmount |
Allocation of remittance amounts |
ClaimAdjustment |
id, claimId, reasonCode, amount |
Adjustment and denial information |
AppealCase |
id, claimId, reason, status, dueDate |
Appeal workflow and tracking |
These tables are illustrative, not a complete implementation guide or a universal healthcare data standard.
Important modeling principles
1. Separate claim status from submission status.
A claim can exist before it is submitted. A submission can fail while the underlying claim remains valid.
2. Preserve history.
Do not overwrite the original submission when a corrected claim is created. Preserve relationships among the original claim, correction, response, and later events.
3. Represent service lines independently.
A payer may pay some lines and deny others. Claim-level totals alone cannot explain every outcome.
4. Use exact financial types.
Use decimal types with a defined scale for monetary amounts. Avoid Java float and double for financial calculations.
5. Track source and correlation identifiers.
Store relevant internal identifiers, payer references, transaction control numbers, and submission-attempt identifiers.
6. Protect sensitive information.
Patient and member data should be exposed only to authorized roles and services.
13. Claim Lifecycle and State Management
A claim's business lifecycle should be explicit and auditable.
A simplified logical lifecycle might look like this:
stateDiagram-v2
[*] --> Draft
Draft --> Validated
Draft --> ValidationFailed
ValidationFailed --> Draft
Validated --> ReadyForSubmission
ReadyForSubmission --> Submitted
Submitted --> Rejected
Submitted --> AcceptedForProcessing
Rejected --> Corrected
Corrected --> Validated
AcceptedForProcessing --> PendingAdjudication
PendingAdjudication --> Adjudicated
Adjudicated --> PartiallyPaid
Adjudicated --> Paid
Adjudicated --> Denied
Denied --> Corrected
Denied --> AppealInProgress
AppealInProgress --> Adjudicated
Paid --> [*]
This is a conceptual state diagram. Real systems should define more precise states and transitions for each trading partner, transaction, and financial event.
For example, a claim may be accepted by a clearinghouse but not yet acknowledged by the payer. The system should represent those stages separately if the integration requires that level of detail.
State transition rules
A transition should occur only when the appropriate event or business condition is satisfied.
Examples:
Draft → Validated: required data and validation rules pass.Validated → Submitted: a submission record is created and the outbound process accepts the work.Submitted → Rejected: a relevant response identifies a rejection.PendingAdjudication → Adjudicated: an adjudication result is received and processed.Denied → AppealInProgress: an authorized appeal workflow is initiated.
Do not let any API caller change a claim directly from Draft to Paid. Financial states should be driven by authorized and traceable events.
14. Implementing a Claims API with Java and Spring Boot
Consider a simplified Spring Boot API that creates a claim and records an idempotency key.
The goal is to prevent an ordinary network retry from accidentally creating duplicate logical claims.
14.1 Request model
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import java.util.UUID;
public record ClaimLineRequest(
@NotBlank String procedureCode,
@NotNull @Positive BigDecimal billedAmount
) {}
public record CreateClaimRequest(
@NotBlank String memberId,
@NotBlank String providerId,
@NotBlank String payerId,
@NotNull LocalDate serviceDate,
@NotNull List<ClaimLineRequest> lines
) {}
public record CreateClaimResponse(
UUID claimId,
String status
) {}
This is an illustrative API contract. A production implementation requires richer claim-line modeling, code-set validation, authorization, diagnosis data, and payer-specific requirements.
14.2 Claim entity
import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
@Entity
@Table(name = "claims")
public class Claim {
@Id
private UUID id;
@Column(nullable = false)
private String memberId;
@Column(nullable = false)
private String providerId;
@Column(nullable = false)
private String payerId;
@Column(nullable = false)
private String status;
@Column(nullable = false)
private Instant createdAt;
protected Claim() {}
public Claim(
UUID id,
String memberId,
String providerId,
String payerId) {
this.id = id;
this.memberId = memberId;
this.providerId = providerId;
this.payerId = payerId;
this.status = "DRAFT";
this.createdAt = Instant.now();
}
public UUID getId() {
return id;
}
public String getStatus() {
return status;
}
}
For brevity, this example omits setters, claim-line persistence, auditing configuration, and the full domain model.
14.3 Idempotency record
A separate table can store an idempotency key and the logical claim it created.
import jakarta.persistence.*;
import java.util.UUID;
@Entity
@Table(
name = "claim_idempotency",
uniqueConstraints = @UniqueConstraint(
name = "uk_claim_idempotency_scope_key",
columnNames = {"client_scope", "idempotency_key"}
)
)
public class ClaimIdempotency {
@Id
private UUID id;
@Column(name = "client_scope", nullable = false)
private String clientScope;
@Column(name = "idempotency_key", nullable = false)
private String idempotencyKey;
@Column(name = "claim_id", nullable = false)
private UUID claimId;
protected ClaimIdempotency() {}
public ClaimIdempotency(
UUID id,
String clientScope,
String idempotencyKey,
UUID claimId) {
this.id = id;
this.clientScope = clientScope;
this.idempotencyKey = idempotencyKey;
this.claimId = claimId;
}
public UUID getClaimId() {
return claimId;
}
}
The unique constraint must be enforced by the database. A simple “check whether the key exists, then insert” operation is not sufficient under concurrent requests.
A production implementation must also define how to handle:
- The same key with a different request body.
- Concurrent requests using the same key.
- A retry after the original response was lost.
- Expiration and retention of idempotency records.
- The client's authorized scope.
- Transaction rollback and recovery.
14.4 Service layer
A simplified service illustrates the logical flow:
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.UUID;
@Service
public class ClaimService {
private final ClaimRepository claimRepository;
private final ClaimIdempotencyRepository idempotencyRepository;
public ClaimService(
ClaimRepository claimRepository,
ClaimIdempotencyRepository idempotencyRepository) {
this.claimRepository = claimRepository;
this.idempotencyRepository = idempotencyRepository;
}
@Transactional
public CreateClaimResponse create(
CreateClaimRequest request,
String clientScope,
String idempotencyKey) {
var existing = idempotencyRepository
.findByClientScopeAndIdempotencyKey(
clientScope, idempotencyKey);
if (existing.isPresent()) {
return new CreateClaimResponse(
existing.get().getClaimId(),
"DRAFT");
}
UUID claimId = UUID.randomUUID();
Claim claim = new Claim(
claimId,
request.memberId(),
request.providerId(),
request.payerId());
claimRepository.save(claim);
idempotencyRepository.save(
new ClaimIdempotency(
UUID.randomUUID(),
clientScope,
idempotencyKey,
claimId));
return new CreateClaimResponse(claimId, "DRAFT");
}
}
The repository interfaces and database mappings are omitted for readability.
Production caveat: This code is not a complete concurrency-safe idempotency implementation. It requires a database-enforced uniqueness constraint, correct handling of uniqueness conflicts, and validation that a repeated key refers to the same logical request. It must also persist claim lines and other required data atomically. The example returns the logical claim ID on a duplicate request; a production implementation should retrieve the actual current state and preserve the original response semantics.
14.5 REST endpoint
import jakarta.validation.Valid;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/v1/claims")
public class ClaimController {
private final ClaimService claimService;
public ClaimController(ClaimService claimService) {
this.claimService = claimService;
}
@PostMapping
@ResponseStatus(HttpStatus.CREATED)
public CreateClaimResponse createClaim(
@Valid @RequestBody CreateClaimRequest request,
@RequestHeader("Idempotency-Key") String idempotencyKey) {
// Obtain the authenticated client scope from the security context.
String clientScope = "authenticated-client";
return claimService.create(
request, clientScope, idempotencyKey);
}
}
The hardcoded client scope is only a placeholder. Production code must derive it from the authenticated security context, validate the idempotency key, and apply the API's documented response behavior for repeated requests.
The example demonstrates API layering and idempotency concepts; it does not implement complete claims processing or generate an X12 837 transaction.
15. Reliable Claims Processing with Events and the Outbox Pattern
Claims systems frequently integrate with clearinghouses, payer endpoints, message brokers, and payment platforms. Network failures and retries are normal operating conditions.
A common problem occurs when the database transaction succeeds but publishing the event fails.
For example:
- The application stores a claim.
- The database transaction commits.
- The application attempts to publish
ClaimReadyForSubmission. - The message broker is unavailable.
- The claim exists, but no event triggers submission.
The transactional outbox pattern helps solve this problem.
How the outbox pattern works
- Save the claim and an outbox event in the same database transaction.
- A separate publisher reads unpublished outbox records.
- The publisher sends events to the message broker.
- The publisher records successful publication.
- Consumers process events idempotently.
flowchart LR
A["Claims API"] --> B["Database Transaction"]
B --> C["Claim Record"]
B --> D["Outbox Event"]
D --> E["Outbox Publisher"]
E --> F["Message Broker"]
F --> G["EDI Submission Worker"]
G --> H["Clearinghouse"]
The outbox pattern does not automatically guarantee exactly-once delivery across every system. A publisher can send an event and fail before marking it as published, causing the event to be sent again.
Therefore, consumers must tolerate duplicate messages.
Recommended reliability controls
- Use a stable event identifier.
- Enforce idempotency at the consumer.
- Separate transport retries from business resubmissions.
- Apply exponential backoff with jitter for transient failures.
- Use bounded retries and a dead-letter or exception workflow.
- Persist external acknowledgments.
- Correlate responses with the correct submission attempt.
- Monitor events that remain unpublished or unprocessed.
- Support controlled replay without losing audit history.
Critical distinction: Retrying the delivery of the same transaction is not the same as creating a new claim submission. Uncontrolled resubmission can result in duplicate claims.
16. Security, Privacy, and Compliance
Healthcare claims contain sensitive patient, subscriber, provider, and financial information.
In the United States, the Health Insurance Portability and Accountability Act (HIPAA) establishes requirements relevant to protected health information (PHI), including applicable privacy, security, and breach-notification obligations. The precise obligations depend on the organization's role, activities, and applicable rules.
Security should be built into the architecture rather than added after implementation.
Essential security controls
Authentication and authorization
- Authenticate users, services, and integration partners.
- Apply role-based or attribute-based access controls.
- Restrict access to the minimum necessary information for the task.
- Separate operational, administrative, and financial permissions.
Encryption
- Protect data in transit using appropriately configured secure protocols.
- Encrypt sensitive data at rest where required by the security design.
- Manage encryption keys securely.
- Avoid exposing PHI in URLs or unprotected integration logs.
Auditability
Record appropriate information about access and changes, including:
- Who performed the action.
- What resource was accessed or modified.
- When the action occurred.
- The operation performed.
- The relevant claim or transaction reference.
- The outcome.
Audit logs should avoid unnecessary PHI and should be protected from unauthorized alteration.
Data minimization
Do not copy an entire patient record into the claims database when the application only requires a subset of information for billing and adjudication.
Secure integration
- Validate inbound messages.
- Authenticate trading partners.
- Protect credentials and certificates.
- Apply rate limits and abuse protection.
- Validate files before parsing.
- Protect error queues and support tools.
- Establish retention and deletion rules appropriate to legal, operational, and contractual requirements.
For a deeper explanation, continue with 46. HIPAA Compliance Overview.
17. Performance and Scalability Considerations
Claims platforms can process large volumes of claim submissions, status responses, remittance records, and follow-up activities.
The architecture should separate synchronous operations from asynchronous work where appropriate.
17.1 Asynchronous submission
Claim creation and claim submission are different activities. A platform may validate and persist a claim synchronously, then submit it asynchronously.
The API should clearly communicate whether the claim is merely saved, ready for submission, or actually transmitted.
17.2 Batch processing
Many claims workflows involve batch files and scheduled exchanges.
Batch processing should support:
- File-level validation.
- Transaction-level validation.
- Claim-level error reporting.
- Partial success where supported.
- Batch control totals.
- Restartable processing.
- Duplicate-file detection.
- Reconciliation between sent and acknowledged records.
A failure in one claim should not automatically cause the entire batch to be lost.
17.3 Partitioning and data access
Potential partitioning dimensions include service date, creation date, payer, or another operationally appropriate key.
Partitioning should be based on measured access patterns, retention requirements, and database capabilities—not on assumptions about volume alone.
17.4 Queue management
Use bounded queues and backpressure to prevent a large backlog from overwhelming downstream systems.
Monitor:
- Queue depth.
- Oldest message age.
- Processing throughput.
- Retry count.
- Dead-letter count.
- Payer-specific latency.
- Submission acknowledgment latency.
17.5 Observability
Useful metrics include:
| Metric | Why it matters |
|---|---|
| Claims created | Indicates intake volume |
| Validation failure rate | Reveals data quality or rule changes |
| Clearinghouse rejection rate | Identifies front-end integration issues |
| Payer acceptance rate | Helps distinguish technical delivery from later processing |
| Denial rate | Indicates adjudication outcomes that require analysis |
| First-pass resolution rate | Measures how often claims progress without avoidable rework |
| Days in accounts receivable | Measures the time required to collect outstanding balances |
| Unmatched remittance count | Identifies payment-posting and reconciliation problems |
| Average time to adjudication | Helps identify processing delays |
| Duplicate submission rate | Reveals retry or identity-control problems |
Metric definitions should be explicit. For example, the denominator for a denial rate may be adjudicated claims, adjudicated claim lines, or another defined population. Mixing these definitions makes comparisons unreliable.
18. Common Healthcare Claims Processing Mistakes
Mistake 1: Treating eligibility as payment approval
Eligibility information describes coverage and benefits at a particular point in time. It does not guarantee payment for a particular service.
Better approach: Evaluate the actual claim against the applicable coverage, coding, authorization, and payment rules.
Mistake 2: Treating clearinghouse acceptance as payer approval
A clearinghouse can accept a transaction that is later rejected or denied by the payer.
Better approach: Track clearinghouse responses, payer acknowledgments, adjudication results, and payment events separately.
Mistake 3: Using one status field for everything
A single status field cannot reliably describe validation, transmission, payer processing, adjudication, and financial reconciliation.
Better approach: Separate logical claim status, submission status, adjudication status, and payment/reconciliation status.
Mistake 4: Overwriting corrected claims
Replacing the original claim destroys useful audit history and makes reconciliation harder.
Better approach: Preserve the original claim and represent corrections and resubmissions explicitly.
Mistake 5: Ignoring duplicate delivery
Message brokers and network integrations may deliver events more than once.
Better approach: Use stable identifiers, idempotent processing, database constraints, and duplicate detection.
Mistake 6: Confusing a rejection with a denial
These outcomes occur at different processing stages and usually require different follow-up actions.
Better approach: Classify the response by source, transaction type, stage, and reason.
Mistake 7: Using floating-point arithmetic for money
Binary floating-point representations can introduce rounding errors.
Better approach: Use BigDecimal in Java and an appropriate database decimal type, with explicit rounding rules.
Mistake 8: Ignoring service-line outcomes
A claim may have a mixture of paid, adjusted, and denied lines.
Better approach: Model claim lines and their financial outcomes independently, while maintaining claim-level totals and reconciliation rules.
Mistake 9: Hardcoding payer rules
Different payers and programs may have different companion guides, coding edits, submission requirements, and processing rules.
Better approach: Use versioned, testable payer-specific adapters and configuration.
Mistake 10: Logging sensitive claim data
Debugging logs may accidentally expose patient details, identifiers, or clinical information.
Better approach: Use structured logging, correlation IDs, redaction, access restrictions, and appropriate retention policies.
19. Hands-On Project: Build a Mini Healthcare Claims Platform
Build a small claims processing application using Java, Spring Boot, PostgreSQL, and a message broker.
The project should focus on the business lifecycle rather than attempting to implement every healthcare billing standard.
Functional requirements
- Create a claim with patient/member, provider, payer, service date, and claim lines.
- Validate required fields and configurable business rules.
- Store the claim and its service lines.
- Support idempotent claim creation.
- Maintain submission attempts independently of the logical claim.
- Simulate clearinghouse acknowledgments.
- Simulate payer adjudication using configurable test rules.
- Store paid, adjusted, and denied claim-line outcomes.
- Accept simplified remittance records.
- Post payment information and identify unmatched items.
- Support corrected claims and a basic denial work queue.
- Maintain an audit history of state transitions.
Suggested architecture
flowchart TB
A["React UI or REST Client"] --> B["Spring Boot API"]
B --> C["Claim Service"]
C --> D["PostgreSQL"]
C --> E["Outbox Table"]
E --> F["Message Broker"]
F --> G["Submission Worker"]
G --> H["Simulated Clearinghouse"]
H --> I["Simulated Payer"]
I --> J["Adjudication Response"]
J --> K["Claim Lifecycle Service"]
K --> D
K --> L["Payment Posting"]
Suggested REST APIs
| Method | Endpoint | Purpose |
|---|---|---|
POST |
/api/v1/claims |
Create a claim |
GET |
/api/v1/claims/{id} |
Retrieve claim details |
GET |
/api/v1/claims |
Search claims using authorized filters |
POST |
/api/v1/claims/{id}/validate |
Validate a draft claim |
POST |
/api/v1/claims/{id}/submissions |
Initiate a submission attempt |
GET |
/api/v1/claims/{id}/submissions |
View submission history |
GET |
/api/v1/claims/{id}/responses |
View recorded responses |
POST |
/api/v1/claims/{id}/corrections |
Initiate a corrected-claim workflow |
POST |
/api/v1/claims/{id}/appeals |
Open an appeal case |
GET |
/api/v1/denials |
Retrieve authorized denial work items |
POST |
/api/v1/remittances |
Import a remittance record |
GET |
/api/v1/reconciliation/exceptions |
Retrieve reconciliation exceptions |
These are example application APIs, not standardized X12 endpoints.
Suggested development plan
Phase 1: Core domain model
- Create claim, claim-line, submission, and response entities.
- Implement CRUD and validation.
- Add database migrations.
- Write unit tests.
Phase 2: Lifecycle management
- Implement valid state transitions.
- Record status history.
- Add idempotency and duplicate detection.
- Test concurrent requests.
Phase 3: Asynchronous integration
- Add an outbox.
- Publish submission events.
- Implement a simulated clearinghouse.
- Add retry and dead-letter handling.
Phase 4: Adjudication simulation
- Implement configurable test rules.
- Calculate allowed amounts, adjustments, and payment amounts.
- Record line-level outcomes.
- Add denied-claim workflows.
Phase 5: Payment and reconciliation
- Import simplified remittance records.
- Match remittance items to claim lines.
- Identify unmatched and inconsistent amounts.
- Add reconciliation reports.
Phase 6: Security and observability
- Add authentication and role-based authorization.
- Redact sensitive fields from logs.
- Add correlation IDs and metrics.
- Create dashboards for rejection, denial, and reconciliation rates.
Testing scenarios
Your automated tests should cover:
- Missing member or provider identifiers.
- Invalid service dates.
- Invalid procedure codes for the configured rules.
- A duplicate idempotency key.
- Concurrent creation requests.
- A failed submission followed by retry.
- Duplicate message delivery.
- A claim accepted by the clearinghouse but later denied by the payer.
- A claim with one paid line and one denied line.
- Partial payment.
- Unmatched remittance information.
- A corrected claim linked to the original.
- Unauthorized access to claim information.
- Failure between database persistence and event publication.
Use synthetic data in development. Do not use real patient data in a learning project unless the environment, access, and processing are appropriately authorized and protected.
20. Healthcare Claims Processing Interview Questions
Beginner-level questions
1. What is healthcare claims processing?
It is the workflow through which a provider submits a request for payment, a payer evaluates it under applicable rules, and the financial outcome is communicated and reconciled.
2. What is the difference between a claim and an encounter?
An encounter represents a healthcare interaction or service event. A claim is a billing request that may represent one or more services associated with that event.
3. What is the difference between a payer and a provider?
A provider delivers healthcare services. A payer evaluates claims and pays eligible benefits according to applicable coverage and payment rules.
4. What is a clearinghouse?
A clearinghouse is an intermediary that supports healthcare transaction validation, translation, routing, and exchange between trading partners.
5. What is the difference between rejection and denial?
A rejection commonly indicates that a transaction or claim failed an intake or validation requirement. A denial generally reflects a payer's adjudication decision that all or part of the claim is not payable as submitted.
6. What is an EOB?
An Explanation of Benefits explains how a health plan processed a claim for a member. It is generally not a bill by itself.
7. What is an ERA?
An Electronic Remittance Advice communicates financial claim-processing information to the provider, commonly using the X12 835 transaction.
Intermediate-level questions
8. What are 837 and 835 transactions?
The 837 is used for electronic healthcare claim submissions. The 835 communicates claim payment and remittance information.
9. What are 270 and 271 transactions?
The 270 requests eligibility and benefit information, while the 271 returns the response.
10. What are 276 and 277 transactions?
The 276 requests healthcare claim status, while the 277 provides claim-status information.
11. Why is eligibility not a guarantee of payment?
A claim may still fail coverage, authorization, coding, medical necessity, benefit, or other applicable payment requirements.
12. Why should claim lines be stored separately?
Different services on the same claim may receive different payment, adjustment, or denial outcomes. Line-level records make accurate adjudication and reconciliation possible.
13. How do you prevent duplicate claim creation?
Use idempotency keys, database-enforced uniqueness, stable business identifiers, request fingerprinting where appropriate, and controlled handling of concurrent retries.
14. How do you handle a corrected claim?
Preserve the original claim, create a traceable correction or replacement workflow, follow payer-specific rules, and correlate the new submission with its responses.
15. How do you design a retry mechanism for claim submissions?
Classify failures, retry transient technical failures with bounded backoff, persist every submission attempt, correlate acknowledgments, and avoid creating duplicate business submissions.
Advanced architecture questions
16. How would you design a scalable claims processing platform?
Separate intake, validation, lifecycle management, EDI generation, submission orchestration, adjudication-response handling, denial management, and payment reconciliation. Use asynchronous processing where appropriate, durable state, idempotent consumers, observability, and controlled recovery.
17. How would you ensure reliable event publishing?
Use the transactional outbox pattern to commit business changes and outbox records together. Publish events asynchronously and make consumers idempotent because duplicate delivery can occur.
18. How would you handle payer-specific requirements?
Use trading-partner adapters, versioned configuration, implementation-guide validation, contract tests, and controlled rule deployment instead of embedding every requirement in one service.
19. How would you reconcile remittance information with claims?
Match using appropriate payer references, claim identifiers, service-line references, and payment details. Validate financial totals, identify unmatched items, and create auditable exceptions for manual or automated resolution.
20. How would you protect PHI in a claims platform?
Apply authentication, least-privilege authorization, encryption, audit logging, data minimization, secure integration, log redaction, retention controls, and incident-response processes consistent with applicable requirements.
21. How would you investigate a sudden increase in claim denials?
Segment the increase by payer, provider, service type, code, service date, and denial reason. Check recent rule changes, code-set updates, registration data quality, authorization workflows, and integration errors before selecting corrective actions.
22. What is the difference between technical retries and business resubmissions?
A technical retry repeats a failed delivery or processing operation without necessarily creating a new business transaction. A business resubmission creates or transmits a claim again under applicable correction or resubmission rules. They require separate tracking and controls.
21. Practice Checklist
Use this checklist to assess your understanding of healthcare claims processing.
- Explain the difference between an encounter, a claim, and a claim line.
- Describe the roles of providers, payers, clearinghouses, and members.
- Explain professional, institutional, and dental claims.
- Describe the complete claims lifecycle.
- Explain the purpose of 837, 835, 270/271, 276/277, and 278 transactions.
- Distinguish a clearinghouse acknowledgment from payer adjudication.
- Explain rejection, denial, correction, and appeal workflows.
- Calculate a simplified allowed amount, payer payment, and patient responsibility.
- Design a relational model for claims, lines, submissions, and remittances.
- Implement an idempotent claim creation API.
- Explain why a transactional outbox is useful.
- Design retries without accidentally duplicating business submissions.
- Identify key PHI security controls.
- Define meaningful denial, rejection, and reconciliation metrics.
- Build and test a mini claims processing application.
22. Key Takeaways
Healthcare claims processing connects clinical services with financial reimbursement. It requires an understanding of healthcare business workflows, coding, insurance benefits, electronic transaction standards, financial calculations, and integration architecture.
For software engineers and solution architects, the most important principles are:
- Understand the business lifecycle. Claim creation, submission, adjudication, payment, and reconciliation are distinct stages.
- Know the transaction standards. The 837 submits claims, the 835 communicates remittance, and other X12 transactions support eligibility, claim status, and services review.
- Separate rejections from denials. Their causes and resolution workflows differ.
- Model claim lines and financial outcomes explicitly. A claim can contain multiple service lines with different results.
- Design for reliable distributed processing. Idempotency, durable state, outbox events, controlled retries, and reconciliation are essential.
- Protect sensitive healthcare information. Security, privacy, access control, auditability, and data minimization belong in the architecture from the beginning.
- Measure operational outcomes. Rejection rates, denial rates, time to adjudication, and reconciliation exceptions help identify problems and improve performance.
Healthcare claims processing is a strong example of how domain knowledge, financial business rules, integration standards, and distributed-system design come together in a real enterprise platform.
Was this guide helpful?
CodeWithVenu is free to read, with no paywall. If this guide saved you time or helped you prepare, a small voluntary contribution helps me write more practical tutorials, architecture guides, and interview-prep content.