org.lexevs.dao.database.sqlimplementedmethods
Class SQLImplementedMethodsDao

java.lang.Object
  extended by org.lexevs.dao.database.sqlimplementedmethods.SQLImplementedMethodsDao

public class SQLImplementedMethodsDao
extends java.lang.Object

SQL Queries necessary for LexBIG operations.

Version:
subversion $Revision: $ checked in on $Date: $
Author:
Dan Armbrust, Thomas Johnson, Deepak Sharma, Sridhar Dwarkanath, Kevin Peterson

Field Summary
protected static java.util.Map<java.lang.String,java.lang.String> csNamespaceToName_
          The cs namespace to name_.
 
Constructor Summary
SQLImplementedMethodsDao()
           
 
Method Summary
 Entity buildCodedEntry(java.lang.String internalCodingSchemeName, java.lang.String internalVersionString, java.lang.String code, java.lang.String namespace, LocalNameList restrictToProperties, CodedNodeSet.PropertyType[] restrictToPropertyTypes)
          Builds the coded entry.
 CodingScheme buildCodingScheme(java.lang.String internalCodingSchemeName, java.lang.String internalVersionString)
          Builds the coding scheme.
 EntityDescription buildConceptEntityDescription(java.lang.String internalCodingSchemeName, java.lang.String internalVersionString, java.lang.String conceptCode)
          Deprecated. 
protected static java.lang.String createUniqueKeyForSource(java.lang.String value, java.lang.String val1)
          Generate a unique key for a Source object.
 ConceptReference getAssociationReference(java.lang.String associationName, java.lang.String internalCodingSchemeName, java.lang.String internalVersionString)
          Gets the association reference.
 java.lang.String getCodingSchemeCopyright(java.lang.String internalCodingSchemeName, java.lang.String internalVersionString)
          Gets the coding scheme copyright.
 LgLoggerIF getLogger()
          Gets the logger.
 java.lang.String[] getNativeRelations(java.lang.String internalCodingScheme, java.lang.String internalVersionString)
          Gets the native relations.
 java.lang.String getRelationshipCodingSchemeNameForURN(java.lang.String urn, java.lang.String internalCodingSchemeName, java.lang.String internalVersionString)
          Get a the urn (registered name) for a coding scheme label used in the relationship tables.
 ResourceManager getResourceManager()
          Gets the resource manager.
 java.lang.String getURNForAssociationName(java.lang.String associationName, java.lang.String internalCodingSchemeName, java.lang.String internalVersionString)
          Get a the urn (registered name) for an association label used in the relationship tables.
 java.lang.String getURNForInternalCodingSchemeName(java.lang.String internalCodingSchemeName, java.lang.String internalVersionString)
          Get the urn (registered name) for a code systems internal coding scheme name.
 java.lang.String getURNForRelationshipCodingSchemeName(java.lang.String supportedCodingScheme, java.lang.String internalCodingSchemeName, java.lang.String internalVersionString, boolean throwError)
          Get a the urn (registered name) for a coding scheme label used in the relationship tables.
 boolean isAssociationSymmetric(java.lang.String internalCodingSchemeName, java.lang.String internalVersionString, java.lang.String relationName, java.lang.String association)
          Checks if is association symmetric.
protected static boolean isEntityAssnsToEQualsIndexPresent(SQLInterface si)
          Checks if the EntityAssnsToEQuals multiAttributesKey column index is present.
protected static boolean isEntryStateIdInAssociationTable(SQLInterface si)
          Checks if the current Association Table contains the EntryStateId column.
protected static float parseFloatFromTableVersion(SQLInterface si)
          Returns the float representation of the current table version.
 void setLogger(LgLoggerIF logger)
          Sets the logger.
 void setResourceManager(ResourceManager resourceManager)
          Sets the resource manager.
 boolean validateContext(java.lang.String internalCodingSchemeName, java.lang.String internalVersionString, java.lang.String context)
          Validate context.
 boolean validateLanguage(java.lang.String internalCodingSchemeName, java.lang.String internalVersionString, java.lang.String language)
          Validate language.
 boolean validateProperty(java.lang.String internalCodingSchemeName, java.lang.String internalVersionString, java.lang.String property)
          Validate property.
 boolean validatePropertyQualifier(java.lang.String internalCodingSchemeName, java.lang.String internalVersionString, java.lang.String propertyQualifier)
          Validate property qualifier.
 boolean validateSource(java.lang.String internalCodingSchemeName, java.lang.String internalVersionString, java.lang.String source)
          Validate source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

csNamespaceToName_

protected static java.util.Map<java.lang.String,java.lang.String> csNamespaceToName_
The cs namespace to name_.

Constructor Detail

SQLImplementedMethodsDao

public SQLImplementedMethodsDao()
Method Detail

buildCodingScheme

@Transactional
public CodingScheme buildCodingScheme(java.lang.String internalCodingSchemeName,
                                                    java.lang.String internalVersionString)
                               throws MissingResourceException,
                                      UnexpectedInternalError
