---
title: ClaimApiNodeBuilder
summary: API reference for ClaimApiNodeBuilder.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# ClaimApiNodeBuilder

Acts as a factory that constructs a single `Claim` domain object (via `IRepositoryFactory`, `IClaimQueryProvider`, `IUserProfileService`, `IWorkerQueryProvider`, `IPolicyQueryProvider`, `ICCClaimApiService`, and `IClaimDataApiClient`) for a given claim ID and then hands out the various per-section `*NodeBuilder` instances (`ClaimNodeBuilder`, `WorkerNodeBuilder`, `PolicyNodeBuilder`, `McoPlanNodeBuilder`, `AttendingPhysicianNodeBuilder`, `WorkerRepresentativeNodeBuilder`, `ReservesNodeBuilder`, `ConditionsNodeBuilder`, `LegalNodeBuilder`, `ContactsNodeBuilder`, `ClaimProviderLocationsNodeBuilder`) that assemble the Claim Information API response. It also constructs an internal `LegalService` used by `LegalNode()`, and applies a fixed cost-category sort order (Medical, TemporaryDisability, PermanentPartialDisability, PermanentTotalDisability, Fatal, LegalFees, VocServices, VocTD) as the default reserves ordering.

## Purpose
- Loads a single `Claim` instance for a claim ID and reuses it across all node-builder factory methods to avoid redundant data loads.
- Exposes `ValidClaim` so callers can short-circuit node construction when the claim has no data.
- Produces correctly wired instances of every section-specific node builder used to compose the Claim Information API payload.
- Applies a default cost-category sort order for reserves output when the caller does not supply one.

## Context
- Namespace: `SAIF.Services.Claims.Information.Api`
- Assembly/package: `SAIF.Services` (packaged inside the `SAIF.SAIFCode.Core` NuGet package)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| ClaimApiNodeBuilder(...) | `public ClaimApiNodeBuilder(IRepositoryFactory factory, IClaimQueryProvider claimQueries, IUserProfileService profile, IWorkerQueryProvider workerQueryProvider, IPolicyQueryProvider policyQueryProvider, ICCClaimApiService claimApiService, long claimId, IClaimDataApiClient gwClaimDataApiClient)` | Validates required dependencies, then constructs the `Claim` for `claimId` and an internal `LegalService` shared by later builder calls. |
| ValidClaim | `public bool ValidClaim { get; }` | Indicates whether the loaded claim is non-null and has data, used by callers to decide whether to build empty/default nodes instead. |
| ClaimNode() | `public ClaimNodeBuilder ClaimNode()` | Creates a `ClaimNodeBuilder` seeded with the loaded claim and a new `ClaimNode`. |
| WorkerNode() | `public WorkerNodeBuilder WorkerNode()` | Creates a `WorkerNodeBuilder` seeded with the claim's worker and claim, and a new `WorkerNode`. |
| PolicyNode() | `public PolicyNodeBuilder PolicyNode()` | Loads a `Policy` for the claim's policy number and creates a `PolicyNodeBuilder` around it. |
| McoNode() | `public McoPlanNodeBuilder McoNode()` | Creates a `McoPlanNodeBuilder` seeded with the loaded claim and a new `McoPlanNode`. |
| AttendingPhysicianNode(service) | `public AttendingPhysicianNodeBuilder AttendingPhysicianNode(IProviderInformationService service)` | Creates an `AttendingPhysicianNodeBuilder` for the claim using the supplied provider-information service. |
| WorkerRepNode(service) | `public WorkerRepresentativeNodeBuilder WorkerRepNode(IProviderInformationService service)` | Creates a `WorkerRepresentativeNodeBuilder` for the claim using the supplied provider-information service. |
| ReservesNode(sortOrder) | `public ReservesNodeBuilder ReservesNode(string[] sortOrder = null)` | Creates a `ReservesNodeBuilder` for the claim, using the caller-supplied cost-category sort order or falling back to the builder's default order. |
| ConditionsNode() | `public ConditionsNodeBuilder ConditionsNode()` | Creates a `ConditionsNodeBuilder` seeded with the loaded claim and a new `ConditionsNode`. |
| LegalNode() | `public LegalNodeBuilder LegalNode()` | Creates a `LegalNodeBuilder` wired to the claim, user-profile service, legal query provider, and the internally constructed `LegalService`. |
| ContactsNode() | `public ContactsNodeBuilder ContactsNode()` | Creates a `ContactsNodeBuilder` wired to the claim, user-profile service, and claim query provider. |
| ClaimProviderLocationsNode(providerService) | `public ClaimProviderLocationsNodeBuilder ClaimProviderLocationsNode(IProviderInformationService providerService)` | Creates a `ClaimProviderLocationsNodeBuilder` for the claim using the supplied provider-information service. |

## Behavioral notes
- The constructor eagerly instantiates the `Claim` and a `LegalService`, meaning claim data is fetched immediately rather than lazily.
- `ReservesNode` uses a null-coalescing fallback to a fixed built-in cost-category ordering when no explicit sort order is supplied.

## Constraints and usage notes
- Callers must check `ValidClaim` before invoking node-builder methods to avoid operating on a claim with no data.
- `factory` is passed both as `IRepositoryFactory` and cast to `IUnitOfWork` for the internal `LegalService`, so the supplied instance must implement both interfaces.

## Sources
- Services/SAIF.Services/Claims/Information/Api/ClaimApiNodeBuilder.cs
