From 3954f6a3f494bdb3ea0466712bbfab563acae606 Mon Sep 17 00:00:00 2001 From: Kevin Dougan Date: Thu, 7 Jan 2021 09:12:52 -0500 Subject: [PATCH] Merged the rel_5_3_0 branch into this Branch to pick up the MDM changes. --- .editorconfig | 4 +- README.md | 7 +- pom.xml | 23 +- .../java/ca/uhn/fhir/jpa/mdm/MdmConfig.java | 45 +++ .../uhn/fhir/jpa/mdm/MdmConfigCondition.java | 13 + .../uhn/fhir/jpa/starter/AppProperties.java | 20 +- .../ca/uhn/fhir/jpa/starter/Application.java | 3 +- .../jpa/starter/BaseJpaRestfulServer.java | 7 + .../fhir/jpa/starter/EnvironmentHelper.java | 50 ++- .../jpa/starter/FhirServerConfigCommon.java | 13 +- .../fhir/jpa/starter/FhirServerConfigR4.java | 10 +- ...va => JpaHibernatePropertiesProvider.java} | 6 +- ...epositoryValidationInterceptorFactory.java | 38 +++ src/main/resources/application.yaml | 5 +- .../{empi-rules.json => mdm-rules.json} | 1 + .../jpa/starter/ElasticsearchLastNR4IT.java | 35 +- .../fhir/jpa/starter/ExampleServerR4IT.java | 317 ++++++------------ .../fhir/jpa/starter/ExampleServerR5IT.java | 3 +- 18 files changed, 338 insertions(+), 262 deletions(-) create mode 100644 src/main/java/ca/uhn/fhir/jpa/mdm/MdmConfig.java create mode 100644 src/main/java/ca/uhn/fhir/jpa/mdm/MdmConfigCondition.java rename src/main/java/ca/uhn/fhir/jpa/starter/{JpaHibernateDialectProvider.java => JpaHibernatePropertiesProvider.java} (78%) create mode 100644 src/main/java/ca/uhn/fhir/jpa/starter/RepositoryValidationInterceptorFactory.java rename src/main/resources/{empi-rules.json => mdm-rules.json} (95%) diff --git a/.editorconfig b/.editorconfig index cd68918..904096d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,5 @@ [*.java] charset = utf-8 -indent_style = space -indent_size = 2 +indent_style = tab +indent_size = 3 diff --git a/README.md b/README.md index fa56b0b..12fb454 100644 --- a/README.md +++ b/README.md @@ -320,6 +320,10 @@ The server may be configured with subscription support by enabling properties in 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. +## Enabling MDM (EMPI) + +Set `hapi.fhir.mdm_enabled=true` in the [application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml) file to enable MDM on this server. The MDM matching rules are configured in [mdm-rules.json](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/mdm-rules.json). The rules in this example file should be replaced with actual matching rules appropriate to your data. Note that MDM relies on subscriptions, so for MDM to work, subscriptions must be enabled. + ## Using Elasticsearch By default, the server will use embedded lucene indexes for terminology and fulltext indexing purposes. You can switch this to using lucene by editing the properties in [application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml) @@ -328,9 +332,10 @@ For example: ```properties elasticsearch.enabled=true -elasticsearch.rest_url=http://localhost:9200 +elasticsearch.rest_url=localhost:9200 elasticsearch.username=SomeUsername elasticsearch.password=SomePassword +elasticsearch.protocol=http elasticsearch.required_index_status=YELLOW elasticsearch.schema_management_strategy=CREATE ``` diff --git a/pom.xml b/pom.xml index 40252cd..f5b6e0e 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,6 @@ 8 - 2.3.4.RELEASE @@ -107,6 +106,12 @@ hapi-fhir-jpaserver-cql ${project.version} + + + ca.uhn.hapi.fhir + hapi-fhir-jpaserver-mdm + ${project.version} + ca.uhn.hapi.fhir @@ -235,6 +240,21 @@ jetty-webapp test + + org.testcontainers + testcontainers + test + + + org.testcontainers + elasticsearch + test + + + org.testcontainers + junit-jupiter + test +