Merge branch 'rel_5_1_0' of github.com:hapifhir/hapi-fhir-jpaserver-starter into rel_5_1_0

This commit is contained in:
jamesagnew
2020-08-13 15:52:56 -04:00
3 changed files with 53 additions and 36 deletions

View File

@@ -160,7 +160,7 @@ The server may be configured with subscription support by enabling properties in
## Enabling EMPI ## Enabling EMPI
Set `empi.enabled=true` in the [hapi.properties](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/hapi.properties) 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. Set `empi.enabled=true` in the [hapi.properties](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/hapi.properties) 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.
## Using Elasticsearch ## Using Elasticsearch

View File

@@ -1,9 +1,15 @@
package ca.uhn.fhir.jpa.starter; package ca.uhn.fhir.jpa.starter;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.empi.api.IEmpiSettings; 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.empi.rules.config.EmpiSettings;
import ca.uhn.fhir.jpa.empi.svc.EmpiSearchParamSvc;
import ca.uhn.fhir.jpa.subscription.channel.subscription.IChannelNamer;
import ca.uhn.fhir.rest.server.util.ISearchParamRetriever;
import com.google.common.base.Charsets; import com.google.common.base.Charsets;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.DefaultResourceLoader;
@@ -15,11 +21,11 @@ import java.io.IOException;
public class EmpiConfig { public class EmpiConfig {
@Bean @Bean
IEmpiSettings empiSettings() throws IOException { IEmpiSettings empiSettings(EmpiRuleValidator theEmpiRuleValidator) throws IOException {
DefaultResourceLoader resourceLoader = new DefaultResourceLoader(); DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
Resource resource = resourceLoader.getResource("empi-rules.json"); Resource resource = resourceLoader.getResource("empi-rules.json");
String json = IOUtils.toString(resource.getInputStream(), Charsets.UTF_8); String json = IOUtils.toString(resource.getInputStream(), Charsets.UTF_8);
return null; // new EmpiSettings().setEnabled(HapiProperties.getEmpiEnabled()).setScriptText(json); return new EmpiSettings(theEmpiRuleValidator).setEnabled(HapiProperties.getEmpiEnabled()).setScriptText(json);
} }
} }

View File

@@ -1,35 +1,46 @@
{ {
"candidateSearchParams" : [ { "candidateSearchParams": [
{
"resourceType": "Patient", "resourceType": "Patient",
"searchParam" : "birthdate" "searchParams": ["birthdate"]
}, { },
{
"resourceType": "*", "resourceType": "*",
"searchParam" : "identifier" "searchParams": ["identifier"]
},{ },
{
"resourceType": "Patient", "resourceType": "Patient",
"searchParam" : "general-practitioner" "searchParams": ["general-practitioner"]
} ], }
"candidateFilterSearchParams" : [ { ],
"candidateFilterSearchParams": [
{
"resourceType": "*", "resourceType": "*",
"searchParam": "active", "searchParam": "active",
"fixedValue": "true" "fixedValue": "true"
} ], }
"matchFields" : [ { ],
"name" : "given-name", "matchFields": [
{
"name": "cosine-given-name",
"resourceType": "*", "resourceType": "*",
"resourcePath": "name.given", "resourcePath": "name.given",
"metric": "COSINE", "metric": "COSINE",
"matchThreshold" : 0.8 "matchThreshold": 0.8,
}, { "exact": true
"name" : "last-name", },
{
"name": "jaro-last-name",
"resourceType": "*", "resourceType": "*",
"resourcePath": "name.family", "resourcePath": "name.family",
"metric": "JARO_WINKLER", "metric": "JARO_WINKLER",
"matchThreshold" : 0.8 "matchThreshold": 0.8,
}], "exact": true
}
],
"matchResultMap": { "matchResultMap": {
"given-name" : "POSSIBLE_MATCH", "cosine-given-name" : "POSSIBLE_MATCH",
"given-name,last-name" : "MATCH" "cosine-given-name,jaro-last-name" : "MATCH"
}, },
"eidSystem": "http://company.io/fhir/NamingSystem/custom-eid-system" "eidSystem": "http://company.io/fhir/NamingSystem/custom-eid-system"
} }