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 TypeMethodDescriptionvoid
close()
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.void
deleteAllDocumentsForTest
(String theIndexName) void
deleteObservationDocument
(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<ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId> thePids) Returns inlined observation resource stored along with index mappings for matched identifiersvoid
refreshIndex
(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
-
-
Method Details
-
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
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
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
Description copied from interface:IElasticsearchSvc
Invoked when shutting down.- Specified by:
close
in interfaceIElasticsearchSvc
- Throws:
IOException
-
getObservationResources
public List<org.hl7.fhir.instance.model.api.IBaseResource> getObservationResources(Collection<ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId> thePids) Description copied from interface:IElasticsearchSvc
Returns inlined observation resource stored along with index mappings for matched identifiers- Specified by:
getObservationResources
in interfaceIElasticsearchSvc
- Returns:
- Resources list or empty if nothing found
-
deleteObservationDocument
Description copied from interface:IElasticsearchSvc
Deletes index for an Observation Resource.- Specified by:
deleteObservationDocument
in interfaceIElasticsearchSvc
- Parameters:
theDocumentId
- Identifier for Observation resource.
-
deleteAllDocumentsForTest
- Throws:
IOException
-
refreshIndex
- Throws:
IOException
-