ca.uhn.hl7v2.parser
Class NonStandardStructureDefinition

java.lang.Object
  extended by ca.uhn.hl7v2.parser.NonStandardStructureDefinition
All Implemented Interfaces:
IStructureDefinition

public class NonStandardStructureDefinition
extends java.lang.Object
implements IStructureDefinition

Structure definition which defines a non-standard structure within a parent structure. This class is used more as a runtime placeholder than as something that would be produced by the structure parser.


Constructor Summary
NonStandardStructureDefinition(IStructureDefinition theParent, IStructureDefinition thePreviousSibling, java.lang.String theName, int thePosition)
          Constructor
 
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()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonStandardStructureDefinition

public NonStandardStructureDefinition(IStructureDefinition theParent,
                                      IStructureDefinition thePreviousSibling,
                                      java.lang.String theName,
                                      int thePosition)
Constructor

Method Detail

getAllChildNames

public java.util.Set<java.lang.String> getAllChildNames()

Specified by:
getAllChildNames in interface IStructureDefinition
Returns:
Returns the names of all children of this structure

getAllPossibleFirstChildren

public 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

Specified by:
getAllPossibleFirstChildren in interface IStructureDefinition

getChildren

public java.util.List<StructureDefinition> getChildren()

Specified by:
getChildren in interface IStructureDefinition
Returns:
Returns all children of this structure definition

getFirstChild

public IStructureDefinition getFirstChild()
May return null

Specified by:
getFirstChild in interface IStructureDefinition
Returns:

getFirstSibling

public IStructureDefinition getFirstSibling()

Specified by:
getFirstSibling in interface IStructureDefinition
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

getName

public java.lang.String getName()

Specified by:
getName in interface IStructureDefinition
Returns:
Returns the name of this structure

getNameAsItAppearsInParent

public java.lang.String getNameAsItAppearsInParent()

Specified by:
getNameAsItAppearsInParent in interface IStructureDefinition
Returns:
The name of the segment, as it is known to it's parent. This will differ from {IStructureDefinition.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.

getNamesOfAllPossibleFollowingLeaves

public 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)

Specified by:
getNamesOfAllPossibleFollowingLeaves in interface IStructureDefinition

getNextLeaf

public IStructureDefinition getNextLeaf()

Specified by:
getNextLeaf in interface IStructureDefinition
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.

getNextSibling

public IStructureDefinition getNextSibling()

Specified by:
getNextSibling in interface IStructureDefinition
Returns:
Returns this structure's next sibling within it's parent, if any.

getParent

public IStructureDefinition getParent()

Specified by:
getParent in interface IStructureDefinition
Returns:
Returns the parent structure of this structure, if one exists. Otherwise, returns null.

getPosition

public int getPosition()

Specified by:
getPosition in interface IStructureDefinition
Returns:
Returns the index of the position of this structure within it's parent's children

hasChildren

public boolean hasChildren()

Specified by:
hasChildren in interface IStructureDefinition
Returns:
Does this structure have children (i.e. is it not a segment)

isFinalChildOfParent

public boolean isFinalChildOfParent()

Specified by:
isFinalChildOfParent in interface IStructureDefinition
Returns:
Returns true if this structure is the final child of it's parent.

isRepeating

public boolean isRepeating()

Specified by:
isRepeating in interface IStructureDefinition
Returns:
Returns true if this is a repeatable structure

isRequired

public boolean isRequired()

Specified by:
isRequired in interface IStructureDefinition
Returns:
Is this a required structure within it's parent

isSegment

public boolean isSegment()

Specified by:
isSegment in interface IStructureDefinition
Returns:
Returns true if this structure is a segment


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