Builds the coding scheme.

Parameters:
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
Returns:
the coding scheme
Throws:
MissingResourceException - the missing resource exception
UnexpectedInternalError - the unexpected internal error

buildCodedEntry

public Entity buildCodedEntry(java.lang.String internalCodingSchemeName,
                              java.lang.String internalVersionString,
                              java.lang.String code,
                              java.lang.String namespace,
                              LocalNameList restrictToProperties,
                              CodedNodeSet.PropertyType[] restrictToPropertyTypes)
                       throws UnexpectedInternalError,
                              MissingResourceException
Builds the coded entry.

Parameters:
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
code - the code
namespace - the namespace
restrictToProperties - the restrict to properties
restrictToPropertyTypes - the restrict to property types
Returns:
the entity
Throws:
UnexpectedInternalError - the unexpected internal error
MissingResourceException - the missing resource exception

buildConceptEntityDescription

@Deprecated
public EntityDescription buildConceptEntityDescription(java.lang.String internalCodingSchemeName,
                                                                  java.lang.String internalVersionString,
                                                                  java.lang.String conceptCode)
                                                throws MissingResourceException,
                                                       UnexpectedInternalError
Deprecated. 

Builds the concept entity description.

Parameters:
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
conceptCode - the concept code
Returns:
the entity description
Throws:
MissingResourceException - the missing resource exception
UnexpectedInternalError - the unexpected internal error

getCodingSchemeCopyright

public java.lang.String getCodingSchemeCopyright(java.lang.String internalCodingSchemeName,
                                                 java.lang.String internalVersionString)
                                          throws MissingResourceException,
                                                 UnexpectedInternalError
Gets the coding scheme copyright.

Parameters:
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
Returns:
the coding scheme copyright
Throws:
MissingResourceException - the missing resource exception
UnexpectedInternalError - the unexpected internal error

validateLanguage

public boolean validateLanguage(java.lang.String internalCodingSchemeName,
                                java.lang.String internalVersionString,
                                java.lang.String language)
                         throws UnexpectedInternalError,
                                MissingResourceException,
                                LBParameterException
Validate language.

Parameters:
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
language - the language
Returns:
true, if successful
Throws:
UnexpectedInternalError - the unexpected internal error
MissingResourceException - the missing resource exception
LBParameterException - the LB parameter exception

validateSource

public boolean validateSource(java.lang.String internalCodingSchemeName,
                              java.lang.String internalVersionString,
                              java.lang.String source)
                       throws UnexpectedInternalError,
                              MissingResourceException,
                              LBParameterException
Validate source.

Parameters:
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
source - the source
Returns:
true, if successful
Throws:
UnexpectedInternalError - the unexpected internal error
MissingResourceException - the missing resource exception
LBParameterException - the LB parameter exception

validateContext

public boolean validateContext(java.lang.String internalCodingSchemeName,
                               java.lang.String internalVersionString,
                               java.lang.String context)
                        throws UnexpectedInternalError,
                               MissingResourceException,
                               LBParameterException
Validate context.

Parameters:
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
context - the context
Returns:
true, if successful
Throws:
UnexpectedInternalError - the unexpected internal error
MissingResourceException - the missing resource exception
LBParameterException - the LB parameter exception

validatePropertyQualifier

public boolean validatePropertyQualifier(java.lang.String internalCodingSchemeName,
                                         java.lang.String internalVersionString,
                                         java.lang.String propertyQualifier)
                                  throws UnexpectedInternalError,
                                         MissingResourceException,
                                         LBParameterException
Validate property qualifier.

Parameters:
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
propertyQualifier - the property qualifier
Returns:
true, if successful
Throws:
UnexpectedInternalError - the unexpected internal error
MissingResourceException - the missing resource exception
LBParameterException - the LB parameter exception

validateProperty

public boolean validateProperty(java.lang.String internalCodingSchemeName,
                                java.lang.String internalVersionString,
                                java.lang.String property)
                         throws UnexpectedInternalError,
                                MissingResourceException,
                                LBParameterException
Validate property.

Parameters:
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
property - the property
Returns:
true, if successful
Throws:
UnexpectedInternalError - the unexpected internal error
MissingResourceException - the missing resource exception
LBParameterException - the LB parameter exception

getNativeRelations

public java.lang.String[] getNativeRelations(java.lang.String internalCodingScheme,
                                             java.lang.String internalVersionString)
                                      throws MissingResourceException,
                                             UnexpectedInternalError,
                                             LBParameterException
Gets the native relations.

Parameters:
internalCodingScheme - the internal coding scheme
internalVersionString - the internal version string
Returns:
the native relations
Throws:
MissingResourceException - the missing resource exception
UnexpectedInternalError - the unexpected internal error
LBParameterException - the LB parameter exception

getURNForInternalCodingSchemeName

