Skip to content

TrnSegment

TrnSegment models the X12 TRN trace-number segment, used in 835/837 transactions to carry a trace number (e.g. a payment/check number or claim trace identifier) that lets the receiver correlate the transaction back to the sender's originating record. Its two optional trailing elements are written only when populated (BR-059).

Purpose

  • Represents the TRN segment identity via SegmentId returning the literal "TRN" (BR-020).
  • Carries TraceTypeCode classifying the trace, paired with CurrentTransactionTraceNumbers, the trace number value itself.
  • Writes OriginatingCompanyIdentifier (TRN03) and ReferenceIdentification (TRN04) on Build() only when they are non-empty (BR-059).

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 "TRN".
TraceTypeCode string TraceTypeCode { get; set; } The trace-type qualifier code (TRN01), element 1.
CurrentTransactionTraceNumbers string CurrentTransactionTraceNumbers { get; set; } The trace number value (TRN02), element 2.
OriginatingCompanyIdentifier string OriginatingCompanyIdentifier { get; set; } The originating company's identifier (TRN03), written on Build() only when non-empty (BR-059).
ReferenceIdentification string ReferenceIdentification { get; set; } An additional reference identifier for the trace (TRN04), written on Build() only when non-empty (BR-059).
Build IEdiSegment Build() Creates a SegmentBuilder("TRN"), adds TraceTypeCode and CurrentTransactionTraceNumbers at elements 1-2 unconditionally, and adds OriginatingCompanyIdentifier/ReferenceIdentification at elements 3-4 only when non-empty, returning the built segment (BR-059).
Fill void Fill(IEdiSegment segment) Reads elements 1-4 via GetChildValue into TraceTypeCode, CurrentTransactionTraceNumbers, OriginatingCompanyIdentifier, and ReferenceIdentification.
Parse static TrnSegment Parse(IEdiSegment segment) Instantiates a new TrnSegment, calls Fill(segment) on it, and returns it.

Sources

  • Common\SAIF.Common.Files\Edi\Segments\TrnSegment.cs