Package ca.uhn.fhir.jpa.search.lastn
Class ElasticsearchSvcImpl
java.lang.Object
ca.uhn.fhir.jpa.search.lastn.ElasticsearchSvcImpl
- All Implemented Interfaces:
IElasticsearchSvc
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchSvcImpl(PartitionSettings thePartitionSetings, String theProtocol, String theHostname, String theUsername, String thePassword) ElasticsearchSvcImpl(String theProtocol, String theHostname, String theUsername, String thePassword) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Invoked when shutting down.createOrUpdateObservationCodeIndex(String theCodeableConceptID, CodeJson theObservationCodeDocument) Creates or updates index for an Observation Code.createOrUpdateObservationIndex(String theDocumentId, ObservationJson theObservationDocument) Creates or updates index for an Observation Resource.voiddeleteAllDocumentsForTest(String theIndexName) voiddeleteObservationDocument(String theDocumentId) Deletes index for an Observation Resource.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.executeLastNWithAllFieldsForTest(SearchParameterMap theSearchParameterMap, ca.uhn.fhir.context.FhirContext theFhirContext) 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.getObservationDocument(String theDocumentID) Returns index document for a single ObservationList<org.hl7.fhir.instance.model.api.IBaseResource>getObservationResources(Collection<? extends ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId> thePids) Returns inlined observation resource stored along with index mappings for matched identifiersvoidrefreshIndex(String theIndexName)
-
Field Details
-
OBSERVATION_INDEX
- See Also:
-
OBSERVATION_CODE_INDEX
- See Also:
-
OBSERVATION_DOCUMENT_TYPE
- See Also:
-
CODE_DOCUMENT_TYPE
- See Also:
-
OBSERVATION_INDEX_SCHEMA_FILE
- See Also:
-
OBSERVATION_CODE_INDEX_SCHEMA_FILE
- See Also:
-
-
Constructor Details
-
ElasticsearchSvcImpl
public ElasticsearchSvcImpl(PartitionSettings thePartitionSetings, String theProtocol, String theHostname, @Nullable String theUsername, @Nullable String thePassword) -
ElasticsearchSvcImpl
public ElasticsearchSvcImpl(String theProtocol, String theHostname, @Nullable String theUsername, @Nullable String thePassword)
-
-
Method Details
-
executeLastN
public List<String> executeLastN(SearchParameterMap theSearchParameterMap, ca.uhn.fhir.context.FhirContext theFhirContext, Integer theMaxResultsToFetch) Description copied from interface:IElasticsearchSvcReturns identifiers for the last most recent N observations that meet the specified criteria.- Specified by:
executeLastNin 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
Description copied from interface:IElasticsearchSvcReturns index document for a single Observation- Specified by:
getObservationDocumentin interfaceIElasticsearchSvc- Parameters:
theDocumentID- Identifier of Observation resource.- Returns:
-
getObservationCodeDocument
Description copied from interface:IElasticsearchSvcReturns 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:
getObservationCodeDocumentin 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:IElasticsearchSvcCreates or updates index for an Observation Resource.- Specified by:
createOrUpdateObservationIndexin 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:IElasticsearchSvcCreates or updates index for an Observation Code.- Specified by:
createOrUpdateObservationCodeIndexin interfaceIElasticsearchSvc- Parameters:
theCodeableConceptID- Identifier for Observation resource.theObservationCodeDocument- Indexing document for Observation.- Returns:
- True if Observation Code indexed successfully.
-
close
Description copied from interface:IElasticsearchSvcInvoked when shutting down.- Specified by:
closein interfaceIElasticsearchSvc- Throws:
IOException
-
getObservationResources
public List<org.hl7.fhir.instance.model.api.IBaseResource> getObservationResources(Collection<? extends ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId> thePids) Description copied from interface:IElasticsearchSvcReturns inlined observation resource stored along with index mappings for matched identifiers- Specified by:
getObservationResourcesin interfaceIElasticsearchSvc- Returns:
- Resources list or empty if nothing found
-
deleteObservationDocument
Description copied from interface:IElasticsearchSvcDeletes index for an Observation Resource.- Specified by:
deleteObservationDocumentin interfaceIElasticsearchSvc- Parameters:
theDocumentId- Identifier for Observation resource.
-
deleteAllDocumentsForTest
- Throws:
IOException
-
refreshIndex
- Throws:
IOException
-