ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seanfi...@apache.org
Subject svn commit: r1855848 - /ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/I2b2JdbcWriter.java
Date Tue, 19 Mar 2019 16:28:43 GMT
Author: seanfinan
Date: Tue Mar 19 16:28:42 2019
New Revision: 1855848

URL: http://svn.apache.org/viewvc?rev=1855848&view=rev
Log:
Add PipeBitInfo and Logging to I2b2JdbcWriter

Modified:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/I2b2JdbcWriter.java

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/I2b2JdbcWriter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/I2b2JdbcWriter.java?rev=1855848&r1=1855847&r2=1855848&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/I2b2JdbcWriter.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/I2b2JdbcWriter.java
Tue Mar 19 16:28:42 2019
@@ -2,7 +2,11 @@ package org.apache.ctakes.core.cc.jdbc.i
 
 import org.apache.ctakes.core.cc.jdbc.AbstractJCasJdbcWriter;
 import org.apache.ctakes.core.cc.jdbc.db.JdbcDb;
+import org.apache.ctakes.core.pipeline.PipeBitInfo;
+import org.apache.log4j.Logger;
+import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
 import org.apache.uima.fit.descriptor.ConfigurationParameter;
+import org.apache.uima.jcas.JCas;
 import org.apache.uima.resource.ResourceInitializationException;
 
 import java.sql.SQLException;
@@ -13,8 +17,15 @@ import java.sql.SQLException;
  * @version %I%
  * @since 3/12/2019
  */
+@PipeBitInfo(
+      name = "I2b2JdbcWriter",
+      description = "Writes UMLS Concepts to a standard I2B2 Observation_Fact table.",
+      role = PipeBitInfo.Role.WRITER,
+      dependencies = PipeBitInfo.TypeProduct.IDENTIFIED_ANNOTATION
+)
 public class I2b2JdbcWriter extends AbstractJCasJdbcWriter {
 
+   static private final Logger LOGGER = Logger.getLogger( "I2b2JdbcWriter" );
 
    static public final String PARAM_TABLE_NAME = "FactOutputTable";
    @ConfigurationParameter(
@@ -23,12 +34,21 @@ public class I2b2JdbcWriter extends Abst
    )
    private String _tableName;
 
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public void process( final JCas jcas ) throws AnalysisEngineProcessException {
+      LOGGER.info( "Writing to Database ..." );
+      super.process( jcas );
+   }
 
    final protected JdbcDb createJdbcDb( final String driver,
                                         final String url,
                                         final String user,
                                         final String pass,
                                         final String keepAlive ) throws ResourceInitializationException
{
+      LOGGER.info( "Initializing connection to " + url + " ..." );
       final I2b2Db db = new I2b2Db( driver, url, user, pass, keepAlive );
       try {
          db.addObservationFact( _tableName );



Mime
View raw message