edu.mayo.informatics.lexgrid.convert.directConversions
Class MetaThesaurusToSQL

java.lang.Object
  extended by edu.mayo.informatics.lexgrid.convert.directConversions.UmlsCommon.UMLSBaseCode
      extended by edu.mayo.informatics.lexgrid.convert.directConversions.MetaThesaurusToSQL

public class MetaThesaurusToSQL
extends UMLSBaseCode

A tool to load the LexGrid SQL table from UMLS - using the CUI's as the concept codes.

Version:
subversion $Revision: 9222 $ checked in on $Date: 2008-06-12 11:25:47 -0500 (Thu, 12 Jun 2008) $
Author:
Dan Armbrust , Thomas Johnson, Kevin Peterson, Deepak Sharma

Nested Class Summary
protected  class MetaThesaurusToSQL.QualifierHolder
          Inner class to track keyed references to source qualifiers.
 
Nested classes/interfaces inherited from class edu.mayo.informatics.lexgrid.convert.directConversions.UmlsCommon.UMLSBaseCode
UMLSBaseCode.Association, UMLSBaseCode.AssociationQualification, UMLSBaseCode.AssociationSorter, UMLSBaseCode.CodeHolder, UMLSBaseCode.ConceptPresentation, UMLSBaseCode.ConceptPresentationSorter, UMLSBaseCode.SABString
 
Field Summary
 
Fields inherited from class edu.mayo.informatics.lexgrid.convert.directConversions.UmlsCommon.UMLSBaseCode
associationQualifierRUI_, auiToCodeCache_, batchSize, defaultLanguage_, entryStateId_, getAllAssocQualifiersFromRRF_, getAssocInstance_, getAssocQualifier_, getAssocQualifierFromRRF_, getAUIFromPresentation_, getCodeForCUI_, getCodeForCUINoAUI_, getPresentationRank_, getPropIds_, getSource_, getUMLSRoot_, insertIntoAssociations, insertIntoCodingScheme, insertIntoCodingSchemeMultiAttributes, insertIntoCodingSchemeSupportedAttributes, insertIntoConceptsMultiAttributes, insertIntoEntities, insertIntoEntityAssociationsToEntity, insertIntoEntityAssociationsToEntityQualifier, insertIntoEntityProperty, insertIntoEntityPropertyLinks, insertIntoEntityPropertyMultiAttributes, insertIntoEntityType, insertIntoEntryState, insertIntoRelations, isoMap, loadedAssociations_, loadPrefs_, log, manifestLocation_, manifestNameChange_, messages_, mrconsoRepresentationalMap_, MRRANK_, sabToCodeSystem_, schemeToHierNames_, sqlConnection_, sqlModifier_, sqlTableUtility_, stc_, supportedAssociationQualifiers_, supportedAssociations_, supportedCodingSchemes_, supportedHierarchies_, supportedLanguages_, supportedPropertyLinks_, supportedPropertyQualifiers_, supportedPropertyTypes_, supportedSources_, umlsConnection_, umlsConnection2_, umlsSqlModifier_
 
Constructor Summary
MetaThesaurusToSQL(java.lang.String sqlServer, java.lang.String sqlDriver, java.lang.String sqlUserName, java.lang.String sqlPassword, java.lang.String tablePrefix, java.lang.String umlsServer, java.lang.String umlsDriver, java.lang.String umlsUserName, java.lang.String umlsPassword, LoaderPreferences loadPrefs, java.net.URI manifestLocation, boolean enforceIntegrity, boolean rootRecalcOnly, LgMessageDirectorIF director)
          Class to convert from UMLS to SQL.
 
Method Summary
protected  boolean addConceptAssociationToConceptsHelper(java.lang.String currentCodingScheme, java.lang.String sourceCode, java.lang.String association, java.lang.String targetCode, java.lang.String sourceOfAssociation, java.lang.String roleGroup, java.lang.String forwardName, java.lang.String reverseName, int count)
          Add a code to code association.
protected  void buildRootNodes(java.lang.String codingSchemeName)
          Build navigable relations from special endpoint nodes '@' and '@@' to first level nodes in hierarchical associations.
 java.lang.String getCodingSchemeName()
           
protected  java.lang.String[] getHierAssocNames(java.lang.String codeSystemName)
          Returns the names of the hierarchical associations in use for the LexGrid code system of the given name.
