Skip to main content

Claims Service — Deployment Topology

Status: populated Owner: TBD Last updated: 2026-04-18 Companion: SERVICE_OVERVIEW · Service Template · 02 DDD

Runtime

PropertyValue
RuntimeNode.js 22 LTS
FrameworkNestJS 11
LanguageTypeScript 5.x
ORMDrizzle ORM
ContainerDocker (distroless Node 22)
KubernetesDeployment (not StatefulSet)

Replicas

EnvironmentMin ReplicasMax ReplicasHPA Trigger
Production310CPU > 60% or RPS > 200/instance
Staging24CPU > 70%
Development11

Runtime Dependencies

DependencyTypeNotes
PostgreSQL 16ExternalPrimary store; claims DB; RLS enabled
NATS JetStreamExternalEvent streaming; outbox relay
RedisExternal (optional)Rate limiting; idempotency window cache for dedup
KeycloakExternalJWT issuer; tenant realm
terminology-serviceInternalICD-10/CPT code validation
audit-serviceInternalPHI audit pipeline
HashiCorp VaultExternalPayer credentials, EDI sender IDs
EDI ClearinghouseExternalX12 837 submission, 999/835 receive
Payer REST APIsExternalDirect payer eligibility and claim APIs (per tenant config)

Resource Limits

resources:
requests:
cpu: 200m
memory: 256Mi
limits:
cpu: 1000m
memory: 1Gi

ERA processing workers (separate Deployment):

resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 2000m
memory: 2Gi

Kong Routes

RouteUpstreamNotes
/api/v1/claims-service/*claims-service:3000Staff and service-to-service
/fhir/R4/Coverage/*claims-service:3000FHIR read surface
/fhir/R4/Claim/*claims-service:3000FHIR read surface
/fhir/R4/ExplanationOfBenefit/*claims-service:3000FHIR read; patient-portal-service consumer
/fhir/R4/CoverageEligibilityRequest/*claims-service:3000FHIR read surface
/fhir/R4/CoverageEligibilityResponse/*claims-service:3000FHIR read surface

Environment Variables

VariableDescriptionRequired
DATABASE_URLPostgres connection stringYes
DATABASE_POOL_SIZEConnection pool size (default 20)No
NATS_URLNATS JetStream URLYes
REDIS_URLRedis URL for rate-limit/dedup cacheNo (optional)
VAULT_ADDRHashiCorp Vault addressYes
VAULT_ROLEVault Kubernetes auth roleYes
KEYCLOAK_URLKeycloak base URLYes
KEYCLOAK_REALMDefault realm nameYes
TERMINOLOGY_SERVICE_URLterminology-service base URLYes
AUDIT_SERVICE_URLaudit-service base URLYes
EDI_SUBMISSION_MODEx12_837 / payer_rest / stubYes
EDI_CLEARINGHOUSE_URLClearinghouse SFTP/REST endpointIf EDI_SUBMISSION_MODE=x12_837
CLAIM_DEDUP_WINDOW_HOURSHours within which duplicate claims are blocked (default 24)No
LOG_LEVELdebug / info / warn / error (default info)No
PORTHTTP listen port (default 3000)No

Data Residency

Claims data (financial PHI) must remain within the tenant's designated region. Multi-region deployment requires per-region Postgres clusters. NATS JetStream replicas must also be co-located within the region. Cross-region replication of claim data requires explicit legal and compliance approval.

ERA Ingest Worker

A separate Kubernetes Deployment (claims-era-worker) handles ERA ingestion:

  • Polls the ingest queue (NATS subject claims.era.ingest)
  • Parses X12 835 or payer REST ERA
  • Calls ProcessRemittanceUseCase
  • Scales independently of the main API service (1-3 replicas)