|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.LexGrid.LexBIG.example.FindUMLSContextsForCUI
public class FindUMLSContextsForCUI
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. Example displays explicitly asserted source hierarchies (based on import of MRHIER HCD) for a CUI. The program takes a single argument (a UMLS CUI), prompts for the code system to query in the LexGrid repository, and displays the HCD-based context relationships along with other details. Note that this example does not print intra-CUI associations (links that might exist between individual terms on a single concept) or hierarchies not explicitly tagged by HCD. The selected code system must represent the full Metathesaurus.
Nested Class Summary | |
---|---|
protected class |
FindUMLSContextsForCUI.TreeItem
Inner class to hold tree items for printout. |
Constructor Summary | |
---|---|
FindUMLSContextsForCUI()
|
Method Summary | |
---|---|
protected FindUMLSContextsForCUI.TreeItem[] |
buildPaths(ResolvedConceptReference rcr,
java.lang.String scheme,
CodingSchemeVersionOrTag csvt,
java.lang.String hcd,
CodedNodeSet hcdConceptMatch)
Build and return a tree item that represents the hierarchical entries for the given concept reference and hierarchical context identifier (HCD). |
protected void |
buildPathsToLowerNodes(FindUMLSContextsForCUI.TreeItem ti,
ResolvedConceptReference rcr,
java.lang.String scheme,
CodingSchemeVersionOrTag csvt,
java.lang.String hcd,
CodedNodeSet hcdConceptMatch,
java.util.Map<java.lang.String,FindUMLSContextsForCUI.TreeItem> code2Tree)
Add all hierarchical relationships that start from the referenced concept and move forward in the tree. |
protected void |
buildPathsToUpperNodes(FindUMLSContextsForCUI.TreeItem ti,
ResolvedConceptReference rcr,
java.lang.String scheme,
CodingSchemeVersionOrTag csvt,
java.lang.String hcd,
CodedNodeSet hcdConceptMatch,
java.util.Map<java.lang.String,FindUMLSContextsForCUI.TreeItem> code2Tree,
java.util.Set<FindUMLSContextsForCUI.TreeItem> roots)
Add all hierarchical relationships that start from the referenced concept and move backward in the tree. |
protected LexBIGServiceConvenienceMethods |
getConvenienceMethods()
Returns a cached instance of convenience methods. |
protected java.lang.String |
getDetailedText(ResolvedConceptReference rcr,
java.lang.String hcd,
java.lang.String scheme,
CodingSchemeVersionOrTag csvt)
Returns contextual text for the given item in the format [CUI]:[AUI]:[SAB]:[Text]. |
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 java.lang.String |
getHCDText(ResolvedConceptReference rcr,
java.lang.String hcd)
Returns text for an assigned presentation matching the given context identifier (HCD). |
protected LexBIGService |
getLexBIGService()
Returns a cached instance of a LexBIG service. |
protected java.lang.String |
getSourceText(AssociatedConcept ac)
Returns a string containing the names of all sources asserted on the association to the concept delimited by '|'. |
protected boolean |
isValidForHCD(AssociatedConcept ac,
java.lang.String hcd)
Indicates whether the given associated concept contains a qualifier for the given hierarchical context (HCD). |
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 ResolvedConceptReference |
printCode(java.lang.String cui,
java.lang.String scheme,
CodingSchemeVersionOrTag csvt)
Display name and description information for the given CUI. |
protected void |
printContext(ResolvedConceptReference rcr,
java.lang.String scheme,
CodingSchemeVersionOrTag csvt)
Recursively display each source-asserted hierarchy that the code participates in, based on tagging by HCD qualifier, with additional information. |
protected void |
printPath(FindUMLSContextsForCUI.TreeItem ti,
java.lang.String focusCode,
int depth,
java.util.Map<FindUMLSContextsForCUI.TreeItem,java.lang.Integer> item2Depth)
Prints the given item, recursing to print all children. |
void |
run(java.lang.String cui)
Process the provided code. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FindUMLSContextsForCUI()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- public void run(java.lang.String cui) throws LBException
LBException
protected ResolvedConceptReference printCode(java.lang.String cui, java.lang.String scheme, CodingSchemeVersionOrTag csvt) throws LBException
LBException
protected void printContext(ResolvedConceptReference rcr, java.lang.String scheme, CodingSchemeVersionOrTag csvt) throws LBException
LBException
protected FindUMLSContextsForCUI.TreeItem[] buildPaths(ResolvedConceptReference rcr, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String hcd, CodedNodeSet hcdConceptMatch) throws LBException
LBException
protected void buildPathsToLowerNodes(FindUMLSContextsForCUI.TreeItem ti, ResolvedConceptReference rcr, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String hcd, CodedNodeSet hcdConceptMatch, java.util.Map<java.lang.String,FindUMLSContextsForCUI.TreeItem> code2Tree) throws LBException
LBException
protected void buildPathsToUpperNodes(FindUMLSContextsForCUI.TreeItem ti, ResolvedConceptReference rcr, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String hcd, CodedNodeSet hcdConceptMatch, java.util.Map<java.lang.String,FindUMLSContextsForCUI.TreeItem> code2Tree, java.util.Set<FindUMLSContextsForCUI.TreeItem> roots) throws LBException
LBException
protected LexBIGService getLexBIGService() throws LBException
LBException
protected LexBIGServiceConvenienceMethods getConvenienceMethods() throws LBException
LBException
protected java.lang.String getDetailedText(ResolvedConceptReference rcr, java.lang.String hcd, java.lang.String scheme, CodingSchemeVersionOrTag csvt) 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 getHCDText(ResolvedConceptReference rcr, java.lang.String hcd)
rcr
- Concept resolved from a query.hcd
- The hierarchical context identifier.
protected java.lang.String getSourceText(AssociatedConcept ac)
protected void printPath(FindUMLSContextsForCUI.TreeItem ti, java.lang.String focusCode, int depth, java.util.Map<FindUMLSContextsForCUI.TreeItem,java.lang.Integer> item2Depth)
protected boolean isValidForHCD(AssociatedConcept ac, java.lang.String hcd)
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 |