
Package ca.uhn.fhir.jpa.search.lastn
Class ElasticsearchSvcImpl
- java.lang.Object
-
- ca.uhn.fhir.jpa.search.lastn.ElasticsearchSvcImpl
-
- All Implemented Interfaces:
IElasticsearchSvc
public class ElasticsearchSvcImpl extends Object implements IElasticsearchSvc
-
-
Field Summary
Fields Modifier and Type Field Description static String
CODE_DOCUMENT_TYPE
static String
OBSERVATION_CODE_INDEX
static String
OBSERVATION_CODE_INDEX_SCHEMA_FILE
static String
OBSERVATION_DOCUMENT_TYPE
static String
OBSERVATION_INDEX
static String
OBSERVATION_INDEX_SCHEMA_FILE
-
Constructor Summary
Constructors Constructor Description ElasticsearchSvcImpl(PartitionSettings thePartitionSetings, String theHostname, int thePort, String theUsername, String thePassword)
ElasticsearchSvcImpl(String theHostname, int thePort, String theUsername, String thePassword)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Invoked when shutting down.Boolean
createOrUpdateObservationCodeIndex(String theCodeableConceptID, CodeJson theObservationCodeDocument)
Creates or updates index for an Observation Code.Boolean
createOrUpdateObservationIndex(String theDocumentId, ObservationJson theObservationDocument)
Creates or updates index for an Observation Resource.void
deleteAllDocumentsForTest(String theIndexName)
void
deleteObservationDocument(String theDocumentId)
Deletes index for an Observation Resource.List<String>
executeLastN(SearchParameterMap theSearchParameterMap, ca.uhn.fhir.context.FhirContext theFhirContext, Integer theMaxResultsToFetch)
Returns identifiers for the last most recent N observations that meet the specified criteria.List<ObservationJson>
executeLastNWithAllFieldsForTest(SearchParameterMap theSearchParameterMap, ca.uhn.fhir.context.FhirContext theFhirContext)
CodeJson
getObservationCodeDocument(String theCodeSystemHash, String theText)
Returns index document for a single Observation Code that either has a coding that matches a specified Code value and system or that has a specified text value.ObservationJson
getObservationDocument(String theDocumentID)
Returns index document for a single Observationvoid
refreshIndex(String theIndexName)
-
-
-
Field Detail
-
OBSERVATION_INDEX
public static final String OBSERVATION_INDEX
- See Also:
- Constant Field Values
-
OBSERVATION_CODE_INDEX
public static final String OBSERVATION_CODE_INDEX
- See Also:
- Constant Field Values
-
OBSERVATION_DOCUMENT_TYPE
public static final String OBSERVATION_DOCUMENT_TYPE
- See Also:
- Constant Field Values
-
CODE_DOCUMENT_TYPE
public static final String CODE_DOCUMENT_TYPE
- See Also:
- Constant Field Values
-
OBSERVATION_INDEX_SCHEMA_FILE
public static final String OBSERVATION_INDEX_SCHEMA_FILE
- See Also:
- Constant Field Values
-
OBSERVATION_CODE_INDEX_SCHEMA_FILE
public static final String OBSERVATION_CODE_INDEX_SCHEMA_FILE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ElasticsearchSvcImpl
public ElasticsearchSvcImpl(PartitionSettings thePartitionSetings, String theHostname, int thePort, String theUsername, String thePassword)
-
ElasticsearchSvcImpl
public ElasticsearchSvcImpl(String theHostname, int thePort, String theUsername, String thePassword)
-
-
Method Detail
-
executeLastN
public List<String> executeLastN(SearchParameterMap theSearchParameterMap, ca.uhn.fhir.context.FhirContext theFhirContext, Integer theMaxResultsToFetch)
Description copied from interface:IElasticsearchSvc
Returns identifiers for the last most recent N observations that meet the specified criteria.- Specified by:
executeLastN
in interfaceIElasticsearchSvc
- Parameters:
theSearchParameterMap
- SearchParameterMap containing search parameters used for filtering the last N observations. Supported parameters include Subject, Patient, Code, Category and Max (the parameter used to determine N).theFhirContext
- Current FhirContext.theMaxResultsToFetch
- The maximum number of results to return for the purpose of paging.- Returns:
-
executeLastNWithAllFieldsForTest
public List<ObservationJson> executeLastNWithAllFieldsForTest(SearchParameterMap theSearchParameterMap, ca.uhn.fhir.context.FhirContext theFhirContext)
-
getObservationDocument
public ObservationJson getObservationDocument(String theDocumentID)
Description copied from interface:IElasticsearchSvc
Returns index document for a single Observation- Specified by:
getObservationDocument
in interfaceIElasticsearchSvc
- Parameters:
theDocumentID
- Identifier of Observation resource.- Returns:
-
getObservationCodeDocument
public CodeJson getObservationCodeDocument(String theCodeSystemHash, String theText)
Description copied from interface:IElasticsearchSvc
Returns index document for a single Observation Code that either has a coding that matches a specified Code value and system or that has a specified text value.- Specified by:
getObservationCodeDocument
in interfaceIElasticsearchSvc
- Parameters:
theCodeSystemHash
- A hash string constructed from a Code value and Code system used to match to an Observation Code.theText
- A text value used to match to an Observation Code.- Returns:
-
createOrUpdateObservationIndex
public Boolean createOrUpdateObservationIndex(String theDocumentId, ObservationJson theObservationDocument)
Description copied from interface:IElasticsearchSvc
Creates or updates index for an Observation Resource.- Specified by:
createOrUpdateObservationIndex
in interfaceIElasticsearchSvc
- Parameters:
theDocumentId
- Identifier for Observation resource.theObservationDocument
- Indexing document for Observation.- Returns:
- True if Observation indexed successfully.
-
createOrUpdateObservationCodeIndex
public Boolean createOrUpdateObservationCodeIndex(String theCodeableConceptID, CodeJson theObservationCodeDocument)
Description copied from interface:IElasticsearchSvc
Creates or updates index for an Observation Code.- Specified by:
createOrUpdateObservationCodeIndex
in interfaceIElasticsearchSvc
- Parameters:
theCodeableConceptID
- Identifier for Observation resource.theObservationCodeDocument
- Indexing document for Observation.- Returns:
- True if Observation Code indexed successfully.
-
close
public void close() throws IOException
Description copied from interface:IElasticsearchSvc
Invoked when shutting down.- Specified by:
close
in interfaceIElasticsearchSvc
- Throws:
IOException
-
deleteObservationDocument
public void deleteObservationDocument(String theDocumentId)
Description copied from interface:IElasticsearchSvc
Deletes index for an Observation Resource.- Specified by:
deleteObservationDocument
in interfaceIElasticsearchSvc
- Parameters:
theDocumentId
- Identifier for Observation resource.
-
deleteAllDocumentsForTest
public void deleteAllDocumentsForTest(String theIndexName) throws IOException
- Throws:
IOException
-
refreshIndex
public void refreshIndex(String theIndexName) throws IOException
- Throws:
IOException
-
-