From 9becb3fc4409c83414e01760a40cbf068710cab4 Mon Sep 17 00:00:00 2001 From: Kevin Dougan Date: Thu, 24 Dec 2020 09:31:30 -0500 Subject: [PATCH] Remove all traces of EMPI since it has been replaced in master with MDM. --- README.md | 4 +- pom.xml | 6 --- .../java/ca/uhn/fhir/jpa/empi/EmpiConfig.java | 45 ------------------- .../fhir/jpa/empi/EmpiConfigCondition.java | 13 ------ .../uhn/fhir/jpa/starter/AppProperties.java | 10 ----- .../ca/uhn/fhir/jpa/starter/Application.java | 3 +- .../jpa/starter/BaseJpaRestfulServer.java | 3 -- src/main/resources/application.yaml | 1 - .../fhir/jpa/starter/ExampleServerR4IT.java | 5 +-- .../application-integrationtest.yaml | 1 - 10 files changed, 4 insertions(+), 87 deletions(-) delete mode 100644 src/main/java/ca/uhn/fhir/jpa/empi/EmpiConfig.java delete mode 100644 src/main/java/ca/uhn/fhir/jpa/empi/EmpiConfigCondition.java diff --git a/README.md b/README.md index b2f1e2e..fa56b0b 100644 --- a/README.md +++ b/README.md @@ -316,9 +316,9 @@ The server may be configured with subscription support by enabling properties in - `hapi.fhir.subscription.websocket.enabled` - Enables websocket subscriptions. With this enabled, your server will accept incoming websocket connections on the following URL (this example uses the default context path and port, you may need to tweak depending on your deployment environment): [ws://localhost:8080/websocket](ws://localhost:8080/websocket) -## Enabling EMPI +## Enabling CQL -Set `hapi.fhir.empi_enabled=true` in the [application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml) file to enable EMPI on this server. The EMPI matching rules are configured in [empi-rules.json](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/empi-rules.json). The rules in this example file should be replaced with actual matching rules appropriate to your data. Note that EMPI relies on subscriptions, so for EMPI to work, subscriptions must be enabled. +Set `hapi.fhir.cql_enabled=true` in the [application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml) file to enable [Clinical Quality Language](https://cql.hl7.org/) on this server. ## Using Elasticsearch diff --git a/pom.xml b/pom.xml index f1d04ff..40252cd 100644 --- a/pom.xml +++ b/pom.xml @@ -101,12 +101,6 @@ - - - ca.uhn.hapi.fhir - hapi-fhir-jpaserver-empi - ${project.version} - ca.uhn.hapi.fhir diff --git a/src/main/java/ca/uhn/fhir/jpa/empi/EmpiConfig.java b/src/main/java/ca/uhn/fhir/jpa/empi/EmpiConfig.java deleted file mode 100644 index 66317fc..0000000 --- a/src/main/java/ca/uhn/fhir/jpa/empi/EmpiConfig.java +++ /dev/null @@ -1,45 +0,0 @@ -package ca.uhn.fhir.jpa.empi; - -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.empi.api.IEmpiSettings; -import ca.uhn.fhir.empi.rules.config.EmpiRuleValidator; -import ca.uhn.fhir.empi.rules.config.EmpiSettings; -import ca.uhn.fhir.jpa.empi.config.EmpiConsumerConfig; -import ca.uhn.fhir.jpa.empi.config.EmpiSubmitterConfig; -import ca.uhn.fhir.jpa.starter.AppProperties; -import ca.uhn.fhir.rest.server.util.ISearchParamRetriever; -import com.google.common.base.Charsets; -import org.apache.commons.io.IOUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Conditional; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.core.io.DefaultResourceLoader; -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 EMPI is disabled currently. - */ -@Configuration -@Conditional(EmpiConfigCondition.class) -@Import({EmpiConsumerConfig.class, EmpiSubmitterConfig.class}) -public class EmpiConfig { - - @Bean - EmpiRuleValidator empiRuleValidator(FhirContext theFhirContext, ISearchParamRetriever theSearchParamRetriever) { - return new EmpiRuleValidator(theFhirContext, theSearchParamRetriever); - } - - @Bean - IEmpiSettings empiSettings(@Autowired EmpiRuleValidator theEmpiRuleValidator, AppProperties appProperties) throws IOException { - DefaultResourceLoader resourceLoader = new DefaultResourceLoader(); - Resource resource = resourceLoader.getResource("empi-rules.json"); - String json = IOUtils.toString(resource.getInputStream(), Charsets.UTF_8); - return new EmpiSettings(theEmpiRuleValidator).setEnabled(appProperties.getEmpi_enabled()).setScriptText(json); - } - -} diff --git a/src/main/java/ca/uhn/fhir/jpa/empi/EmpiConfigCondition.java b/src/main/java/ca/uhn/fhir/jpa/empi/EmpiConfigCondition.java deleted file mode 100644 index 4854bde..0000000 --- a/src/main/java/ca/uhn/fhir/jpa/empi/EmpiConfigCondition.java +++ /dev/null @@ -1,13 +0,0 @@ -package ca.uhn.fhir.jpa.empi; - -import org.springframework.context.annotation.Condition; -import org.springframework.context.annotation.ConditionContext; -import org.springframework.core.type.AnnotatedTypeMetadata; - -public class EmpiConfigCondition implements Condition { - @Override - public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata metadata) { - String property = conditionContext.getEnvironment().getProperty("hapi.fhir.empi_enabled"); - return Boolean.parseBoolean(property); - } -} diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java b/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java index 064ee13..04ba180 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java @@ -17,14 +17,12 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Configuration; - @ConfigurationProperties(prefix = "hapi.fhir") @Configuration @EnableConfigurationProperties public class AppProperties { private Boolean cql_enabled = false; - private Boolean empi_enabled = false; private Boolean allow_cascading_deletes = false; private Boolean allow_contains_searches = true; private Boolean allow_external_references = false; @@ -99,14 +97,6 @@ public class AppProperties { this.cql_enabled = cql_enabled; } - public Boolean getEmpi_enabled() { - return empi_enabled; - } - - public void setEmpi_enabled(Boolean empi_enabled) { - this.empi_enabled = empi_enabled; - } - public Cors getCors() { return cors; } diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/Application.java b/src/main/java/ca/uhn/fhir/jpa/starter/Application.java index 3ed47a6..e578da7 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/Application.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/Application.java @@ -1,6 +1,5 @@ package ca.uhn.fhir.jpa.starter; -import ca.uhn.fhir.jpa.empi.EmpiConfig; import ca.uhn.fhir.jpa.starter.annotations.OnEitherVersion; import ca.uhn.fhir.jpa.subscription.channel.config.SubscriptionChannelConfig; import ca.uhn.fhir.jpa.subscription.match.config.SubscriptionProcessorConfig; @@ -24,7 +23,7 @@ import org.springframework.web.servlet.DispatcherServlet; @ServletComponentScan(basePackageClasses = { JpaRestfulServer.class}) @SpringBootApplication(exclude = {ElasticsearchRestClientAutoConfiguration.class}) -@Import({SubscriptionSubmitterConfig.class, SubscriptionProcessorConfig.class, SubscriptionChannelConfig.class, WebsocketDispatcherConfig.class, EmpiConfig.class}) +@Import({SubscriptionSubmitterConfig.class, SubscriptionProcessorConfig.class, SubscriptionChannelConfig.class, WebsocketDispatcherConfig.class}) public class Application extends SpringBootServletInitializer { public static void main(String[] args) { 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 66ec107..f4b6453 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/BaseJpaRestfulServer.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/BaseJpaRestfulServer.java @@ -3,7 +3,6 @@ package ca.uhn.fhir.jpa.starter; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.cql.common.provider.CqlProviderLoader; -import ca.uhn.fhir.empi.provider.EmpiProviderLoader; import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster; import ca.uhn.fhir.interceptor.api.IInterceptorService; import ca.uhn.fhir.jpa.api.config.DaoConfig; @@ -100,10 +99,8 @@ public class BaseJpaRestfulServer extends RestfulServer { // These are set only if the features are enabled private CqlProviderLoader cqlProviderLoader; - private EmpiProviderLoader empiProviderLoader; public BaseJpaRestfulServer() { - } private static final long serialVersionUID = 1L; diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index deda0d3..e518d89 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -55,7 +55,6 @@ hapi: # allow_placeholder_references: true # auto_create_placeholder_reference_targets: false # cql_enabled: true -# empi_enabled: false # default_encoding: JSON # default_pretty_print: true # default_page_size: 20 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 1ea6d76..f11d7d5 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java @@ -45,7 +45,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; "spring.datasource.url=jdbc:h2:mem:dbr4", "hapi.fhir.fhir_version=R4", "hapi.fhir.cql_enabled=true", - "hapi.fhir.empi_enabled=false", "hapi.fhir.subscription.websocket_enabled=true", //Override is currently required when using Empi as the construction of the Empi beans are ambiguous as they are constructed multiple places. This is evident when running in a spring boot environment "spring.main.allow-bean-definition-overriding=true" @@ -196,9 +195,7 @@ public class ExampleServerR4IT implements IServerSupport { Patient pt2 = ourClient.read().resource(Patient.class).withId(id).execute(); assertEquals(methodName, pt2.getName().get(0).getFamily()); - // Test EMPI - - // Wait until the EMPI message has been processed + // Wait until the message has been processed await().until(() -> getPeople().size() > 0); List persons = getPeople(); diff --git a/src/test/resources/application-integrationtest.yaml b/src/test/resources/application-integrationtest.yaml index 8068af9..b19a14b 100644 --- a/src/test/resources/application-integrationtest.yaml +++ b/src/test/resources/application-integrationtest.yaml @@ -22,7 +22,6 @@ hapi: # allow_placeholder_references: true # auto_create_placeholder_reference_targets: false # cql_enabled: false -# empi_enabled: false # default_encoding: JSON # default_pretty_print: true # default_page_size: 20