gov.nih.nci.lexbig.ext
Class NavigationUtils

java.lang.Object
  extended by gov.nih.nci.lexbig.ext.NavigationUtils

public class NavigationUtils
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. It is primarily geared towards the NCI Metathesaurus source. Hierarchies are navigated primarily through the UMLS-defined PAR (has parent) and CHD (has child) relationships. This program accepts two parameters. The first indicates the depth to display hierarchical relations. If 0, only the root nodes are displayed. If 1, nodes immediately subsumed by the root are also displayed, etc. If < 0, a default depth of 0 is assumed. The second parameter must provide the source abbreviation (SAB) of the Metathesaurus source to be evaluated (e.g. ICD9CM, MDR, SNOMEDCT).


Constructor Summary
NavigationUtils()
           
 
Method Summary
 void closeWriter(java.io.PrintWriter pw)
           
protected static java.util.HashMap getAssociatedNodes(LexBIGService lbSvc, java.lang.String scheme, java.lang.String sab, CodingSchemeVersionOrTag csvt, java.lang.String code, boolean navigateForward)
           
static java.util.HashMap getChildNodes(LexBIGService lbSvc, java.lang.String scheme, java.lang.String sab, CodingSchemeVersionOrTag csvt, java.lang.String code)
           
protected static Association getChildrenBySource(LexBIGService lbs, LexBIGServiceConvenienceMethods lbscm, java.lang.String sab, java.lang.String conceptCode, java.lang.String relationship, java.lang.String association, java.lang.String codingScheme, CodingSchemeVersionOrTag versionOrTag, boolean buildReferencedEntries)
          Return immediate children of the given node within a source SAB when navigating the specified association.
protected static ResolvedConceptReferenceList getEndNodes(LexBIGService lbs, java.lang.String codingScheme, CodingSchemeVersionOrTag versionOrTag, java.lang.String relationContext, java.lang.String association, java.lang.String associatedSAB)
          Retrieves the nodes attached to the system-designated end node ('@@') for the given association and source SAB.
static java.util.HashMap getParentNodes(LexBIGService lbSvc, java.lang.String scheme, java.lang.String sab, CodingSchemeVersionOrTag csvt, java.lang.String code)
           
protected static Association getParentsBySource(LexBIGService lbs, LexBIGServiceConvenienceMethods lbscm, java.lang.String sab, java.lang.String conceptCode, java.lang.String relationship, java.lang.String association, java.lang.String codingScheme, CodingSchemeVersionOrTag versionOrTag, boolean buildReferencedEntries)
          Return immediate parents of the given node within a source SAB when navigating the given association.
static ResolvedConceptReferenceList getRootNodes(LexBIGService lbSvc, java.lang.String sab, java.lang.String scheme, CodingSchemeVersionOrTag csvt)
           
protected static ResolvedConceptReferenceList getTopNodes(LexBIGService lbs, java.lang.String codingScheme, CodingSchemeVersionOrTag versionOrTag, java.lang.String relationContext, java.lang.String association, java.lang.String associatedSAB)
           
 java.io.PrintWriter openPrintWriter(java.lang.String outputfile)
           
protected static void printNodes(java.util.HashMap hmap)
           
static void printNodes(java.io.PrintWriter pw, java.util.HashMap hmap)
           
static void printRootNodes(ResolvedConceptReferenceList rootNodes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NavigationUtils

public NavigationUtils()
Method Detail

getRootNodes

public static ResolvedConceptReferenceList getRootNodes(LexBIGService lbSvc,
                                                        java.lang.String sab,
                                                        java.lang.String scheme,
                                                        CodingSchemeVersionOrTag csvt)
                                                 throws LBException
Throws:
LBException

printRootNodes

public static void printRootNodes(ResolvedConceptReferenceList rootNodes)

printNodes

protected static void printNodes(java.util.HashMap hmap)

printNodes

public static void printNodes(java.io.PrintWriter pw,
                              java.util.HashMap hmap)

getChildNodes

public static java.util.HashMap getChildNodes(LexBIGService lbSvc,
                                              java.lang.String scheme,
                                              java.lang.String sab,
                                              CodingSchemeVersionOrTag csvt,
                                              java.lang.String code)

getParentNodes

public static java.util.HashMap getParentNodes(LexBIGService lbSvc,
                                               java.lang.String scheme,
                                               java.lang.String sab,
                                               CodingSchemeVersionOrTag csvt,
                                               java.lang.String code)

getAssociatedNodes

protected static java.util.HashMap getAssociatedNodes(LexBIGService lbSvc,
                                                      java.lang.String scheme,
                                                      java.lang.String sab,
                                                      CodingSchemeVersionOrTag csvt,
                                                      java.lang.String code,
                                                      boolean navigateForward)

getChildrenBySource

protected static Association getChildrenBySource(LexBIGService lbs,
                                                 LexBIGServiceConvenienceMethods lbscm,
                                                 java.lang.String sab,
                                                 java.lang.String conceptCode,
                                                 java.lang.String relationship,
                                                 java.lang.String association,
                                                 java.lang.String codingScheme,
                                                 CodingSchemeVersionOrTag versionOrTag,
                                                 boolean buildReferencedEntries)
                                          throws LBException
Return immediate children of the given node within a source SAB when navigating the specified association.

Parameters:
lbscm -
sab -
conceptCode -
relationship -
association -
codingScheme -
versionOrTag -
buildReferencedEntries -
Returns:
Throws:
LBException

getParentsBySource

protected static Association getParentsBySource(LexBIGService lbs,
                                                LexBIGServiceConvenienceMethods lbscm,
                                                java.lang.String sab,
                                                java.lang.String conceptCode,
                                                java.lang.String relationship,
                                                java.lang.String association,
                                                java.lang.String codingScheme,
                                                CodingSchemeVersionOrTag versionOrTag,
                                                boolean buildReferencedEntries)
                                         throws LBException
Return immediate parents of the given node within a source SAB when navigating the given association.

Parameters:
lbscm -
sab -
conceptCode -
relationship -
association -
codingScheme -
versionOrTag -
buildReferencedEntries -
Returns:
Throws:
LBException

getTopNodes

protected static ResolvedConceptReferenceList getTopNodes(LexBIGService lbs,
                                                          java.lang.String codingScheme,
                                                          CodingSchemeVersionOrTag versionOrTag,
                                                          java.lang.String relationContext,
                                                          java.lang.String association,
                                                          java.lang.String associatedSAB)
                                                   throws LBException
Throws:
LBException

getEndNodes

protected static ResolvedConceptReferenceList getEndNodes(LexBIGService lbs,
                                                          java.lang.String codingScheme,
                                                          CodingSchemeVersionOrTag versionOrTag,
                                                          java.lang.String relationContext,
                                                          java.lang.String association,
                                                          java.lang.String associatedSAB)
                                                   throws LBException
Retrieves the nodes attached to the system-designated end node ('@@') for the given association and source SAB.

Parameters:
codingScheme -
versionOrTag -
relationContext -
association -
associatedSAB -
Returns:
Throws:
LBException

openPrintWriter

public java.io.PrintWriter openPrintWriter(java.lang.String outputfile)

closeWriter

public void closeWriter(java.io.PrintWriter pw)


Copyright © 2007 National Cancer Institute (NCI). All Rights Reserved.