ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seanfi...@apache.org
Subject svn commit: r1823864 - in /ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core: patient/PatientNoteStore.java util/SourceMetadataUtil.java
Date Sun, 11 Feb 2018 17:43:57 GMT
Author: seanfinan
Date: Sun Feb 11 17:43:57 2018
New Revision: 1823864

URL: http://svn.apache.org/viewvc?rev=1823864&view=rev
Log:
proper patient store registration

Modified:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/patient/PatientNoteStore.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/SourceMetadataUtil.java

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=1823864&r1=1823863&r2=1823864&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
Sun Feb 11 17:43:57 2018
@@ -34,6 +34,8 @@ public enum PatientNoteStore {
 
    static private final Logger LOGGER = Logger.getLogger( "PatientNoteStore" );
 
+   static private final String GENERIC_PATIENT = "Generic";
+
    private final Collection<String> _registeredEngines;
    private final Map<String, Collection<String>> _enginesRun;
    private final Map<String, JCas> _patientMap;
@@ -145,7 +147,7 @@ public enum PatientNoteStore {
       if ( patientIdentifier != null && !patientIdentifier.isEmpty() && !patientIdentifier.equals(
SourceMetadataUtil.UNKNOWN_PATIENT ) ) {
          return patientIdentifier;
       }
-      return DocumentIDAnnotationUtil.getDocumentIdPrefix( viewCas );
+      return GENERIC_PATIENT;
    }
 
    /**

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/SourceMetadataUtil.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/SourceMetadataUtil.java?rev=1823864&r1=1823863&r2=1823864&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/SourceMetadataUtil.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/util/SourceMetadataUtil.java
Sun Feb 11 17:43:57 2018
@@ -34,10 +34,17 @@ final public class SourceMetadataUtil {
     */
    static public String getPatientIdentifier( final JCas jcas ) {
       final Metadata metadata = getMetadata( jcas );
-      if ( metadata == null ) {
-         return UNKNOWN_PATIENT;
+      if ( metadata != null ) {
+         final String patientId = metadata.getPatientIdentifier();
+         if ( patientId != null && !patientId.isEmpty() ) {
+            return patientId;
+         }
       }
-      return metadata.getPatientIdentifier();
+      final String docPrefix = DocumentIDAnnotationUtil.getDocumentIdPrefix( jcas );
+      if ( docPrefix != null && !docPrefix.isEmpty() ) {
+         return docPrefix;
+      }
+      return UNKNOWN_PATIENT;
    }
 
    /**



Mime
View raw message