public java.lang.String getURNForInternalCodingSchemeName(java.lang.String internalCodingSchemeName,
                                                          java.lang.String internalVersionString)
                                                   throws UnexpectedInternalError,
                                                          MissingResourceException
Get the urn (registered name) for a code systems internal coding scheme name. This is cached.

Parameters:
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
Returns:
the URN for internal coding scheme name
Throws:
UnexpectedInternalError - the unexpected internal error
MissingResourceException - the missing resource exception

getURNForRelationshipCodingSchemeName

public java.lang.String getURNForRelationshipCodingSchemeName(java.lang.String supportedCodingScheme,
                                                              java.lang.String internalCodingSchemeName,
                                                              java.lang.String internalVersionString,
                                                              boolean throwError)
                                                       throws MissingResourceException,
                                                              UnexpectedInternalError
Get a the urn (registered name) for a coding scheme label used in the relationship tables. This is cached.

Parameters:
supportedCodingScheme - the supported coding scheme
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
throwError - the throw error
Returns:
the URN for relationship coding scheme name
Throws:
MissingResourceException - the missing resource exception
UnexpectedInternalError - the unexpected internal error

getURNForAssociationName

public java.lang.String getURNForAssociationName(java.lang.String associationName,
                                                 java.lang.String internalCodingSchemeName,
                                                 java.lang.String internalVersionString)
                                          throws MissingResourceException,
                                                 UnexpectedInternalError
Get a the urn (registered name) for an association label used in the relationship tables. This is cached.

Parameters:
associationName - the association name
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
Returns:
the URN for association name
Throws:
MissingResourceException - the missing resource exception
UnexpectedInternalError - the unexpected internal error

getRelationshipCodingSchemeNameForURN

public java.lang.String getRelationshipCodingSchemeNameForURN(java.lang.String urn,
                                                              java.lang.String internalCodingSchemeName,
                                                              java.lang.String internalVersionString)
                                                       throws MissingResourceException,
                                                              UnexpectedInternalError
Get a the urn (registered name) for a coding scheme label used in the relationship tables. This is cached.

Parameters:
urn - the urn
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
Returns:
the relationship coding scheme name for urn
Throws:
MissingResourceException - the missing resource exception
UnexpectedInternalError - the unexpected internal error

getAssociationReference

public ConceptReference getAssociationReference(java.lang.String associationName,
                                                java.lang.String internalCodingSchemeName,
                                                java.lang.String internalVersionString)
                                         throws MissingResourceException,
                                                UnexpectedInternalError
Gets the association reference.

Parameters:
associationName - the association name
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
Returns:
the association reference
Throws:
MissingResourceException - the missing resource exception
UnexpectedInternalError - the unexpected internal error

isAssociationSymmetric

public boolean isAssociationSymmetric(java.lang.String internalCodingSchemeName,
                                      java.lang.String internalVersionString,
                                      java.lang.String relationName,
                                      java.lang.String association)
                               throws UnexpectedInternalError,
                                      MissingResourceException,
                                      LBParameterException
Checks if is association symmetric.

Parameters:
internalCodingSchemeName - the internal coding scheme name
internalVersionString - the internal version string
relationName - the relation name
association - the association
Returns:
true, if is association symmetric
Throws:
UnexpectedInternalError - the unexpected internal error
MissingResourceException - the missing resource exception
LBParameterException - the LB parameter exception

isEntityAssnsToEQualsIndexPresent

protected static boolean isEntityAssnsToEQualsIndexPresent(SQLInterface si)
Checks if the EntityAssnsToEQuals multiAttributesKey column index is present.

Parameters:
si - the si
Returns:
if the multiAttributesKey column index is present

isEntryStateIdInAssociationTable

protected static boolean isEntryStateIdInAssociationTable(SQLInterface si)
Checks if the current Association Table contains the EntryStateId column.

Parameters:
si - the si
Returns:
if the EntryStateId column is present.

parseFloatFromTableVersion

protected static float parseFloatFromTableVersion(SQLInterface si)
Returns the float representation of the current table version.

Parameters:
si - the si
Returns:
the current (float) table version.

createUniqueKeyForSource

protected static java.lang.String createUniqueKeyForSource(java.lang.String value,
                                                           java.lang.String val1)
Generate a unique key for a Source object. We can't rely on the equals() method being implemented correctly on the Source object (because model objects can be generated with our without it depending on preferences), so we have to construct a unique id here. (This is to be used when putting Sources in Maps or Sets)

Parameters:
value - the value
val1 - the val1
Returns:
The id to uniquely identify this source within an Entity

setResourceManager

public void setResourceManager(ResourceManager resourceManager)
Sets the resource manager.

Parameters:
resourceManager - the new resource manager

getResourceManager

public ResourceManager getResourceManager()
Gets the resource manager.

Returns:
the resource manager

setLogger

public void setLogger(LgLoggerIF logger)
Sets the logger.

Parameters:
logger - the new logger

getLogger

public LgLoggerIF getLogger()
Gets the logger.

Returns:
the logger

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.