Merge branch 'master' into rel_5_7

This commit is contained in:
Tadgh
2022-02-17 17:52:36 -08:00
17 changed files with 214 additions and 128 deletions

View File

@@ -14,6 +14,8 @@ import ca.uhn.fhir.rest.server.mail.IMailSvc;
import ca.uhn.fhir.rest.server.mail.MailConfig;
import ca.uhn.fhir.rest.server.mail.MailSvc;
import com.google.common.base.Strings;
import java.util.HashSet;
import java.util.Optional;
import org.hl7.fhir.dstu2.model.Subscription;
import org.springframework.boot.env.YamlPropertySourceLoader;
import org.springframework.context.annotation.Bean;
@@ -23,8 +25,6 @@ import org.springframework.context.annotation.Primary;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import java.util.Optional;
/**
* This is the primary configuration file for the example server
*/
@@ -65,7 +65,7 @@ public class FhirServerConfigCommon {
if (appProperties.getSubscription().getEmail() != null) {
ourLog.info("Email subscriptions enabled");
}
if (appProperties.getEnable_index_contained_resource() == Boolean.TRUE) {
ourLog.info("Indexed on contained resource enabled");
}
@@ -119,6 +119,8 @@ public class FhirServerConfigCommon {
}
retVal.setFilterParameterEnabled(appProperties.getFilter_search_enabled());
retVal.setAdvancedLuceneIndexing(appProperties.getAdvanced_lucene_indexing());
retVal.setTreatBaseUrlsAsLocal(new HashSet<>(appProperties.getLocal_base_urls()));
return retVal;
}
@@ -139,7 +141,7 @@ public class FhirServerConfigCommon {
if(appProperties.getPartitioning().getAllow_references_across_partitions()) {
retVal.setAllowReferencesAcrossPartitions(CrossPartitionReferenceMode.ALLOWED_UNQUALIFIED);
} else {
retVal.setAllowReferencesAcrossPartitions(CrossPartitionReferenceMode.NOT_ALLOWED);
retVal.setAllowReferencesAcrossPartitions(CrossPartitionReferenceMode.NOT_ALLOWED);
}
}
@@ -154,8 +156,8 @@ public class FhirServerConfigCommon {
}
@Bean
public ModelConfig modelConfig(AppProperties appProperties) {
ModelConfig modelConfig = new ModelConfig();
public ModelConfig modelConfig(AppProperties appProperties, DaoConfig daoConfig) {
ModelConfig modelConfig = daoConfig.getModelConfig();
modelConfig.setAllowContainsSearches(appProperties.getAllow_contains_searches());
modelConfig.setAllowExternalReferences(appProperties.getAllow_external_references());
modelConfig.setDefaultSearchParamsCanBeOverridden(appProperties.getAllow_override_default_search_params());
@@ -172,7 +174,7 @@ public class FhirServerConfigCommon {
}
modelConfig.setNormalizedQuantitySearchLevel(appProperties.getNormalized_quantity_search_level());
modelConfig.setIndexOnContainedResources(appProperties.getEnable_index_contained_resource());
return modelConfig;
}
@@ -222,7 +224,7 @@ public class FhirServerConfigCommon {
IMailSvc mailSvc = new MailSvc(mailConfig);
IEmailSender emailSender = new EmailSenderImpl(mailSvc);
subscriptionDeliveryHandlerFactory.get().setEmailSender(emailSender);
subscriptionDeliveryHandlerFactory.ifPresent(theSubscriptionDeliveryHandlerFactory -> theSubscriptionDeliveryHandlerFactory.setEmailSender(emailSender));
return emailSender;
}