protected  java.lang.String getPresentationFromAUI(java.lang.String codingSchemeName, java.lang.String code, java.lang.String aui)
          Gets the Presentation ID (for example, T1) given a specific AUI, Code, and Coding Scheme Name first level nodes in hierarchical associations.
protected  int loadContext(UMLSBaseCode.AssociationQualification aq, boolean constructHCD, java.lang.String rela, int totalCount)
          Adds qualification to concepts and associations in the LexGrid repository.
protected  void loadRelations(java.lang.String codingSchemeName)
          High level method with responsibility to map relationship content from UMLS RRF-based format to LexGrid model.
protected  int loadRelationsHelper(UMLSBaseCode.Association assoc, java.lang.String codingSchemeName)
          Carry out the mapping of relationships from UMLS RRF-based format to LexGrid model.
static void main(java.lang.String[] args)
           
protected  void populateSupportedAssociations()
          Detect and register association information to the array of supported associations maintained by the loader.
protected  void qualifyConceptPresentation(java.lang.String code, java.lang.String aui, java.lang.String codingSchemeName, java.lang.String qualifierName, java.lang.String qualifierValue)
          Add context qualifiers to text presentations for matching concepts (Overrides UMLSBAaseCode method).
protected  void rebuildRootNodes()
          Remove and rebuild navigable relations from special endpoint nodes '@' and '@@' to first level nodes in hierarchical associations.
 
Methods inherited from class edu.mayo.informatics.lexgrid.convert.directConversions.UmlsCommon.UMLSBaseCode
addAssociationToAssociations, addConceptToConcepts, addConceptToConceptsMultiAttributes, addConceptToEntityPropertyMultiAttributes, addEntityAssociationQualifierToEntityAssociation, addEntityAssociationToEntity, addEntityType, addEntryState, addRelationToRelations, addToCodingScheme, addToEntityProperty, buildRootNode, closeConnections, closeLoadStatements, generateUniqueKey, generateUniqueKey, get5DigitRandom, getCodingSchemeNameFromManifest, getExpandedForm, getHierRelas, getHierRels, getIsoMap, getISOString, getRegisteredNameFromManifest, getRelaNames, getRelationInverseName, getRelationSABs, getSHA1, getSourceVersionString, initIsoMap, initLoadStatements, initMRCONSOTTYMAP, insertIntoCodingSchemeSupportedAttributes, insertIntoConceptPropertyLinks, isHierarchicalAssociation, isHierarchicalName, isLoaded, isLoaded, loadDefaultSupportedNamespace, loadLoaderPreferences, loadMRRANK, loadSupportedAssociationQualifiers, loadSupportedLanguages, loadSupportedProperties, loadSupportedPropertyLinks, loadSupportedPropertyQualifiers, loadSupportedSources, makeConnections, mapCodeSystemNameToSAB, mapCUIToCode, mapCUIToCodeWithAUI, mapRela, mapSABToCodeSystemName, mapSupportedAssociationsHelper, mapVSABtoRSAB, markLoaded, markLoaded, toCommaDelimitedWithQuotes, updateApproxNumberOfConcepts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaThesaurusToSQL

public MetaThesaurusToSQL(java.lang.String sqlServer,
                          java.lang.String sqlDriver,
                          java.lang.String sqlUserName,
                          java.lang.String sqlPassword,
                          java.lang.String tablePrefix,
                          java.lang.String umlsServer,
                          java.lang.String umlsDriver,
                          java.lang.String umlsUserName,
                          java.lang.String umlsPassword,
                          LoaderPreferences loadPrefs,
                          java.net.URI manifestLocation,
                          boolean enforceIntegrity,
                          boolean rootRecalcOnly,
                          LgMessageDirectorIF director)
                   throws java.lang.Exception
Class to convert from UMLS to SQL.

Parameters:
sqlServer - location of SQL server
sqlDriver - SQL driver class
sqlUserName - user name for server authentication
sqlPassword - password for server authentication
umlsServer - location of UMLS server
umlsDriver - UMLS driver class
umlsUserName - user name for server authentication
umlsPassword - password for server authentication
loadPrefs - loader peferences
manifestLocation - manifest location
enforceIntegrity - enforce foreign key constraints on tables
rootRecalcOnly - recalculate root nodes only
director - message director for log output
Throws:
java.lang.Exception
Method Detail

loadContext

protected int loadContext(UMLSBaseCode.AssociationQualification aq,
                          boolean constructHCD,
                          java.lang.String rela,
                          int totalCount)
                   throws java.sql.SQLException
Adds qualification to concepts and associations in the LexGrid repository.

