ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seanfi...@apache.org
Subject svn commit: r1863323 - in /ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc: db/DefaultJdbcDb.java i2b2/I2b2Db.java i2b2/I2b2JdbcWriter.java i2b2/ObservationFactRow.java i2b2/ObservationFactTable.java row/EmptyInitializer.java
Date Thu, 18 Jul 2019 16:03:43 GMT
Author: seanfinan
Date: Thu Jul 18 16:03:42 2019
New Revision: 1863323

URL: http://svn.apache.org/viewvc?rev=1863323&view=rev
Log:
DefaultJdbcDb Simple implementation of AbstractJdbcDb.
i2b2 package with simple default writer for i2b2 observation_fact tables.
EmptyInitializer can be passed as Corpus Initializer that does nothing.

Added:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/db/DefaultJdbcDb.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/row/EmptyInitializer.java
Modified:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/I2b2Db.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/I2b2JdbcWriter.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/ObservationFactRow.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/ObservationFactTable.java

Added: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/db/DefaultJdbcDb.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/db/DefaultJdbcDb.java?rev=1863323&view=auto
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/db/DefaultJdbcDb.java
(added)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/db/DefaultJdbcDb.java
Thu Jul 18 16:03:42 2019
@@ -0,0 +1,21 @@
+package org.apache.ctakes.core.cc.jdbc.db;
+
+
+import org.apache.uima.resource.ResourceInitializationException;
+
+/**
+ * @author SPF , chip-nlp
+ * @version %I%
+ * @since 7/18/2019
+ */
+final public class DefaultJdbcDb extends AbstractJdbcDb {
+
+   public DefaultJdbcDb( final String driver,
+                         final String url,
+                         final String user,
+                         final String pass,
+                         final String keepAlive ) throws ResourceInitializationException
{
+      super( driver, url, user, pass, keepAlive );
+   }
+
+}

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/I2b2Db.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/I2b2Db.java?rev=1863323&r1=1863322&r2=1863323&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/I2b2Db.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/I2b2Db.java
Thu Jul 18 16:03:42 2019
@@ -31,19 +31,18 @@ public class I2b2Db extends AbstractJdbc
     * @return observation fact table with only negation marked by a negative (-) sign before
concept codes.
     * @throws SQLException -
     */
-   protected ObservationFactTable addObservationFact( final String tableName, final boolean
repeatCuis )
+   public ObservationFactTable addObservationFact( final String tableName, final boolean
repeatCuis )
          throws SQLException {
-      final CorpusSettings settings = new CorpusSettings( CorpusSettings.Marker.MARK_NEGATED
);
+      final ObservationFactTable.CorpusSettings settings
+            = new ObservationFactTable.CorpusSettings( ObservationFactTable.CorpusSettings.Marker.MARK_NEGATED
);
       return addObservationFact( tableName, repeatCuis, settings );
    }
 
    /**
-    * @param tableName      name of the output observation fact table.
-    * @param corpusSettings settings for marking negation, uncertainty and generics.
-    * @return observation fact table.
-    * @throws SQLException -
+    * {@inheritDoc}
     */
-   protected ObservationFactTable addObservationFact( final String tableName,
+//   @Override
+   public ObservationFactTable addObservationFact( final String tableName,
                                                       final boolean repeatCuis,
                                                       final CorpusSettings corpusSettings
) throws SQLException {
       final ObservationFactTable table

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=1863323&r1=1863322&r2=1863323&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
Thu Jul 18 16:03:42 2019
@@ -51,7 +51,15 @@ public class I2b2JdbcWriter extends Abst
       super.process( jcas );
    }
 
-   final protected JdbcDb createJdbcDb( final String driver,
+   final protected String getTableName() {
+      return _tableName;
+   }
+
+   final protected boolean isRepeatCuis() {
+      return _repeatCuis;
+   }
+
+   protected JdbcDb createJdbcDb( final String driver,
                                         final String url,
                                         final String user,
                                         final String pass,
@@ -59,7 +67,7 @@ public class I2b2JdbcWriter extends Abst
       LOGGER.info( "Initializing connection to " + url + " ..." );
       final I2b2Db db = new I2b2Db( driver, url, user, pass, keepAlive );
       try {
-         db.addObservationFact( _tableName, _repeatCuis );
+         db.addObservationFact( getTableName(), isRepeatCuis() );
       } catch ( SQLException sqlE ) {
          throw new ResourceInitializationException( sqlE );
       }

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/ObservationFactRow.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/ObservationFactRow.java?rev=1863323&r1=1863322&r2=1863323&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/ObservationFactRow.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/ObservationFactRow.java
Thu Jul 18 16:03:42 2019
@@ -28,7 +28,7 @@ import static org.apache.ctakes.core.cc.
  * @version %I%
  * @since 3/14/2019
  */
-final public class ObservationFactRow
+public class ObservationFactRow
       implements JdbcRow<CorpusSettings, JCas, JCas, IdentifiedAnnotation, UmlsConcept>
{
 
    static private final Logger LOGGER = Logger.getLogger( "ObservationFactRow" );
@@ -177,7 +177,7 @@ final public class ObservationFactRow
    /**
     * Set document information as empty.
     */
-   private void setEmptyDocInfo() {
+   protected void setEmptyDocInfo() {
       _encounter = -1;
       _provider = "";
       _start = Timestamp.valueOf( LocalDateTime.now() );
@@ -199,7 +199,7 @@ final public class ObservationFactRow
       return concept.getPreferredText();
    }
 
-   private String getObservationBlob( final UmlsConcept concept ) {
+   protected String getObservationBlob( final UmlsConcept concept ) {
       return "";
    }
 

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/ObservationFactTable.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/ObservationFactTable.java?rev=1863323&r1=1863322&r2=1863323&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/ObservationFactTable.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/i2b2/ObservationFactTable.java
Thu Jul 18 16:03:42 2019
@@ -23,7 +23,7 @@ import static org.apache.ctakes.core.cc.
  * @version %I%
  * @since 3/12/2019
  */
-final public class ObservationFactTable extends AbstractUmlsTable<CorpusSettings> {
+public class ObservationFactTable extends AbstractUmlsTable<CorpusSettings> {
 
 
    private final CorpusSettings _corpusSettings;

Added: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/row/EmptyInitializer.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/row/EmptyInitializer.java?rev=1863323&view=auto
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/row/EmptyInitializer.java
(added)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/row/EmptyInitializer.java
Thu Jul 18 16:03:42 2019
@@ -0,0 +1,17 @@
+package org.apache.ctakes.core.cc.jdbc.row;
+
+
+import org.apache.log4j.Logger;
+
+/**
+ * Does nothing.  Can be passed to JdbcRow to do nothing for patient, document initialization.
+ *
+ * @author SPF , chip-nlp
+ * @version %I%
+ * @since 7/18/2019
+ */
+final public class EmptyInitializer {
+
+   static private final Logger LOGGER = Logger.getLogger( "EmptyInitializer" );
+
+}



Mime
View raw message