PatientNoteStore - apache/ctakes GitHub Wiki

public enum PatientNoteStore

Cache for multi-document patient cas objects

  • Author: SPF , chip-nlp
  • Version: %I%
  • Since: 9/26/2017

PatientNoteStore()

private

synchronized public void registerEngine( final String engineName )

  • Parameters:
    • engineName name of engine that consumes patients

synchronized public void registerEngine( final NamedEngine namedEngine )

  • Parameters:
    • namedEngine engine that consumes patients

@Deprecated synchronized public Collection<String> getStoredPatientIds()

  • Deprecated
  • Returns: identifiers for all stored patients

synchronized public Collection<String> getStoredDocIds( final String patientId )

  • Parameters:
    • patientId -
  • Returns: identifiers for all stored documents for the given patient

synchronized public Collection<String> getStoredViewNames( final String patientId, final String docId )

  • Parameters:
    • patientId -
    • docId -
  • Returns: names for all stored views for the given patient and document

synchronized public Collection<String> getCompletedPatientIds()

  • Returns: all completed patient identifiers in the cache

synchronized public int getStoredDocCount( final String patientId )

  • Parameters:
    • patientId -
  • Returns: number of documents for the patient that have been completed and stored in the cache

synchronized public int getWantedDocCount( final String patientId )

  • Parameters:
    • patientId -
  • Returns: number of documents that exist for the patient or -1 if unknown

synchronized public void setWantedDocCount( final String patientId, final int count )

  • Parameters:
    • patientId -
    • count number of documents that exist for the patient

static public String getDefaultPatientId( final JCas viewCas )

  • Returns: the default identifier for a view of the document's patient.

    If it has been set in the document metadata then that is used,

    otherwise it will come from the document's parent directory.

  • See also:

    • SourceMetadataUtil#getPatientIdentifier(JCas)
    • DocIdUtil#getDocumentIdPrefix(JCas)

static public String getDefaultDocumentId( final JCas viewCas )

  • Returns: the default identifier for a view of the document.
  • See also: DocIdUtil#getDocumentID(JCas)

synchronized public void storeAllViews( final JCas sourceCas )

Store all views in the source cas. Patient Id and Document Id will be determined from the source cas.

  • Parameters:
    • sourceCas source (document) cas

synchronized public void storeAllViews( final String patientId, final String docId, final JCas sourceCas )

Store all views in the source cas.

  • Parameters:
    • patientId -
    • docId -
    • sourceCas source (document) cas

synchronized public void storePrimaryAsView( final String storeViewName, final JCas sourceCas )

Store the primary view under some different name. Patient Id and Document Id will be determined from the source cas.

  • Parameters:
    • storeViewName the name to use to store the primary view
    • sourceCas source (document) cas

synchronized public void storePrimaryAsView( final String patientId, final String docId, final String storeViewName, final JCas sourceCas )

Store the primary view under some different name.

  • Parameters:
    • patientId -
    • docId -
    • storeViewName the name to use to store the primary view
    • sourceCas source (document) cas

synchronized public void storeView( final String sourceViewName, final JCas sourceCas )

Store some single view with its own name. Patient Id and Document Id will be determined from the source cas.

  • Parameters:
    • sourceViewName the name of the view in the source cas
    • sourceCas source (document) cas

synchronized public void storeView( final String patientId, final String docId, final String sourceViewName, final JCas sourceCas )

Explicitly store some single view with its own name.

  • Parameters:
    • patientId -
    • docId -
    • sourceViewName the name of the view in the source cas
    • sourceCas source (document) cas

synchronized public void storeView( final String patientId, final String docId, final String storeViewName, final String sourceViewName, final JCas sourceCas )

Explicitly store some single view under a different name.

  • Parameters:
    • patientId -
    • docId -
    • storeViewName the name to use to store the view
    • sourceViewName the name of the view in the source cas
    • sourceCas source (document) cas

static private void setPatientId( final JCas jCas, final String patientId )

Make sure the patient cas contains its patient id

  • Parameters:
    • jCas -
    • patientId -

synchronized public JCas getStoredView( final String patientId, final String docId, final String viewName )

  • Parameters:
    • patientId -
    • docId -
    • viewName -
  • Returns: Stored view for the parameters

synchronized public Map<String, JCas> getStoredViews( final String patientId, final String docId )

  • Parameters:
    • patientId -
    • docId -
  • Returns: Map of ViewNames to Views

synchronized public Map<String, Map<String, JCas>> getStoredViews( final String patientId )

  • Parameters:
    • patientId -
  • Returns: Map of docIds to Map of ViewNames to Views

static public String getInternalViewname( final String patientId, final String docId, final String viewName )

  • Parameters:
    • patientId - Stored patient ID
    • docId - Stored document ID
    • viewName - View name in original document CAS
  • Returns: String representing view name in patient CAS

synchronized public JCas getFullPatientCas( final String patientId )

Use popPatientCas instead to automate cleanup

  • Parameters:
    • patientId -

synchronized public JCas popPatientCas( final String engineName )

  • Parameters:
    • engineName engine requesting a completed patient jcas
  • Returns: a patient jcas or null if none is available for the given engine

synchronized public Collection<JCas> popPatientCases( final String engineName )

  • Parameters:
    • engineName engine requesting a completed patient jcas
  • Returns: a patient jcas or null if none is available for the given engine

synchronized public JCas popPatientCas( final String patientId, final String engineName )

  • Parameters:
    • patientId -
    • engineName engine requesting a completed patient jcas
  • Returns: the patient jcas for the patient id or null if it isn't available for the given engine

synchronized public void removePatient( final String patientId )

  • Parameters:
    • patientId identifier of patient to remove from cache

synchronized private Collection<ViewInfo> getViewInfos( final String patientId )

  • Parameters:
    • patientId -
  • Returns: all encoded

@Immutable static private final class ViewInfo

Used to map pid, docId, view names to views for each patient.

⚠️ **GitHub.com Fallback** ⚠️