ca.uhn.hl7v2
Class DBTableRepository

java.lang.Object
  extended by ca.uhn.hl7v2.TableRepository
      extended by ca.uhn.hl7v2.DBTableRepository

public class DBTableRepository
extends TableRepository

Implements TableRepository by looking up values from the default HL7 normative database. Values are cached after they are looked up once.

Author:
Bryan Tripp (bryan_tripp@sourceforge.net)

Constructor Summary
protected DBTableRepository()
           
 
Method Summary
 boolean checkValue(int table, java.lang.String value)
          Returns true if the given value exists in the given table.
 java.lang.String getDescription(int table, java.lang.String value)
          Returns the description matching the table and value given.
 int[] getTables()
          Returns a list of HL7 lookup tables that are defined in the normative database.
 java.lang.String[] getValues(int table)
          Returns a list of the values for the given table in the normative database.
 
Methods inherited from class ca.uhn.hl7v2.TableRepository
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBTableRepository

protected DBTableRepository()
Method Detail

getTables

public int[] getTables()
                throws LookupException
Returns a list of HL7 lookup tables that are defined in the normative database.

Specified by:
getTables in class TableRepository
Throws:
LookupException

checkValue

public boolean checkValue(int table,
                          java.lang.String value)
                   throws UndefinedTableException,
                          LookupException
Returns true if the given value exists in the given table.

Specified by:
checkValue in class TableRepository
Throws:
UndefinedTableException
LookupException

getValues

public java.lang.String[] getValues(int table)
                             throws LookupException,
                                    UndefinedTableException
Returns a list of the values for the given table in the normative database.

Specified by:
getValues in class TableRepository
Throws:
LookupException
UndefinedTableException

getDescription

public java.lang.String getDescription(int table,
                                       java.lang.String value)
                                throws LookupException,
                                       UnknownValueException
Returns the description matching the table and value given. As currently implemented this method performs a database call each time - caching should probably be added, although this method will probably not be used very often.

Specified by:
getDescription in class TableRepository
Throws:
UnknownValueException - if the value can not be found. This may be an UnknownTableException.
LookupException