Interface IStructureDefinition

All Known Implementing Classes:
NonStandardStructureDefinition, StructureDefinition

public interface IStructureDefinition
Contains information about the composition of a given type of Structure. At runtime, parsers will use accessors provided by various structure types (messages, groups, segments) to determine the structure of a messages. Structure definitions are used to cache that information between parse calls.
  • Method Details

    • getFirstSibling

      Returns:
      Returns this structure's first sibling (in other words, its parent's first child). Returns null if this is the first sibling, or if this has no parent
    • getNextLeaf

      Returns:
      Returns the next leaf (segment) after this one, within the same group, only if one exists and this structure is also a leaf. Otherwise returns null.
    • getNameAsItAppearsInParent

      Returns:
      The name of the segment, as it is known to it's parent. This will differ from {getName()} in the case of multiple segments with the same name in a group, e.g. the two PID segments in ADT_A17, where the second one it known as PID2 to it's parent.
    • getName

      Returns:
      Returns the name of this structure
    • isSegment

      boolean isSegment()
      Returns:
      Returns true if this structure is a segment
    • isRepeating

      boolean isRepeating()
      Returns:
      Returns true if this is a repeatable structure
    • getChildren

      Returns:
      Returns all children of this structure definition
    • getPosition

      Returns:
      Returns the index of the position of this structure within it's parent's children
    • getParent

      Returns:
      Returns the parent structure of this structure, if one exists. Otherwise, returns null.
    • isFinalChildOfParent

      Returns:
      Returns true if this structure is the final child of it's parent.
    • getNextSibling

      Returns:
      Returns this structure's next sibling within it's parent, if any.
    • hasChildren

      boolean hasChildren()
      Returns:
      Does this structure have children (i.e. is it not a segment)
    • getNamesOfAllPossibleFollowingLeaves

      Should only be called on a leaf node (segment). Returns the names of all valid children which may follow this one, at any level in the hierarchy (including as later siblings of parent structures to this one)
      Returns:
      the names of all valid children which may follow this one
    • getFirstChild

      Returns:
      structure definition of first child of null if there is no child
    • getAllPossibleFirstChildren

      Returns the names of any possible children that could be the first required child of this group. For instance, for the group below "ORC" and "OBR" would both be returned, as they are both potential first children of this group. Note that the name returned by this.getName() is also returned. ORDER_OBSERVATION { [ ORC ] OBR [ { NTE } ] [ CTD ] OBSERVATION { [ OBX ] [ { NTE } ] } OBSERVATION [ { FT1 } ] [ { CTI } ] } ORDER_OBSERVATION
      Returns:
      the names of any possible children that could be the first required child of this group
    • getAllChildNames

      Returns:
      Returns the names of all children of this structure, including first elements within child groups
    • isChoiceElement

      boolean isChoiceElement()
      Returns:
      true if this element a choice element
      See Also:
    • isRequired

      boolean isRequired()
      Returns:
      true if this a required structure within it's parent