|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.LexGrid.LexBIG.example.BuildTreeForMetaCodeBySource
public class BuildTreeForMetaCodeBySource
NOTE: This example is intended to run only against code systems representing the entire Metathesaurus. It depends on the presence of concepts based on CUIs and the import of source and hierarchical definitions as property and association qualifiers. These attributes are only populated by the NCI Meta loader. Attempts to provide a tree, based on a focus code, that includes the following information:
- All paths from the hierarchy root to one or more focus codes. - Immediate children of every node in path to root - Indicator to show whether any unexpanded node can be further expandedThis example accepts two parameters... The first parameter is required, and must contain at least one code in a comma-delimited list. A tree is produced for each code. Time to produce the tree for each code is printed in milliseconds. In order to factor out costs of startup and shutdown, resolving multiple codes may offer a better overall estimate performance. The second parameter is also required. It should provide a source abbreviation (SAB) used to constrain the relationships navigated to a single Meta source. If not specified, all sources are navigated. Note that this example does not print intra-CUI associations (links that might exist between individual terms on a single concept). The selected code system must represent the full Metathesaurus.
Nested Class Summary | |
---|---|
protected class |
BuildTreeForMetaCodeBySource.TreeItem
Inner class to hold tree items for printout. |
Constructor Summary | |
---|---|
BuildTreeForMetaCodeBySource()
|
Method Summary | |
---|---|
protected void |
addChildren(BuildTreeForMetaCodeBySource.TreeItem ti,
java.lang.String scheme,
CodingSchemeVersionOrTag csvt,
java.lang.String sab,
java.lang.String branchRootCode,
java.util.Set<java.lang.String> codesToExclude,
java.lang.String[] associationsToNavigate,
boolean associationsNavigatedFwd)
Populate child nodes for a single branch of the tree, and indicates whether further expansion (to grandchildren) is possible. |
protected BuildTreeForMetaCodeBySource.TreeItem[] |
buildPathsToRoot(ResolvedConceptReference rcr,
java.lang.String scheme,
CodingSchemeVersionOrTag csvt,
java.lang.String sab)
Build and returns tree items that represent the root and core concepts of resolved paths for printing. |
protected void |
buildPathsToUpperNodes(BuildTreeForMetaCodeBySource.TreeItem ti,
ResolvedConceptReference rcr,
java.lang.String scheme,
CodingSchemeVersionOrTag csvt,
java.lang.String sab,
java.util.Map<java.lang.String,BuildTreeForMetaCodeBySource.TreeItem> code2Tree,
java.util.Set<BuildTreeForMetaCodeBySource.TreeItem> roots)
Add all hierarchical paths to root that start from the referenced concept and move backward in the tree. |
protected java.lang.String |
getAtomText(Property prop)
Returns text for AUI qualifiers for the given property. |
protected java.lang.String |
getAtomText(ResolvedConceptReference rcr,
java.lang.String sab)
Returns a string representing the AUIs and text presentations applicable only for the given source abbreviation (SAB). |
protected LexBIGServiceConvenienceMethods |
getConvenienceMethods()
Returns a cached instance of convenience methods. |
protected java.lang.String |
getDirectionalLabel(java.lang.String scheme,
CodingSchemeVersionOrTag csvt,
Association assoc,
boolean navigatedFwd)
Returns the label to display for the given association and directional indicator. |
protected LexBIGService |
getLexBIGService()
Returns a cached instance of a LexBIG service. |
protected Presentation[] |
getSourcePresentations(ResolvedConceptReference rcr,
java.lang.String sab)
Returns all assigned presentations matching the given source abbreviation (SAB). |
protected boolean |
isValidForSAB(AssociatedConcept ac,
java.lang.String sab)
Indicates whether the given associated concept contains a qualifier for the given source abbreviation (SAB). |
static void |
main(java.lang.String[] args)
Entry point for processing. |
protected void |
printHeader(ResolvedConceptReference rcr,
java.lang.String sab)
Prints formatted text providing context for the given item including CUI, SAB, AUI, and Text. |
protected void |
printNeighborhood(java.lang.String scheme,
CodingSchemeVersionOrTag csvt,
ResolvedConceptReference rcr,
java.lang.String sab)
Prints formatted text with the CUIs and AUIs of neighboring concepts for the requested SAB. |
protected void |
printTree(BuildTreeForMetaCodeBySource.TreeItem ti,
java.lang.String focusCode,
int depth)
Prints the given tree item, recursing through all branches. |
protected ResolvedConceptReference |
resolveConcept(java.lang.String scheme,
CodingSchemeVersionOrTag csvt,
java.lang.String code)
Returns a resolved concept for the specified code and scheme. |
void |
run(java.lang.String cui,
java.lang.String sab)
Process the provided code, constraining relationships to the given source abbreviation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BuildTreeForMetaCodeBySource()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- public void run(java.lang.String cui, java.lang.String sab) throws LBException
LBException
protected void printHeader(ResolvedConceptReference rcr, java.lang.String sab) throws LBException
LBException
protected void printTree(BuildTreeForMetaCodeBySource.TreeItem ti, java.lang.String focusCode, int depth)
ti
- protected void printNeighborhood(java.lang.String scheme, CodingSchemeVersionOrTag csvt, ResolvedConceptReference rcr, java.lang.String sab) throws LBException
LBException
protected void addChildren(BuildTreeForMetaCodeBySource.TreeItem ti, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String sab, java.lang.String branchRootCode, java.util.Set<java.lang.String> codesToExclude, java.lang.String[] associationsToNavigate, boolean associationsNavigatedFwd) throws LBException
LBException
protected BuildTreeForMetaCodeBySource.TreeItem[] buildPathsToRoot(ResolvedConceptReference rcr, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String sab) throws LBException
LBException
protected void buildPathsToUpperNodes(BuildTreeForMetaCodeBySource.TreeItem ti, ResolvedConceptReference rcr, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String sab, java.util.Map<java.lang.String,BuildTreeForMetaCodeBySource.TreeItem> code2Tree, java.util.Set<BuildTreeForMetaCodeBySource.TreeItem> roots) throws LBException
LBException
protected ResolvedConceptReference resolveConcept(java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String code) throws LBException
LBException
protected LexBIGService getLexBIGService() throws LBException
LBException
protected LexBIGServiceConvenienceMethods getConvenienceMethods() throws LBException
LBException
protected java.lang.String getDirectionalLabel(java.lang.String scheme, CodingSchemeVersionOrTag csvt, Association assoc, boolean navigatedFwd) throws LBException
LBException
protected java.lang.String getAtomText(ResolvedConceptReference rcr, java.lang.String sab)
protected java.lang.String getAtomText(Property prop)
protected Presentation[] getSourcePresentations(ResolvedConceptReference rcr, java.lang.String sab)
protected boolean isValidForSAB(AssociatedConcept ac, java.lang.String sab)
|
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. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |