org.LexGrid.LexBIG.example
Class ListHierarchy

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

public class ListHierarchy
extends java.lang.Object

Example showing how to determine and display an unsorted list of root and subsumed nodes, up to a specified depth, for hierarchical relationships. This program accepts two parameters: The first parameter indicates the depth to display for the hierarchy. If 1, nodes immediately subsumed by the root are displayed. If 2, grandchildren are displayed, etc. If absent or < 0, a default depth of 3 is assumed. The second parameter optionally indicates a specific hierarchy to navigate. If provided, this must match a registered identifier in the coding scheme supported hierarchy metadata. If left unspecified, all hierarchical associations are navigated. If an incorrect value is specified, a list of supported values will be output for future reference. 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
ListHierarchy()
           
 
Method Summary
static void main(java.lang.String[] args)
          Entry point for processing.
protected  void printHierarchies(LexBIGService lbSvc, java.lang.String scheme, CodingSchemeVersionOrTag csvt, int maxDepth, java.lang.String hierarchyID)
          Discovers all registered hierarchies for the coding scheme and display each in turn.
protected  void printHierarchyBranch(LexBIGServiceConvenienceMethods lbscm, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String hierarchyID, ResolvedConceptReference branchRoot, int currentDepth, int maxDepth, java.lang.String assocName)
          Handles recursive display of hierarchy for the given start node, up to the maximum specified depth.
 void run(int maxDepth, java.lang.String hID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListHierarchy

public ListHierarchy()
Method Detail

main

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

Parameters:
args -

run

public void run(int maxDepth,
                java.lang.String hID)
         throws LBException
Throws:
LBException

printHierarchies

protected void printHierarchies(LexBIGService lbSvc,
                                java.lang.String scheme,
                                CodingSchemeVersionOrTag csvt,
                                int maxDepth,
                                java.lang.String hierarchyID)
                         throws LBException
Discovers all registered hierarchies for the coding scheme and display each in turn.

Parameters:
lbSvc -
scheme -
csvt -
maxDepth -
hierarchyID -
Throws:
LBException

printHierarchyBranch

protected void printHierarchyBranch(LexBIGServiceConvenienceMethods lbscm,
                                    java.lang.String scheme,
                                    CodingSchemeVersionOrTag csvt,
                                    java.lang.String hierarchyID,
                                    ResolvedConceptReference branchRoot,
                                    int currentDepth,
                                    int maxDepth,
                                    java.lang.String assocName)
                             throws LBException
Handles recursive display of hierarchy for the given start node, up to the maximum specified depth.

Parameters:
lbscm -
scheme -
csvt -
hierarchyID -
branchRoot -
currentDepth -
maxDepth -
assocName -
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.