ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seanfi...@apache.org
Subject svn commit: r1815513 - in /ctakes/trunk: ctakes-core/src/main/java/org/apache/ctakes/core/cr/ ctakes-core/src/main/java/org/apache/ctakes/core/patient/ ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/
Date Thu, 16 Nov 2017 20:32:55 GMT
Author: seanfinan
Date: Thu Nov 16 20:32:55 2017
New Revision: 1815513

URL: http://svn.apache.org/viewvc?rev=1815513&view=rev
Log:
Followup checkin for patient view store

Modified:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FileTreeReader.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/AbstractPatientConsumer.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteCollector.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteStore.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FileTreeReader.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FileTreeReader.java?rev=1815513&r1=1815512&r2=1815513&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FileTreeReader.java (original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FileTreeReader.java Thu
Nov 16 20:32:55 2017
@@ -123,11 +123,11 @@ final public class FileTreeReader extend
          // does not check for valid extensions.  With one file just trust the user.
          _files = Collections.singletonList( _rootDir );
          final String patient = _rootDir.getParentFile().getName();
-         PatientNoteStore.getInstance().setDocCount( patient, 1 );
+         PatientNoteStore.getInstance().setWantedDocCount( patient, 1 );
       } else {
          // gather all of the files and set the document counts per patient.
          _files = getDescendentFiles( _rootDir, _validExtensions, 0 );
-         _patientDocCounts.forEach( ( k, v ) -> PatientNoteStore.getInstance().setDocCount(
k, v ) );
+         _patientDocCounts.forEach( ( k, v ) -> PatientNoteStore.getInstance().setWantedDocCount(
k, v ) );
       }
    }
 

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/AbstractPatientConsumer.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/AbstractPatientConsumer.java?rev=1815513&r1=1815512&r2=1815513&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/AbstractPatientConsumer.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/AbstractPatientConsumer.java
Thu Nov 16 20:32:55 2017
@@ -63,7 +63,7 @@ abstract public class AbstractPatientCon
    @Override
    public void collectionProcessComplete() throws AnalysisEngineProcessException {
       super.collectionProcessComplete();
-      final Collection<String> allPatientIds = PatientNoteStore.getInstance().getPatientIds();
+      final Collection<String> allPatientIds = PatientNoteStore.getInstance().getStoredPatientIds();
       for ( String id : allPatientIds ) {
          process( id );
          if ( _removePatient ) {
@@ -84,7 +84,7 @@ abstract public class AbstractPatientCon
       }
       _logger.info( _action + " for patient " + patientName + " ..." );
 
-      processPatientCas( PatientNoteStore.getInstance().getPatientCas( patientName ) );
+      processPatientCas( PatientNoteStore.getInstance().getFullPatientCas( patientName )
);
 
       _logger.info( "Finished." );
    }

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteCollector.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteCollector.java?rev=1815513&r1=1815512&r2=1815513&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteCollector.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteCollector.java
Thu Nov 16 20:32:55 2017
@@ -34,7 +34,7 @@ final public class PatientNoteCollector
       LOGGER.info( "Caching Document " + PatientNoteStore.getInstance().getDefaultDocumentId(
jCas )
             + " into Patient " + PatientNoteStore.getInstance().getDefaultPatientId( jCas
) + " ..." );
 
-      PatientNoteStore.getInstance().addDocument( jCas );
+      PatientNoteStore.getInstance().storeAllViews( jCas );
 
       LOGGER.info( "Finished." );
    }

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteStore.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteStore.java?rev=1815513&r1=1815512&r2=1815513&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteStore.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteStore.java
Thu Nov 16 20:32:55 2017
@@ -312,6 +312,13 @@ public enum PatientNoteStore {
    /////////////////    patient cleanup - careful !   ///////////////
 
    /**
+    * @param patientId -
+    */
+   synchronized public JCas getFullPatientCas( final String patientId ) {
+      return _patientMap.get( patientId );
+   }
+
+   /**
     * @param patientId identifier of patient to remove from cache
     */
    synchronized public void removePatient( final String patientId ) {

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java?rev=1815513&r1=1815512&r2=1815513&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
Thu Nov 16 20:32:55 2017
@@ -18,41 +18,9 @@
  */
 package org.apache.ctakes.temporal.eval;
 
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.commons.io.FileUtils;
+import com.google.common.collect.Lists;
+import com.google.common.io.CharStreams;
+import com.lexicalscope.jewel.cli.Option;
 import org.apache.ctakes.chunker.ae.Chunker;
 import org.apache.ctakes.chunker.ae.DefaultChunkCreator;
 import org.apache.ctakes.chunker.ae.adjuster.ChunkAdjuster;
@@ -65,7 +33,6 @@ import org.apache.ctakes.core.patient.Pa
 import org.apache.ctakes.core.pipeline.PipeBitInfo;
 import org.apache.ctakes.core.resource.FileLocator;
 import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
-import org.apache.ctakes.dependency.parser.ae.ClearNLPSemanticRoleLabelerAE;
 import org.apache.ctakes.dictionary.lookup2.ae.DefaultJCasTermAnnotator;
 import org.apache.ctakes.lvg.ae.LvgAnnotator;
 import org.apache.ctakes.postagger.POSTagger;
@@ -74,7 +41,6 @@ import org.apache.ctakes.temporal.ae.THY
 import org.apache.ctakes.temporal.ae.THYMEKnowtatorXMLReader;
 import org.apache.ctakes.temporal.ae.THYMETreebankReader;
 import org.apache.ctakes.temporal.duration.Utils;
-import org.apache.ctakes.temporal.utils.PatientViewsUtil;
 import org.apache.ctakes.typesystem.type.constants.CONST;
 import org.apache.ctakes.typesystem.type.relation.TemporalTextRelation;
 import org.apache.ctakes.typesystem.type.syntax.BaseToken;
@@ -126,10 +92,19 @@ import org.w3c.dom.Element;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 
-import com.google.common.collect.Lists;
-import com.google.common.io.CharStreams;
-import com.lexicalscope.jewel.cli.Option;
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.io.*;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 //import org.apache.ctakes.core.cleartk.ae.SentenceDetectorAnnotator;
 //import org.threeten.bp.temporal.TemporalUnit;
@@ -451,7 +426,7 @@ org.cleartk.eval.Evaluation_ImplBase<Int
 			}
 			docCounts.add(ptidPrefix);
 		}
-		docCounts.forEach((k,v) -> PatientNoteStore.getInstance().setDocCount(k, v));
+		docCounts.forEach( ( k, v ) -> PatientNoteStore.getInstance().setWantedDocCount( k,
v ) );
 
 		return UriCollectionReader.getCollectionReaderFromFiles( collectedFiles );
 	}



Mime
View raw message