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

# SegmentGroup

`SegmentGroup` is the base grouping unit produced by `EdiGroupParser.ParseSegmentGroup`, which slices a flat segment list into per-occurrence groups keyed by a control-number data element (e.g. GS element 6, ST element 2, BHT element 1, HL element 1) ([BR-034](../../business-rules.md#br-034-group-keys-derived-from-control-number-elements)); a group's membership boundaries are determined by segment position between successive occurrences of its delimiting segment ([BR-036](../../business-rules.md#br-036-segment-group-ownership-determined-by-position)). It is the common base type for `GroupContainer` and, through it, `FunctionalGroup`, `TransactionSet`, `HierarchialTransaction`, and `HierarchialLevel`.

## Purpose
- Provides `Key`, the control-number value that identifies one occurrence of a repeating group (e.g. one functional group's GS06 value) ([BR-034](../../business-rules.md#br-034-group-keys-derived-from-control-number-elements)).
- Provides `Index`, the sequential ordinal assigned to this group instance during parsing, and `SegmentGroupId`, the delimiting segment tag (e.g. `"GS"`, `"ST"`, `"BHT"`, `"HL"`) that this group was split on.
- Provides `Level`, defaulted to `0` in the constructor, used by nested grouping scenarios such as hierarchical levels.

## Context
- Namespace: `SAIF.Common.Files.Edi`
- Assembly/package: `SAIF.Framework.Common.Files`
- Base class: `List<IEdiSegment>` (framework-standard collection base; see Context note below)
- Implements: `ISegmentGroup`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| SegmentGroupId | `public string SegmentGroupId { get; set; }` | The segment tag (e.g. `"GS"`, `"ST"`, `"BHT"`, `"HL"`) that this group was delimited by during parsing. |
| Index | `public int Index { get; set; }` | The sequential ordinal assigned to this group instance among its sibling groups. |
| Key | `public string Key { get; set; }` | The control-number value that uniquely identifies this group occurrence, extracted from the delimiting segment's key data element ([BR-034](../../business-rules.md#br-034-group-keys-derived-from-control-number-elements)). |
| Level | `public int Level { get; set; }` | The nesting depth of this group, defaulted to `0`; used to express hierarchical relationships between nested groups. |

## Constraints and usage notes
- `SegmentGroup` derives from the framework-standard `List<IEdiSegment>`, so a `SegmentGroup` instance is itself an ordered, mutable collection of the raw segments belonging to that group — this base collection behavior is not documented as an "Inherited public members" section per this library's documentation conventions, since `List<T>` is a .NET framework type, not a local base class.

## Sources
- Common\SAIF.Common.Files\Edi\SegmentGroup.cs
