diff --git a/pom.xml b/pom.xml index a79398fa8f9..d52cc93ad51 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ ca.uhn.hapi.fhir hapi-fhir - 7.4.0 + 7.6.0 hapi-fhir-jpaserver-starter diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/common/StarterJpaConfig.java b/src/main/java/ca/uhn/fhir/jpa/starter/common/StarterJpaConfig.java index f6a7c9aa4e5..3c91b00a284 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/common/StarterJpaConfig.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/common/StarterJpaConfig.java @@ -1,5 +1,6 @@ package ca.uhn.fhir.jpa.starter.common; +import ca.uhn.fhir.batch2.config.Batch2JobRegisterer; import ca.uhn.fhir.batch2.coordinator.JobDefinitionRegistry; import ca.uhn.fhir.batch2.jobs.export.BulkDataExportProvider; import ca.uhn.fhir.batch2.jobs.imprt.BulkDataImportProvider; @@ -46,7 +47,6 @@ import ca.uhn.fhir.jpa.starter.common.validation.IRepositoryValidationInterceptorFactory; import ca.uhn.fhir.jpa.starter.ig.IImplementationGuideOperationProvider; import ca.uhn.fhir.jpa.starter.util.EnvironmentHelper; -import ca.uhn.fhir.jpa.starter.ig.IImplementationGuideOperationProvider; import ca.uhn.fhir.jpa.subscription.util.SubscriptionDebugLogInterceptor; import ca.uhn.fhir.jpa.util.ResourceCountCache; import ca.uhn.fhir.jpa.validation.JpaValidationSupportChain; @@ -66,6 +66,8 @@ import com.google.common.base.Strings; import jakarta.persistence.EntityManagerFactory; import org.hl7.fhir.common.hapi.validation.support.CachingValidationSupport; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; @@ -89,7 +91,7 @@ @Import(ThreadPoolFactoryConfig.class) public class StarterJpaConfig { - private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(StarterJpaConfig.class); + private static final Logger ourLog = LoggerFactory.getLogger(StarterJpaConfig.class); @Bean public IFulltextSearchSvc fullTextSearchSvc() { @@ -191,11 +193,11 @@ public LoggingInterceptor loggingInterceptor(AppProperties appProperties) { @Primary @Conditional(OnImplementationGuidesPresent.class) public IPackageInstallerSvc packageInstaller( - AppProperties appProperties, - JobDefinition reindexJobParametersJobDefinition, - JobDefinitionRegistry jobDefinitionRegistry, - IPackageInstallerSvc packageInstallerSvc) { - jobDefinitionRegistry.addJobDefinitionIfNotRegistered(reindexJobParametersJobDefinition); + AppProperties appProperties, + IPackageInstallerSvc packageInstallerSvc, + Batch2JobRegisterer batch2JobRegisterer) { + + batch2JobRegisterer.start(); if (appProperties.getImplementationGuides() != null) { Map guides = appProperties.getImplementationGuides(); diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/cr/CareGapsProperties.java b/src/main/java/ca/uhn/fhir/jpa/starter/cr/CareGapsProperties.java index fe4565b08fe..f25d7b2b73f 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/cr/CareGapsProperties.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/cr/CareGapsProperties.java @@ -1,22 +1,22 @@ package ca.uhn.fhir.jpa.starter.cr; public class CareGapsProperties { - private String reporter = "default"; + private String reporter = "default"; private String section_author = "default"; - public String getReporter() { - return reporter; - } + public String getReporter() { + return reporter; + } - public void setReporter(String reporter) { - this.reporter = reporter; - } + public void setReporter(String reporter) { + this.reporter = reporter; + } - public String getSection_author() { - return section_author; - } + public String getSection_author() { + return section_author; + } - public void setSection_author(String section_author) { - this.section_author = section_author; - } + public void setSection_author(String section_author) { + this.section_author = section_author; + } } diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/cr/CqlCompilerProperties.java b/src/main/java/ca/uhn/fhir/jpa/starter/cr/CqlCompilerProperties.java index ce44ca30cd8..f392b04978a 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/cr/CqlCompilerProperties.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/cr/CqlCompilerProperties.java @@ -5,7 +5,7 @@ import org.cqframework.cql.cql2elm.LibraryBuilder; public class CqlCompilerProperties { - private Boolean validate_units = true; + private Boolean validate_units = true; private Boolean verify_only = false; private String compatibility_level = "1.5"; private CqlCompilerException.ErrorSeverity error_level = CqlCompilerException.ErrorSeverity.Info; @@ -27,7 +27,6 @@ public class CqlCompilerProperties { private Boolean require_from_keyword = false; private Boolean disable_default_model_info_load = false; - public boolean isValidateUnits() { return validate_units; } @@ -194,5 +193,5 @@ public CqlTranslator.Format getTranslatorFormat() { public void setTranslatorFormat(CqlTranslator.Format translatorFormat) { this.translator_format = translatorFormat; - } + } } diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/cr/CqlProperties.java b/src/main/java/ca/uhn/fhir/jpa/starter/cr/CqlProperties.java index 53f297fd871..845e0c37a9c 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/cr/CqlProperties.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/cr/CqlProperties.java @@ -5,49 +5,49 @@ public class CqlProperties { - private Boolean use_embedded_libraries = true; - private CqlCompilerProperties compiler = new CqlCompilerProperties(); - private CqlRuntimeProperties runtime = new CqlRuntimeProperties(); - private TerminologySettings terminology = new TerminologySettings(); - private RetrieveSettings data = new RetrieveSettings(); - - public Boolean getUse_embedded_libraries() { - return use_embedded_libraries; - } - - public void setUse_embedded_libraries(Boolean use_embedded_libraries) { - this.use_embedded_libraries = use_embedded_libraries; - } - - public CqlCompilerProperties getCompiler() { - return compiler; - } - - public void setCompiler(CqlCompilerProperties compiler) { - this.compiler = compiler; - } - - public CqlRuntimeProperties getRuntime() { - return runtime; - } - - public void setRuntime(CqlRuntimeProperties runtime) { - this.runtime = runtime; - } - - public TerminologySettings getTerminology() { - return terminology; - } - - public void setTerminology(TerminologySettings terminology) { - this.terminology = terminology; - } - - public RetrieveSettings getData() { - return data; - } - - public void setData(RetrieveSettings data) { - this.data = data; - } + private Boolean use_embedded_libraries = true; + private CqlCompilerProperties compiler = new CqlCompilerProperties(); + private CqlRuntimeProperties runtime = new CqlRuntimeProperties(); + private TerminologySettings terminology = new TerminologySettings(); + private RetrieveSettings data = new RetrieveSettings(); + + public Boolean getUse_embedded_libraries() { + return use_embedded_libraries; + } + + public void setUse_embedded_libraries(Boolean use_embedded_libraries) { + this.use_embedded_libraries = use_embedded_libraries; + } + + public CqlCompilerProperties getCompiler() { + return compiler; + } + + public void setCompiler(CqlCompilerProperties compiler) { + this.compiler = compiler; + } + + public CqlRuntimeProperties getRuntime() { + return runtime; + } + + public void setRuntime(CqlRuntimeProperties runtime) { + this.runtime = runtime; + } + + public TerminologySettings getTerminology() { + return terminology; + } + + public void setTerminology(TerminologySettings terminology) { + this.terminology = terminology; + } + + public RetrieveSettings getData() { + return data; + } + + public void setData(RetrieveSettings data) { + this.data = data; + } } diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/cr/CqlRuntimeProperties.java b/src/main/java/ca/uhn/fhir/jpa/starter/cr/CqlRuntimeProperties.java index f0dbfdb9af4..0677d05e9d6 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/cr/CqlRuntimeProperties.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/cr/CqlRuntimeProperties.java @@ -2,7 +2,7 @@ public class CqlRuntimeProperties { - private Boolean debug_logging_enabled = false; + private Boolean debug_logging_enabled = false; private Boolean enable_validation = false; private Boolean enable_expression_caching = true; @@ -14,7 +14,6 @@ public void setDebugLoggingEnabled(boolean debug_logging_enabled) { this.debug_logging_enabled = debug_logging_enabled; } - public boolean isEnableExpressionCaching() { return enable_expression_caching; } @@ -30,6 +29,4 @@ public boolean isEnableValidation() { public void EnableValidation(boolean enable_validation) { this.enable_validation = enable_validation; } - - } diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/cr/CrCommonConfig.java b/src/main/java/ca/uhn/fhir/jpa/starter/cr/CrCommonConfig.java index 59274ed8670..26d7f5f9fa6 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/cr/CrCommonConfig.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/cr/CrCommonConfig.java @@ -1,13 +1,14 @@ package ca.uhn.fhir.jpa.starter.cr; -import java.util.EnumSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - +import ca.uhn.fhir.cr.common.CodeCacheResourceChangeListener; +import ca.uhn.fhir.cr.common.CqlThreadFactory; +import ca.uhn.fhir.cr.common.ElmCacheResourceChangeListener; +import ca.uhn.fhir.jpa.api.dao.DaoRegistry; +import ca.uhn.fhir.jpa.cache.IResourceChangeListenerRegistry; +import ca.uhn.fhir.jpa.cache.ResourceChangeListenerRegistryInterceptor; +import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; +import ca.uhn.fhir.rest.server.RestfulServer; +import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory; import org.cqframework.cql.cql2elm.CqlCompilerOptions; import org.cqframework.cql.cql2elm.model.CompiledLibrary; import org.cqframework.cql.cql2elm.model.Model; @@ -28,15 +29,13 @@ import org.springframework.context.annotation.Primary; import org.springframework.security.concurrent.DelegatingSecurityContextExecutorService; -import ca.uhn.fhir.cr.common.CodeCacheResourceChangeListener; -import ca.uhn.fhir.cr.common.CqlThreadFactory; -import ca.uhn.fhir.cr.common.ElmCacheResourceChangeListener; -import ca.uhn.fhir.jpa.api.dao.DaoRegistry; -import ca.uhn.fhir.jpa.cache.IResourceChangeListenerRegistry; -import ca.uhn.fhir.jpa.cache.ResourceChangeListenerRegistryInterceptor; -import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; -import ca.uhn.fhir.rest.server.RestfulServer; -import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; @Configuration @Conditional({CrConfigCondition.class}) @@ -157,8 +156,12 @@ public ExecutorService cqlExecutor() { @Bean CareGapsProperties careGapsProperties(CrProperties theCrProperties) { var careGapsProperties = new CareGapsProperties(); - careGapsProperties.setCareGapsReporter(theCrProperties.getCareGaps().getReporter()); - careGapsProperties.setCareGapsCompositionSectionAuthor(theCrProperties.getCareGaps().getSection_author()); + // This check for the resource type really should be happening down in CR where the setting is actually used but + // that will have to wait for a future CR release + careGapsProperties.setCareGapsReporter( + theCrProperties.getCareGaps().getReporter().replace("Organization/", "")); + careGapsProperties.setCareGapsCompositionSectionAuthor( + theCrProperties.getCareGaps().getSection_author().replace("Organization/", "")); return careGapsProperties; } @@ -224,5 +227,5 @@ public CodeCacheResourceChangeListener codeCacheResourceChangeListener( @Bean public ResourceChangeListenerRegistryInterceptor resourceChangeListenerRegistryInterceptor() { return new ResourceChangeListenerRegistryInterceptor(); - } + } } diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/cr/CrProperties.java b/src/main/java/ca/uhn/fhir/jpa/starter/cr/CrProperties.java index 58ca3c2e82e..8ba5ccf0e79 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/cr/CrProperties.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/cr/CrProperties.java @@ -1,9 +1,5 @@ package ca.uhn.fhir.jpa.starter.cr; -import org.cqframework.cql.cql2elm.CqlCompilerException; -import org.cqframework.cql.cql2elm.CqlTranslator; -import org.cqframework.cql.cql2elm.LibraryBuilder; - public class CrProperties { private Boolean enabled; diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrDstu3Config.java b/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrDstu3Config.java index 77e91bbfcfe..44f7d42a01c 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrDstu3Config.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrDstu3Config.java @@ -2,10 +2,9 @@ import ca.uhn.fhir.cr.config.dstu3.ApplyOperationConfig; import ca.uhn.fhir.cr.config.dstu3.CrDstu3Config; -import ca.uhn.fhir.cr.config.dstu3.ExtractOperationConfig; +import ca.uhn.fhir.cr.config.dstu3.DataRequirementsOperationConfig; +import ca.uhn.fhir.cr.config.dstu3.EvaluateOperationConfig; import ca.uhn.fhir.cr.config.dstu3.PackageOperationConfig; -import ca.uhn.fhir.cr.config.dstu3.PopulateOperationConfig; -import ca.uhn.fhir.cr.config.dstu3.QuestionnaireOperationConfig; import ca.uhn.fhir.jpa.starter.annotations.OnDSTU3Condition; import org.springframework.context.annotation.*; @@ -15,11 +14,8 @@ CrCommonConfig.class, CrDstu3Config.class, ApplyOperationConfig.class, - ExtractOperationConfig.class, - PackageOperationConfig.class, - PopulateOperationConfig.class, - QuestionnaireOperationConfig.class + DataRequirementsOperationConfig.class, + EvaluateOperationConfig.class, + PackageOperationConfig.class }) -public class StarterCrDstu3Config { - -} +public class StarterCrDstu3Config {} diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrR4Config.java b/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrR4Config.java index ee53bf2e872..28c10cf9b82 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrR4Config.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrR4Config.java @@ -2,6 +2,8 @@ import ca.uhn.fhir.cr.config.r4.ApplyOperationConfig; import ca.uhn.fhir.cr.config.r4.CrR4Config; +import ca.uhn.fhir.cr.config.r4.DataRequirementsOperationConfig; +import ca.uhn.fhir.cr.config.r4.EvaluateOperationConfig; import ca.uhn.fhir.cr.config.r4.ExtractOperationConfig; import ca.uhn.fhir.cr.config.r4.PackageOperationConfig; import ca.uhn.fhir.cr.config.r4.PopulateOperationConfig; @@ -17,11 +19,11 @@ CrCommonConfig.class, CrR4Config.class, ApplyOperationConfig.class, + DataRequirementsOperationConfig.class, + EvaluateOperationConfig.class, ExtractOperationConfig.class, PackageOperationConfig.class, PopulateOperationConfig.class, QuestionnaireOperationConfig.class }) -public class StarterCrR4Config { - -} +public class StarterCrR4Config {} diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 71eee070248..5165d9c19bc 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -121,7 +121,7 @@ hapi: valueset_membership_mode: USE_EXPANSION # AUTO, USE_VALIDATE_CODE_OPERATION, USE_EXPANSION code_lookup_mode: USE_VALIDATE_CODE_OPERATION # AUTO, USE_VALIDATE_CODE_OPERATION, USE_CODESYSTEM_URL data: - search_parameter_mode: FILTER_IN_MEMORY # AUTO, USE_SEARCH_PARAMETERS, FILTER_IN_MEMORY + search_parameter_mode: USE_SEARCH_PARAMETERS # AUTO, USE_SEARCH_PARAMETERS, FILTER_IN_MEMORY terminology_parameter_mode: FILTER_IN_MEMORY # AUTO, USE_VALUE_SET_URL, USE_INLINE_CODES, FILTER_IN_MEMORY profile_mode: DECLARED # ENFORCED, DECLARED, OPTIONAL, TRUST, OFF diff --git a/src/main/resources/cds.application.yaml b/src/main/resources/cds.application.yaml index 65d28ff12d9..e94030c4478 100644 --- a/src/main/resources/cds.application.yaml +++ b/src/main/resources/cds.application.yaml @@ -177,7 +177,7 @@ hapi: # allowed_bundle_types: COLLECTION,DOCUMENT,MESSAGE,TRANSACTION,TRANSACTIONRESPONSE,BATCH,BATCHRESPONSE,HISTORY,SEARCHSET # allow_cascading_deletes: true # allow_contains_searches: true - # allow_external_references: true + allow_external_references: true # allow_multiple_delete: true # allow_override_default_search_params: true # auto_create_placeholder_reference_targets: false diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/ElasticsearchLastNR4IT.java b/src/test/java/ca/uhn/fhir/jpa/starter/ElasticsearchLastNR4IT.java index 9d4c033c436..b8279468869 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/ElasticsearchLastNR4IT.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/ElasticsearchLastNR4IT.java @@ -16,6 +16,7 @@ import java.util.List; import co.elastic.clients.elasticsearch.ElasticsearchClient; +import co.elastic.clients.elasticsearch.indices.IndexSettings; import co.elastic.clients.json.JsonData; import jakarta.annotation.PreDestroy; import org.elasticsearch.client.RequestOptions; @@ -91,7 +92,7 @@ public static void beforeClass() throws IOException { elasticsearchHighLevelRestClient.indices().putTemplate(t->{ t.name("hapi_fhir_template"); t.indexPatterns("*"); - t.settings("index.max_result_window", JsonData.of(50000)); + t.settings(new IndexSettings.Builder().maxResultWindow(50000).build()); return t; }); diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java index a8039809243..041a4fce646 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java @@ -69,6 +69,7 @@ "hapi.fhir.cr.enabled=true", "hapi.fhir.cr.caregaps.section_author=Organization/alphora-author", "hapi.fhir.cr.caregaps.reporter=Organization/alphora", + "hapi.fhir.cr.cql.data.search_parameter_mode=USE_SEARCH_PARAMETERS", "hapi.fhir.implementationguides.dk-core.name=hl7.fhir.dk.core", "hapi.fhir.implementationguides.dk-core.version=1.1.0", "hapi.fhir.auto_create_placeholder_reference_targets=true",