org.LexGrid.LexBIG.example
Class ListHierarchyByCode

java.lang.Object
  extended by org.LexGrid.LexBIG.example.ListHierarchyByCode

public class ListHierarchyByCode
extends java.lang.Object

Example showing how to determine and display the hierarchical relationships for a specific code, ancestors or descendants, within a fixed distance. This program accepts two parameters, indicating the code and distance. The first parameter is the code (required). The second parameter is the distance (optional). If 1, immediate children are displayed. If 2, grandchildren are displayed, etc. If absent or < 0, all downstream branches are displayed. BACKGROUND: From a database perspective, LexBIG stores relationships internally in a forward direction, source to target. Due to differences in source formats, however, a wide variety of associations may be used ('PAR', 'CHD', 'isa', 'hasSubtype', etc). In addition, the direction of navigation may vary ('isa' expands in a reverse direction whereas 'hasSubtype' expands in a forward direction. The intent of the getHierarchy* methods on the LexBIGServiceConvenienceMethods interface is to simplify the process of hierarchy discovery and navigation. These methods significantly reduce the need to understand conventions for root nodes, associations, and direction of navigation for a specific source format.


Constructor Summary
ListHierarchyByCode()
           
 
Method Summary
static void main(java.lang.String[] args)
          Entry point for processing.
protected  void printLevelNext(LexBIGServiceConvenienceMethods lbscm, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String hierarchyID, java.lang.String code, int maxDistance, int currentDistance)
          Displays descendants for a code within the specified hierarchy up to the given distance or until all paths to leaf nodes is exhausted, recursing as necessary.
protected  void printLevelPrev(LexBIGServiceConvenienceMethods lbscm, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String hierarchyID, java.lang.String code, int maxDistance, int currentDistance)
          Displays ancestors for a code within the specified hierarchy up to the given distance or until paths to root nodes are exhausted, recursing as necessary.
 void run(java.lang.String code, int maxDistance)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListHierarchyByCode

public ListHierarchyByCode()
Method Detail

main

public static void main(java.lang.String[] args)
Entry point for processing.

Parameters:
args -

run

public void run(java.lang.String code,
                int maxDistance)
         throws LBException
Throws:
LBException

printLevelPrev

protected void printLevelPrev(LexBIGServiceConvenienceMethods lbscm,
                              java.lang.String scheme,
                              CodingSchemeVersionOrTag csvt,
                              java.lang.String hierarchyID,
                              java.lang.String code,
                              int maxDistance,
                              int currentDistance)
                       throws LBException
Displays ancestors for a code within the specified hierarchy up to the given distance or until paths to root nodes are exhausted, recursing as necessary.

Parameters:
lbcsm -
scheme -
csvt -
hierarchyID -
code -
maxDistance -
currentDistance -
Throws:
LBException

printLevelNext

protected void printLevelNext(LexBIGServiceConvenienceMethods lbscm,
                              java.lang.String scheme,
                              CodingSchemeVersionOrTag csvt,
                              java.lang.String hierarchyID,
                              java.lang.String code,
                              int maxDistance,
                              int currentDistance)
                       throws LBException
Displays descendants for a code within the specified hierarchy up to the given distance or until all paths to leaf nodes is exhausted, recursing as necessary.

Parameters:
lbscm -
scheme -
csvt -
hierarchyID -
code -
maxDistance -
currentDistance -
Throws:
LBException

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.