ca.uhn.hl7v2.parser
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 Summary
 java.util.Set<java.lang.String> getAllChildNames()
           
 java.util.Set<java.lang.String> getAllPossibleFirstChildren()
          Returns the names of any possible children that could be the first required child of this group.
 java.util.List<StructureDefinition> getChildren()
           
 IStructureDefinition getFirstChild()
          May return null
 IStructureDefinition getFirstSibling()
           
 java.lang.String getName()
           
 java.lang.String getNameAsItAppearsInParent()
           
 java.util.Set<java.lang.String> getNamesOfAllPossibleFollowingLeaves()
          Should only be called on a leaf node (segment).
 IStructureDefinition getNextLeaf()
           
 IStructureDefinition getNextSibling()
           
 IStructureDefinition getParent()
           
 int getPosition()
           
 boolean hasChildren()
           
 boolean isFinalChildOfParent()
           
 boolean isRepeating()
           
 boolean isRequired()
           
 boolean isSegment()
           
 

Method Detail

getFirstSibling

IStructureDefinition 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

IStructureDefinition 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

java.lang.String 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

java.lang.String 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

java.util.List<StructureDefinition> getChildren()
Returns:
Returns all children of this structure definition

getPosition

int getPosition()
Returns:
Returns the index of the position of this structure within it's parent's children

getParent

IStructureDefinition getParent()
Returns:
Returns the parent structure of this structure, if one exists. Otherwise, returns null.

isFinalChildOfParent

boolean isFinalChildOfParent()
Returns:
Returns true if this structure is the final child of it's parent.

getNextSibling

IStructureDefinition 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

java.util.Set<java.lang.String> 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)


getFirstChild

IStructureDefinition getFirstChild()
May return null

Returns:

getAllPossibleFirstChildren

java.util.Set<java.lang.String> 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


getAllChildNames

java.util.Set<java.lang.String> getAllChildNames()
Returns:
Returns the names of all children of this structure

isRequired

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


Copyright © 2001-2011 University Health Network. All Rights Reserved.