Skip to content

DmgSegment

DmgSegment models the X12 DMG demographic information segment, used in 837 claim transactions to carry a patient's or subscriber's date-of-birth and gender. It is an inbound-only segment in this library: Build() throws NotImplementedException because outbound DMG generation is not supported (BR-054).

Purpose

  • Represents the DMG segment identity via SegmentId, though notably returning the mixed-case literal "Dmg" rather than the X12 identifier "DMG" (BR-020).
  • Carries Format (the date-format qualifier), BirthDate, and GenderCode describing the individual's demographic data.
  • Is inbound-only: Fill(IEdiSegment) populates the object from a parsed segment, but Build() throws NotImplementedException (BR-054).

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 "Dmg" (mixed case, not the X12 identifier "DMG").
Format string Format { get; set; } The date-format qualifier for BirthDate (DMG01), read at element 1.
BirthDate DateTime BirthDate { get; set; } The individual's date of birth (DMG02), parsed via DateMaker.MakeDateTime at element 2.
GenderCode string GenderCode { get; set; } The individual's gender code (DMG03), read at element 3.
Build IEdiSegment Build() Always throws NotImplementedException; outbound DMG generation is not supported (BR-054).
Fill void Fill(IEdiSegment segment) Reads elements 1-3 via GetChildValue, parsing BirthDate via DateMaker.MakeDateTime, into Format, BirthDate, and GenderCode.
Parse static DmgSegment Parse(IEdiSegment segment) Instantiates a new DmgSegment, calls Fill(segment) on it, and returns it.

Behavioral notes

  • SegmentId returns the literal "Dmg" rather than the uppercase X12 identifier "DMG" that every other segment class in this library uses; whether this is intentional or a defect that would break any case-sensitive id-based segment lookup is unconfirmed**.

Constraints and usage notes

  • Any caller invoking Build() on a DmgSegment receives a NotImplementedException rather than a built segment (BR-054).

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

Sources

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