public class JdbcWriterTemplate extends AbstractJdbcWriter
Modifier and Type | Class and Description |
---|---|
private static class |
JdbcWriterTemplate.I2b2Concept
A more useful representation of umls concept for our purposes - we don't want repeat cuis for multiple tuis
|
static class |
JdbcWriterTemplate.I2b2FieldInfo |
AbstractJdbcWriter.FieldInfo, AbstractJdbcWriter.TableInfo, AbstractJdbcWriter.TableSqlInfo
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
_tableName |
private static Logger |
LOGGER |
static java.lang.String |
PARAM_VECTOR_TABLE |
private static java.lang.String |
SPAN_END_LABEL |
private static java.lang.String |
SPAN_START_LABEL |
_tableSqlInfoMap, PARAM_DB_CONN_RESRC
Constructor and Description |
---|
JdbcWriterTemplate() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
createBlob(IdentifiedAnnotation annotation) |
private static java.util.Collection<JdbcWriterTemplate.I2b2Concept> |
createI2b2Concepts(java.lang.Iterable<UmlsConcept> umlsConcepts)
I2b2 only cares about Cui & preferred text.
|
protected java.util.Collection<AbstractJdbcWriter.TableInfo> |
getTableInfos()
Called from initialize()
|
void |
initialize() |
private void |
saveAnnotations(java.util.Map<JdbcWriterTemplate.I2b2FieldInfo,java.lang.Object> fieldInfoValues,
java.lang.String cui,
java.lang.String preferredText,
java.lang.Iterable<IdentifiedAnnotation> annotations,
boolean saveAffirmed) |
private void |
saveEntities(JCas jcas,
int encounterNum,
long patientNum,
java.lang.String providerId,
java.sql.Timestamp startDate) |
private void |
saveI2b2Concept(java.util.Map<JdbcWriterTemplate.I2b2FieldInfo,java.lang.Object> fieldInfoValues,
JdbcWriterTemplate.I2b2Concept i2b2Concept,
java.lang.Iterable<IdentifiedAnnotation> annotations) |
protected void |
writeJCasInformation(JCas jcas,
int encounterNum,
long patientNum,
java.lang.String providerId,
java.sql.Timestamp startDate)
The main "process" method, called from processCas
|
collectionProcessComplete, createRowInsertSql, getTableSqlInfoMap, processCas, setFieldInfoValue, writeTableRow
private static final Logger LOGGER
public static final java.lang.String PARAM_VECTOR_TABLE
private static final java.lang.String SPAN_START_LABEL
private static final java.lang.String SPAN_END_LABEL
private java.lang.String _tableName
public void initialize() throws ResourceInitializationException
initialize
in class AbstractJdbcWriter
ResourceInitializationException
protected java.util.Collection<AbstractJdbcWriter.TableInfo> getTableInfos()
getTableInfos
in class AbstractJdbcWriter
protected void writeJCasInformation(JCas jcas, int encounterNum, long patientNum, java.lang.String providerId, java.sql.Timestamp startDate) throws java.sql.SQLException
writeJCasInformation
in class AbstractJdbcWriter
jcas
- -encounterNum
- -patientNum
- -providerId
- -startDate
- -java.sql.SQLException
- if implementations throw SQLExceptionprivate void saveEntities(JCas jcas, int encounterNum, long patientNum, java.lang.String providerId, java.sql.Timestamp startDate) throws java.sql.SQLException
java.sql.SQLException
private void saveI2b2Concept(java.util.Map<JdbcWriterTemplate.I2b2FieldInfo,java.lang.Object> fieldInfoValues, JdbcWriterTemplate.I2b2Concept i2b2Concept, java.lang.Iterable<IdentifiedAnnotation> annotations) throws java.sql.SQLException
java.sql.SQLException
private void saveAnnotations(java.util.Map<JdbcWriterTemplate.I2b2FieldInfo,java.lang.Object> fieldInfoValues, java.lang.String cui, java.lang.String preferredText, java.lang.Iterable<IdentifiedAnnotation> annotations, boolean saveAffirmed) throws java.sql.SQLException
java.sql.SQLException
private static java.lang.String createBlob(IdentifiedAnnotation annotation)
annotation
- -private static java.util.Collection<JdbcWriterTemplate.I2b2Concept> createI2b2Concepts(java.lang.Iterable<UmlsConcept> umlsConcepts)
umlsConcepts
- -