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

# LxSegment

`LxSegment` models the X12 LX transaction-set line-number segment, used in 837/277 transactions to number and sequence a repeating group of service lines or status records within the transaction set.

## Purpose
- Represents the LX segment identity via `SegmentId` returning the literal `"LX"` ([BR-020](../../business-rules.md#br-020-first-element-is-the-segment-identifier)).
- Carries `ServiceNumber`, the sequential line/assigned number for the repeating group this segment introduces.

## 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 `"LX"`. |
| ServiceNumber | `short ServiceNumber { get; set; }` | The assigned sequential line number (LX01), element 1. |
| Build | `IEdiSegment Build()` | Creates a `SegmentBuilder("LX")` and adds `ServiceNumber` at element 1, returning the built segment. |
| Fill | `void Fill(IEdiSegment segment)` | Reads element 1 via `GetChildValue`, converting it to `short`, into `ServiceNumber`. |
| Parse | `static LxSegment Parse(IEdiSegment segment)` | Instantiates a new `LxSegment`, calls `Fill(segment)` on it, and returns it. |

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