Remove all traces of EMPI since it has been replaced in master with MDM.

This commit is contained in:
Kevin Dougan
2020-12-24 09:31:30 -05:00
parent f23553e2ea
commit 9becb3fc44
10 changed files with 4 additions and 87 deletions

View File

@@ -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

View File

@@ -101,12 +101,6 @@
</exclusion>
</exclusions>
</dependency>
<!-- This dependency includes the JPA EMPI Server -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-jpaserver-empi</artifactId>
<version>${project.version}</version>
</dependency>
<!-- This dependency includes the JPA CQL Server -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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;
}

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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

View File

@@ -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<Person> persons = getPeople();

View File

@@ -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