Remove all traces of EMPI since it has been replaced in master with MDM.
This commit is contained in:
@@ -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)
|
- `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
|
## Using Elasticsearch
|
||||||
|
|
||||||
|
|||||||
6
pom.xml
6
pom.xml
@@ -101,12 +101,6 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</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 -->
|
<!-- This dependency includes the JPA CQL Server -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -17,14 +17,12 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
|
||||||
@ConfigurationProperties(prefix = "hapi.fhir")
|
@ConfigurationProperties(prefix = "hapi.fhir")
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableConfigurationProperties
|
@EnableConfigurationProperties
|
||||||
public class AppProperties {
|
public class AppProperties {
|
||||||
|
|
||||||
private Boolean cql_enabled = false;
|
private Boolean cql_enabled = false;
|
||||||
private Boolean empi_enabled = false;
|
|
||||||
private Boolean allow_cascading_deletes = false;
|
private Boolean allow_cascading_deletes = false;
|
||||||
private Boolean allow_contains_searches = true;
|
private Boolean allow_contains_searches = true;
|
||||||
private Boolean allow_external_references = false;
|
private Boolean allow_external_references = false;
|
||||||
@@ -99,14 +97,6 @@ public class AppProperties {
|
|||||||
this.cql_enabled = cql_enabled;
|
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() {
|
public Cors getCors() {
|
||||||
return cors;
|
return cors;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package ca.uhn.fhir.jpa.starter;
|
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.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;
|
||||||
@@ -24,7 +23,7 @@ import org.springframework.web.servlet.DispatcherServlet;
|
|||||||
@ServletComponentScan(basePackageClasses = {
|
@ServletComponentScan(basePackageClasses = {
|
||||||
JpaRestfulServer.class})
|
JpaRestfulServer.class})
|
||||||
@SpringBootApplication(exclude = {ElasticsearchRestClientAutoConfiguration.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 class Application extends SpringBootServletInitializer {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package ca.uhn.fhir.jpa.starter;
|
|||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||||
import ca.uhn.fhir.cql.common.provider.CqlProviderLoader;
|
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.IInterceptorBroadcaster;
|
||||||
import ca.uhn.fhir.interceptor.api.IInterceptorService;
|
import ca.uhn.fhir.interceptor.api.IInterceptorService;
|
||||||
import ca.uhn.fhir.jpa.api.config.DaoConfig;
|
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
|
// These are set only if the features are enabled
|
||||||
private CqlProviderLoader cqlProviderLoader;
|
private CqlProviderLoader cqlProviderLoader;
|
||||||
private EmpiProviderLoader empiProviderLoader;
|
|
||||||
|
|
||||||
public BaseJpaRestfulServer() {
|
public BaseJpaRestfulServer() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ hapi:
|
|||||||
# allow_placeholder_references: true
|
# allow_placeholder_references: true
|
||||||
# auto_create_placeholder_reference_targets: false
|
# auto_create_placeholder_reference_targets: false
|
||||||
# cql_enabled: true
|
# cql_enabled: true
|
||||||
# empi_enabled: false
|
|
||||||
# default_encoding: JSON
|
# default_encoding: JSON
|
||||||
# default_pretty_print: true
|
# default_pretty_print: true
|
||||||
# default_page_size: 20
|
# default_page_size: 20
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||||||
"spring.datasource.url=jdbc:h2:mem:dbr4",
|
"spring.datasource.url=jdbc:h2:mem:dbr4",
|
||||||
"hapi.fhir.fhir_version=R4",
|
"hapi.fhir.fhir_version=R4",
|
||||||
"hapi.fhir.cql_enabled=true",
|
"hapi.fhir.cql_enabled=true",
|
||||||
"hapi.fhir.empi_enabled=false",
|
|
||||||
"hapi.fhir.subscription.websocket_enabled=true",
|
"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
|
//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"
|
"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();
|
Patient pt2 = ourClient.read().resource(Patient.class).withId(id).execute();
|
||||||
assertEquals(methodName, pt2.getName().get(0).getFamily());
|
assertEquals(methodName, pt2.getName().get(0).getFamily());
|
||||||
|
|
||||||
// Test EMPI
|
// Wait until the message has been processed
|
||||||
|
|
||||||
// Wait until the EMPI message has been processed
|
|
||||||
await().until(() -> getPeople().size() > 0);
|
await().until(() -> getPeople().size() > 0);
|
||||||
List<Person> persons = getPeople();
|
List<Person> persons = getPeople();
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ hapi:
|
|||||||
# allow_placeholder_references: true
|
# allow_placeholder_references: true
|
||||||
# auto_create_placeholder_reference_targets: false
|
# auto_create_placeholder_reference_targets: false
|
||||||
# cql_enabled: false
|
# cql_enabled: false
|
||||||
# empi_enabled: false
|
|
||||||
# default_encoding: JSON
|
# default_encoding: JSON
|
||||||
# default_pretty_print: true
|
# default_pretty_print: true
|
||||||
# default_page_size: 20
|
# default_page_size: 20
|
||||||
|
|||||||
Reference in New Issue
Block a user