---
title: SvcSegment
summary: API reference for SvcSegment.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-15
library: SAIF.Framework.Common.Files
reference_type: package
---

# SvcSegment

`SvcSegment` models the X12 SVC professional/institutional service-adjudication segment used in 835 remittance advice transactions to report how a billed service line was adjudicated: it carries both the adjudicated procedure/service (`AdjudicatedMedicalService`) and, when it differs, the originally billed procedure/service (`BilledMedicalService`) as `CompositeProcedureCodeElement` values, along with charged/paid amounts and quantities. `Build()` suppresses several elements based on adjudication rules: the revenue code is omitted when the adjudicated qualifier is `"NU"`, the adjudicated quantity is omitted when it equals 1, and the billed procedure/quantity are emitted only when they actually differ from the adjudicated values ([BR-051](../../business-rules.md#br-051-svc-adjudication-suppression-rules), [BR-062](../../business-rules.md#br-062-procedure-composite-equality-excludes-description)).

## Purpose
- Represents the SVC segment identity via `SegmentId` returning the literal `"SVC"` ([BR-020](../../business-rules.md#br-020-first-element-is-the-segment-identifier)).
- Carries `AdjudicatedMedicalService` and `BilledMedicalService` as `CompositeProcedureCodeElement` values representing what was actually paid versus what was originally billed.
- Carries `ChargedAmount`, `PaymentAmount`, `RevenueCode`, `AdjudicatedQuantity`, and `BilledQuantity` describing the financial and quantity aspects of the adjudication.
- Suppresses the revenue code at element 4 when the adjudicated procedure's `Qualifier` is `"NU"` ([BR-051](../../business-rules.md#br-051-svc-adjudication-suppression-rules)).
- Suppresses `AdjudicatedQuantity` at element 5 when it equals 1, and defaults it to 1 on `Fill()` when the element is absent ([BR-051](../../business-rules.md#br-051-svc-adjudication-suppression-rules)).
- Suppresses `BilledMedicalService` at element 6 and `BilledQuantity` at element 7 when they equal the adjudicated values, using `CompositeProcedureCodeElement.Equals` for the procedure comparison, which excludes `Description` ([BR-051](../../business-rules.md#br-051-svc-adjudication-suppression-rules), [BR-062](../../business-rules.md#br-062-procedure-composite-equality-excludes-description)).

## Context
- Namespace: `SAIF.Common.Files.Edi.Segments`
- Assembly/package: `SAIF.Framework.Common.Files`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| SegmentId | `string SegmentId { get; }` | Returns the literal X12 segment identifier `"SVC"`. |
| AdjudicatedMedicalService | `CompositeProcedureCodeElement AdjudicatedMedicalService { get; set; }` | The procedure/service composite as actually adjudicated (SVC01), element 1. |
| ChargedAmount | `decimal ChargedAmount { get; set; }` | The line-item charge amount (SVC02), element 2. |
| PaymentAmount | `decimal PaymentAmount { get; set; }` | The line-item payment amount (SVC03), element 3. |
| BilledQuantity | `decimal BilledQuantity { get; set; }` | The originally billed unit quantity (SVC07), written on `Build()` only when it differs from `AdjudicatedQuantity`, and defaulted to `AdjudicatedQuantity` on `Fill()` when the element is absent ([BR-051](../../business-rules.md#br-051-svc-adjudication-suppression-rules)). |
| RevenueCode | `string RevenueCode { get; set; }` | The revenue code for the service line (SVC04), written on `Build()` only when non-empty and the adjudicated qualifier is not `"NU"` ([BR-051](../../business-rules.md#br-051-svc-adjudication-suppression-rules)). |
| AdjudicatedQuantity | `decimal AdjudicatedQuantity { get; set; }` | The adjudicated unit quantity (SVC05), written on `Build()` only when it is not equal to 1, and defaulted to 1 on `Fill()` when the element is absent ([BR-051](../../business-rules.md#br-051-svc-adjudication-suppression-rules)). |
| BilledMedicalService | `CompositeProcedureCodeElement BilledMedicalService { get; set; }` | The originally billed procedure/service composite (SVC06), written on `Build()` only when it differs from `AdjudicatedMedicalService` per `Equals` ([BR-051](../../business-rules.md#br-051-svc-adjudication-suppression-rules), [BR-062](../../business-rules.md#br-062-procedure-composite-equality-excludes-description)). |
| Build | `IEdiSegment Build()` | Creates a `SegmentBuilder("SVC")`; adds `AdjudicatedMedicalService`'s built composite (trimmed of trailing delimiters) at element 1 when set; adds `ChargedAmount`/`PaymentAmount` at elements 2-3; adds `RevenueCode` at element 4 unless the adjudicated qualifier is `"NU"`; adds `AdjudicatedQuantity` at element 5 unless it equals 1; adds `BilledMedicalService`'s composite at element 6 when it differs from the adjudicated one; adds `BilledQuantity` at element 7 when it differs from `AdjudicatedQuantity`; returns the built segment ([BR-051](../../business-rules.md#br-051-svc-adjudication-suppression-rules)). |
| Fill | `void Fill(IEdiSegment segment)` | Reads element 1 into `AdjudicatedMedicalService.Code` or via `FillServiceCode` depending on element type; converts elements 2-3 to `decimal` for `ChargedAmount`/`PaymentAmount`; reads `RevenueCode` at element 4; sets `AdjudicatedQuantity` to 1 when element 5 is absent, else converts it; reads element 6 into `BilledMedicalService.Code`/`FillServiceCode` when present; sets `BilledQuantity` to `AdjudicatedQuantity` when element 7 is absent, else converts it. |
| Parse | `static Sv1Segment Parse(IEdiSegment segment)` | Declared with an `Sv1Segment` return type and instantiates/fills an `Sv1Segment` rather than an `SvcSegment` — a likely copy/paste defect, unlike every other segment class's `Parse`, which returns its own type**. |

## Behavioral notes
- `SvcSegment.Parse(IEdiSegment)` is declared with an `Sv1Segment` return type, and its body constructs and fills an `Sv1Segment` instead of a `SvcSegment`; this is inconsistent with every other segment's `Parse` pattern in this library, which returns an instance of the declaring type, and appears to be a copy/paste defect, though it could not be confirmed whether callers rely on this behavior**.
- `Build()` and `Fill()` dereference `AdjudicatedMedicalService`/`BilledMedicalService` (e.g. `AdjudicatedMedicalService.Qualifier`, `AdjudicatedMedicalService.Code = segment.GetChildValue(1)`) without checking they are non-null first; a caller must pre-assign both properties with a `CompositeProcedureCodeElement` instance before calling either method, or a `NullReferenceException` results — this requirement is not documented or enforced by the class**.

## Constraints and usage notes
- Callers must construct and assign `AdjudicatedMedicalService` (and typically `BilledMedicalService`) before calling `Build()` or `Fill()`, since neither method allocates them**.
- Because `Parse` is defective, code that calls `SvcSegment.Parse(segment)` expecting an `SvcSegment` back will actually receive an `Sv1Segment` typed as `Sv1Segment`, which will not compile as an assignment to an `SvcSegment` variable and would need to be recognized at the call site**.

> **Note:** Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Sources
- Common\SAIF.Common.Files\Edi\Segments\SvcSegment.cs
