From 956cfb171dd8562d60ac49623e05338420d32264 Mon Sep 17 00:00:00 2001 From: chgl Date: Mon, 22 Aug 2022 18:15:34 +0200 Subject: [PATCH 1/2] Updated Otel Java agent to 1.17.0 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1eb0a2b..af067eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM maven:3.8-openjdk-17-slim as build-hapi WORKDIR /tmp/hapi-fhir-jpaserver-starter -ARG OPENTELEMETRY_JAVA_AGENT_VERSION=1.16.0 +ARG OPENTELEMETRY_JAVA_AGENT_VERSION=1.17.0 RUN curl -LSsO https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${OPENTELEMETRY_JAVA_AGENT_VERSION}/opentelemetry-javaagent.jar COPY pom.xml . From d059954c5f40d59bc0553539e678fdc892526ddb Mon Sep 17 00:00:00 2001 From: chgl Date: Mon, 22 Aug 2022 18:16:24 +0200 Subject: [PATCH 2/2] Updated hapi-fhir to 6.1.0 --- README.md | 4 ++-- pom.xml | 4 +--- .../jpa/starter/BaseJpaRestfulServer.java | 2 +- .../fhir/jpa/starter/EnvironmentHelper.java | 7 ++++--- .../jpa/starter/FhirServerConfigCommon.java | 2 +- .../fhir/jpa/starter/StarterJpaConfig.java | 19 +++++++++++++++++++ src/main/resources/application.yaml | 2 +- 7 files changed, 29 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index da7d46e..c104d23 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ In order to use this sample, you should have: - Apache Maven build tool (newest version) ### or - - Docker, as the entire project can be built using multistage docker (with both JDK and maven wrapped in docker) or used directly from [Docker Hub](https://hub.docker.com/repository/docker/hapiproject/hapi) + - Docker, as the entire project can be built using multistage docker (with both JDK and maven wrapped in docker) or used directly from [Docker Hub](https://hub.docker.com/r/hapiproject/hapi) -## Running via [Docker Hub](https://hub.docker.com/repository/docker/hapiproject/hapi) +## Running via [Docker Hub](https://hub.docker.com/r/hapiproject/hapi) Each tagged/released version of `hapi-fhir-jpaserver` is built as a Docker image and published to Docker hub. To run the published Docker image from DockerHub: diff --git a/pom.xml b/pom.xml index 6bf149e..3b2596f 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.0.1 + 6.1.0 hapi-fhir-jpaserver-starter @@ -196,8 +196,6 @@ com.h2database h2 - - 2.1.212 diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/BaseJpaRestfulServer.java b/src/main/java/ca/uhn/fhir/jpa/starter/BaseJpaRestfulServer.java index 5a45702..4cad6bf 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/BaseJpaRestfulServer.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/BaseJpaRestfulServer.java @@ -418,7 +418,7 @@ public class BaseJpaRestfulServer extends RestfulServer { daoConfig.setLastNEnabled(true); } - daoConfig.setStoreResourceInLuceneIndex(appProperties.getStore_resource_in_lucene_index_enabled()); + daoConfig.setStoreResourceInHSearchIndex(appProperties.getStore_resource_in_lucene_index_enabled()); daoConfig.getModelConfig().setNormalizedQuantitySearchLevel(appProperties.getNormalized_quantity_search_level()); daoConfig.getModelConfig().setIndexOnContainedResources(appProperties.getEnable_index_contained_resource()); } diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/EnvironmentHelper.java b/src/main/java/ca/uhn/fhir/jpa/starter/EnvironmentHelper.java index 11b6128..732705a 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/EnvironmentHelper.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/EnvironmentHelper.java @@ -1,7 +1,7 @@ package ca.uhn.fhir.jpa.starter; import ca.uhn.fhir.jpa.config.HapiFhirLocalContainerEntityManagerFactoryBean; -import ca.uhn.fhir.jpa.search.HapiLuceneAnalysisConfigurer; +import ca.uhn.fhir.jpa.search.HapiHSearchAnalysisConfigurers; import ca.uhn.fhir.jpa.search.elastic.ElasticsearchHibernatePropertiesBuilder; import org.apache.lucene.util.Version; import org.hibernate.cfg.AvailableSettings; @@ -71,7 +71,8 @@ public class EnvironmentHelper { if (properties.get(BackendSettings.backendKey(BackendSettings.TYPE)).equals(LuceneBackendSettings.TYPE_NAME)) { properties.putIfAbsent(BackendSettings.backendKey(LuceneIndexSettings.DIRECTORY_TYPE), LocalFileSystemDirectoryProvider.NAME); properties.putIfAbsent(BackendSettings.backendKey(LuceneIndexSettings.DIRECTORY_ROOT), "target/lucenefiles"); - properties.putIfAbsent(BackendSettings.backendKey(LuceneBackendSettings.ANALYSIS_CONFIGURER), HapiLuceneAnalysisConfigurer.class.getName()); + properties.putIfAbsent(BackendSettings.backendKey(LuceneBackendSettings.ANALYSIS_CONFIGURER), + HapiHSearchAnalysisConfigurers.HapiLuceneAnalysisConfigurer.class.getName()); properties.putIfAbsent(BackendSettings.backendKey(LuceneBackendSettings.LUCENE_VERSION), Version.LATEST); } else if (properties.get(BackendSettings.backendKey(BackendSettings.TYPE)).equals(ElasticsearchBackendSettings.TYPE_NAME)) { @@ -188,4 +189,4 @@ public class EnvironmentHelper { aBase.put(entry.getKey(), entry.getValue()); } } -} \ No newline at end of file +} diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigCommon.java b/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigCommon.java index 15638f5..ac80f09 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigCommon.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigCommon.java @@ -122,7 +122,7 @@ public class FhirServerConfigCommon { } retVal.setFilterParameterEnabled(appProperties.getFilter_search_enabled()); - retVal.setAdvancedLuceneIndexing(appProperties.getAdvanced_lucene_indexing()); + retVal.setAdvancedHSearchIndexing(appProperties.getAdvanced_lucene_indexing()); retVal.setTreatBaseUrlsAsLocal(new HashSet<>(appProperties.getLocal_base_urls())); return retVal; diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/StarterJpaConfig.java b/src/main/java/ca/uhn/fhir/jpa/starter/StarterJpaConfig.java index 07fd028..2acfabd 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/StarterJpaConfig.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/StarterJpaConfig.java @@ -10,13 +10,19 @@ import ca.uhn.fhir.jpa.config.util.ResourceCountCacheUtil; import ca.uhn.fhir.jpa.config.util.ValidationSupportConfigUtil; import ca.uhn.fhir.jpa.dao.FulltextSearchSvcImpl; import ca.uhn.fhir.jpa.dao.IFulltextSearchSvc; +import ca.uhn.fhir.jpa.dao.mdm.MdmLinkDaoJpaImpl; +import ca.uhn.fhir.jpa.dao.search.HSearchSortHelperImpl; +import ca.uhn.fhir.jpa.dao.search.IHSearchSortHelper; import ca.uhn.fhir.jpa.provider.DaoRegistryResourceSupportedSvc; import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider; import ca.uhn.fhir.jpa.search.IStaleSearchDeletingSvc; import ca.uhn.fhir.jpa.search.StaleSearchDeletingSvcImpl; import ca.uhn.fhir.jpa.util.ResourceCountCache; import ca.uhn.fhir.jpa.validation.JpaValidationSupportChain; +import ca.uhn.fhir.mdm.dao.IMdmLinkDao; import ca.uhn.fhir.rest.api.IResourceSupportedSvc; +import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; + import org.hl7.fhir.common.hapi.validation.support.CachingValidationSupport; import org.springframework.batch.core.configuration.annotation.BatchConfigurer; import org.springframework.beans.factory.annotation.Autowired; @@ -106,4 +112,17 @@ public class StarterJpaConfig { retVal.setEntityManagerFactory(entityManagerFactory); return retVal; } + + @Autowired + private ISearchParamRegistry mySearchParamRegistry; + + @Bean + public IHSearchSortHelper hSearchSortHelper() { + return new HSearchSortHelperImpl(mySearchParamRegistry); + } + + @Bean + public IMdmLinkDao mdmLinkDao(){ + return new MdmLinkDaoJpaImpl(); + } } diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index cb9c9a3..3c0be66 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -42,7 +42,7 @@ spring: ### These settings will enable fulltext search with lucene hibernate.search.enabled: false # hibernate.search.backend.type: lucene - # hibernate.search.backend.analysis.configurer: ca.uhn.fhir.jpa.search.HapiLuceneAnalysisConfigurer + # hibernate.search.backend.analysis.configurer: ca.uhn.fhir.jpa.search.HapiHSearchAnalysisConfigurers$HapiLuceneAnalysisConfigurer # hibernate.search.backend.directory.type: local-filesystem # hibernate.search.backend.directory.root: target/lucenefiles # hibernate.search.backend.lucene_version: lucene_current