Overrides:
loadContext in class UMLSBaseCode
Parameters:
aq - Qualification information from the UMLS source.
constructHCD - Indicates whether artificial context values should be constructed if not provided in the UMLS information.
rela - The relationship attribute defined by UMLS (can be empty or null).
totalCount - The total number of context links qualified previously.
Returns:
The number of contextual links qualified in the repository for the given UMLS info.
Throws:
java.sql.SQLException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getCodingSchemeName

public java.lang.String getCodingSchemeName()
Returns:
the codingSchemeName

addConceptAssociationToConceptsHelper

protected boolean addConceptAssociationToConceptsHelper(java.lang.String currentCodingScheme,
                                                        java.lang.String sourceCode,
                                                        java.lang.String association,
                                                        java.lang.String targetCode,
                                                        java.lang.String sourceOfAssociation,
                                                        java.lang.String roleGroup,
                                                        java.lang.String forwardName,
                                                        java.lang.String reverseName,
                                                        int count)
                                                 throws java.sql.SQLException
Add a code to code association.

Parameters:
currentCodingScheme -
sourceCode -
association -
targetCode -
sourceOfAssociation -
forwardName -
reverseName -
count -
Returns:
true if the association was added; false if an error occurred or the association was already defined.
Throws:
java.sql.SQLException

qualifyConceptPresentation

protected void qualifyConceptPresentation(java.lang.String code,
                                          java.lang.String aui,
                                          java.lang.String codingSchemeName,
                                          java.lang.String qualifierName,
                                          java.lang.String qualifierValue)
                                   throws java.sql.SQLException
Add context qualifiers to text presentations for matching concepts (Overrides UMLSBAaseCode method).

Overrides:
qualifyConceptPresentation in class UMLSBaseCode
Parameters:
code - The code of the concept to qualify.
aui - The AUI identifying specific context text to be matched.
codingSchemeName - The coding scheme container the code to be qualified.
qualifierName - The qualifier name (e.g. 'HCD').
qualifierValue - The qualifier value.
Throws:
java.sql.SQLException

getPresentationFromAUI

protected java.lang.String getPresentationFromAUI(java.lang.String codingSchemeName,
                                                  java.lang.String code,
                                                  java.lang.String aui)
                                           throws java.sql.SQLException
Gets the Presentation ID (for example, T1) given a specific AUI, Code, and Coding Scheme Name first level nodes in hierarchical associations.

Parameters:
codingSchemeName - The LexGrid code system name.
code - The code (CUI) to look for
aui - The AUI within the given code
Returns:
String The Presentation ID
Throws:
java.sql.SQLException

buildRootNodes

protected void buildRootNodes(java.lang.String codingSchemeName)
                       throws java.sql.SQLException
Build navigable relations from special endpoint nodes '@' and '@@' to first level nodes in hierarchical associations.

Parameters:
codingSchemeName - The LexGrid code system name.
Throws:
java.sql.SQLException

getHierAssocNames

protected java.lang.String[] getHierAssocNames(java.lang.String codeSystemName)
                                        throws java.sql.SQLException
Returns the names of the hierarchical associations in use for the LexGrid code system of the given name.

Overrides:
getHierAssocNames in class UMLSBaseCode
Parameters:
codeSystemName -
Returns:
String[]
Throws:
java.sql.SQLException - If an error occurs resolving from the source.

loadRelations

protected void loadRelations(java.lang.String codingSchemeName)
                      throws java.sql.SQLException
High level method with responsibility to map relationship content from UMLS RRF-based format to LexGrid model.

Parameters:
codingSchemeName -
Throws:
java.sql.SQLException

loadRelationsHelper

protected int loadRelationsHelper(UMLSBaseCode.Association assoc,
                                  java.lang.String codingSchemeName)
                           throws java.sql.SQLException
Carry out the mapping of relationships from UMLS RRF-based format to LexGrid model.

Parameters:
assoc -
codingSchemeName -
Returns:
The number of association instances added to the LexGrid repository.
Throws:
java.sql.SQLException

populateSupportedAssociations

protected void populateSupportedAssociations()
                                      throws java.sql.SQLException
Detect and register association information to the array of supported associations maintained by the loader.

Throws:
java.sql.SQLException

rebuildRootNodes

protected void rebuildRootNodes()
                         throws java.sql.SQLException
Remove and rebuild navigable relations from special endpoint nodes '@' and '@@' to first level nodes in hierarchical associations.

Throws:
java.sql.SQLException

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.