Skip to content

Claims

Manages the full lifecycle of medical claims — from submission through adjudication, prior authorization, and payment.

Overview

The Claims service is the financial adjudication core of Olly. It receives claims submitted by members or providers, validates them against eligibility and plan benefits, and drives them through a state machine from SUBMITTED through APPROVED/REJECTED to PAID.

Each claim may have multiple ClaimLine items (individual service line entries), attached supporting documents, and an optional prior authorization link. The service coordinates with Eligibility to verify coverage at time of service, with Policy Admin to apply benefit rules (deductibles, copays, coinsurance), and with Billing to trigger provider payment once a claim is approved.

Prior authorization is managed within the same service. A PriorAuth record must exist and be in APPROVED status for procedures that require pre-authorization before a claim can advance past review.

Responsibilities

  • Accept claim submissions from members, providers, and internal systems
  • Validate member eligibility and coverage at the date of service via the Eligibility service
  • Enforce prior authorization requirements using the PriorAuth sub-domain
  • Drive claim state transitions: SUBMITTED → IN_REVIEW → APPROVED/REJECTED → PAID/CLOSED
  • Manage ClaimLine items for individual service line adjudication
  • Accept and store supporting claim documents
  • Publish adjudication events for downstream Billing and Notifications consumption
  • Expose internal endpoints for Billing to retrieve claim details and trigger payment

Database

Schema: claims

TablePurpose
claimsRoot claim aggregate with status, member, policy, and financial fields
claim_linesIndividual service line items (procedure codes, billed amounts, allowed amounts)
claim_documentsSupporting documents attached to a claim
prior_authsPrior authorization requests and approvals
outboxTransactional outbox for reliable Kafka event publishing

API Routes

MethodPathAuthDescription
POST/claimsJWTSubmit a new claim
GET/claimsJWTList claims (filterable)
GET/claims/{locator}JWTGet claim by locator
PATCH/claims/{locator}/reviewJWTMove claim to IN_REVIEW
PATCH/claims/{locator}/approveJWTApprove a claim
PATCH/claims/{locator}/rejectJWTReject a claim with reason code
PATCH/claims/{locator}/requestInfoJWTRequest additional information
PATCH/claims/{locator}/closeJWTClose a claim
POST/claims/{locator}/number/generateJWTGenerate a display claim number
POST/claims/{locator}/linesJWTAdd a ClaimLine to a claim
GET/claims/{locator}/lines/listJWTList all ClaimLines for a claim
POST/claims/{locator}/documentsJWTAttach a document to a claim
GET/claims/{locator}/documents/listJWTList documents attached to a claim
POST/prior-authJWTSubmit a prior authorization request
GET/prior-authJWTList prior authorizations
GET/prior-auth/{locator}JWTGet prior auth by locator
PATCH/prior-auth/{locator}/reviewJWTMove prior auth to review
PATCH/prior-auth/{locator}/approveJWTApprove a prior authorization
PATCH/prior-auth/{locator}/denyJWTDeny a prior authorization
GET/internal/claims/{locator}InternalRetrieve claim for Billing service
PATCH/internal/claims/{locator}/payInternalMark claim as paid (called by Billing)

Events

Publishes

TopicWhen
claims.submittedA new claim is successfully submitted
claims.approvedA claim transitions to APPROVED
claims.rejectedA claim is rejected with a reason code
claims.adjudicatedAdjudication is complete (approved or rejected)
claims.paidPayment is confirmed by Billing via the internal pay endpoint

Consumes

The Claims service does not consume Kafka events directly. It is a consumer target for other services (Billing calls its internal endpoints; Notifications subscribes to its events).

Dependencies

ServiceHow used
EligibilityValidates member coverage at date of service via HTTP before approving a claim
EnrollmentFetches policy details to confirm plan membership
Policy AdminRetrieves benefit rules and plan configuration for adjudication

Key Design Decisions

Outbox pattern for event publishing: All Kafka events are written to the outbox table within the same database transaction as the claim state change. A background worker polls and publishes to Kafka, ensuring no events are lost even if the broker is temporarily unavailable.

Internal pay endpoint: Billing drives the payment confirmation by calling PATCH /internal/claims/{locator}/pay. This keeps payment orchestration in Billing while Claims owns the state machine. The internal route is protected at the gateway level rather than requiring a JWT.

Olly Health Insurance Platform