Hacked MDM startup configuration

This commit is contained in:
jkv
2021-06-27 12:25:48 +02:00
parent 6c826b77ed
commit 7387d131b9
4 changed files with 14 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
package ca.uhn.fhir.jpa.starter; package ca.uhn.fhir.jpa.starter;
import ca.uhn.fhir.jpa.mdm.MdmConfig; import ca.uhn.fhir.jpa.starter.mdm.MdmConfig;
import ca.uhn.fhir.jpa.starter.annotations.OnEitherVersion; import ca.uhn.fhir.jpa.starter.annotations.OnEitherVersion;
import ca.uhn.fhir.jpa.subscription.channel.config.SubscriptionChannelConfig; import ca.uhn.fhir.jpa.subscription.channel.config.SubscriptionChannelConfig;
import ca.uhn.fhir.jpa.subscription.match.config.SubscriptionProcessorConfig; import ca.uhn.fhir.jpa.subscription.match.config.SubscriptionProcessorConfig;
@@ -29,6 +29,15 @@ public class Application extends SpringBootServletInitializer {
public static void main(String[] args) { public static void main(String[] args) {
/*
* https://github.com/hapifhir/hapi-fhir-jpaserver-starter/issues/246
* This will be allowed for a short period until we know how MDM should be configured
* or don't have multiple equal bean instantiations.
*
* This will require changes in the main project as stated in the Github comment
* */
System.setProperty("spring.main.allow-bean-definition-overriding","true");
System.setProperty("spring.batch.job.enabled", "false"); System.setProperty("spring.batch.job.enabled", "false");
SpringApplication.run(Application.class, args); SpringApplication.run(Application.class, args);

View File

@@ -1,4 +1,4 @@
package ca.uhn.fhir.jpa.mdm; package ca.uhn.fhir.jpa.starter.mdm;
import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.jpa.mdm.config.MdmConsumerConfig; import ca.uhn.fhir.jpa.mdm.config.MdmConsumerConfig;
@@ -9,6 +9,7 @@ import ca.uhn.fhir.mdm.rules.config.MdmRuleValidator;
import ca.uhn.fhir.mdm.rules.config.MdmSettings; import ca.uhn.fhir.mdm.rules.config.MdmSettings;
import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import ca.uhn.fhir.rest.server.util.ISearchParamRegistry;
import com.google.common.base.Charsets; import com.google.common.base.Charsets;
import java.io.IOException;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@@ -18,12 +19,6 @@ import org.springframework.context.annotation.Import;
import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import java.io.IOException;
/**
* TODO: Move this to package "ca.uhn.fhir.jpa.starter" in HAPI FHIR 5.2.0+. The lousy component scan
* in 5.1.0 picks this up even if MDM is disabled currently.
*/
@Configuration @Configuration
@Conditional(MdmConfigCondition.class) @Conditional(MdmConfigCondition.class)
@Import({MdmConsumerConfig.class, MdmSubmitterConfig.class}) @Import({MdmConsumerConfig.class, MdmSubmitterConfig.class})

View File

@@ -1,4 +1,4 @@
package ca.uhn.fhir.jpa.mdm; package ca.uhn.fhir.jpa.starter.mdm;
import org.springframework.context.annotation.Condition; import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.ConditionContext;

View File

@@ -81,6 +81,7 @@ hapi:
# filter_search_enabled: true # filter_search_enabled: true
# graphql_enabled: true # graphql_enabled: true
# narrative_enabled: true # narrative_enabled: true
# mdm_enabled: true
# partitioning: # partitioning:
# allow_references_across_partitions: false # allow_references_across_partitions: false
# partitioning_include_in_search_hashes: false # partitioning_include_in_search_hashes: false