Class BirthSequenceEnricher

java.lang.Object
tools.pantheum.gaia.gs1.interpretation.enricher.BirthSequenceEnricher
All Implemented Interfaces:
InterpretationEnricherInterface

public final class BirthSequenceEnricher extends Object implements InterpretationEnricherInterface
Enriches AI 7258 (BIRTH SEQUENCE — Baby birth sequence) by splitting the posinseqslash value into its constituent parts.

Value format

The 3-character fixed-length value is structured as:
  Char 0   : position in birth sequence (single digit, 1-based)
  Char 1   : literal "/"
  Char 2   : total number of babies born in this sequence
Examples:
  • "1/1" — single birth (one baby)
  • "1/2" — first of twins
  • "2/3" — second of triplets

Produced interpretations

  • BIRTH_POSITION — position in the sequence, e.g. "2"
  • BIRTH_TOTAL — total babies in this birth, e.g. "3"
  • BIRTH_SEQUENCE — human-readable label, e.g. "Baby 2 of 3"
Returns an empty list if the value is null, not 3 characters, or not in digit/digit format.
  • Constructor Details

  • Method Details

    • enrich

      public List<GS1AIInterpretation> enrich(String baseValue, AiDefinition aiDefinition, GS1AIObjectElement element)
      Description copied from interface: InterpretationEnricherInterface
      Produces additional interpretations from baseValue.
      Specified by:
      enrich in interface InterpretationEnricherInterface
      Parameters:
      baseValue - the extracted segment value (never null or empty)
      aiDefinition - the full AI definition for the element being interpreted
      element - the parent element, providing access to all component values and any interpretations already added in this pass
      Returns:
      additional interpretations to append; never null