What this commit has achieved: 1. Externalized location of "mdm-rules.json" in the `AppProperties` 2. More info about the `ResourceLoader` interface is available at https://docs.spring.io/spring-framework/reference/core/resources.html#resources-resourceloader
This commit is contained in:
@@ -27,6 +27,7 @@ public class AppProperties {
|
||||
private Boolean ips_enabled = false;
|
||||
private Boolean openapi_enabled = false;
|
||||
private Boolean mdm_enabled = false;
|
||||
private String mdm_rules_json_location = "mdm-rules.json";
|
||||
private boolean advanced_lucene_indexing = false;
|
||||
private boolean enable_index_of_type = false;
|
||||
private Boolean allow_cascading_deletes = false;
|
||||
@@ -191,7 +192,15 @@ public class AppProperties {
|
||||
this.mdm_enabled = mdm_enabled;
|
||||
}
|
||||
|
||||
public Cors getCors() {
|
||||
public String getMdm_rules_json_location() {
|
||||
return mdm_rules_json_location;
|
||||
}
|
||||
|
||||
public void setMdm_rules_json_location(String mdm_rules_json_location) {
|
||||
this.mdm_rules_json_location = mdm_rules_json_location;
|
||||
}
|
||||
|
||||
public Cors getCors() {
|
||||
return cors;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class MdmConfig {
|
||||
IMdmSettings mdmSettings(@Autowired MdmRuleValidator theMdmRuleValidator, AppProperties appProperties)
|
||||
throws IOException {
|
||||
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
|
||||
Resource resource = resourceLoader.getResource("mdm-rules.json");
|
||||
Resource resource = resourceLoader.getResource(appProperties.getMdm_rules_json_location());
|
||||
String json = IOUtils.toString(resource.getInputStream(), StandardCharsets.UTF_8);
|
||||
return new MdmSettings(theMdmRuleValidator)
|
||||
.setEnabled(appProperties.getMdm_enabled())
|
||||
|
||||
@@ -137,6 +137,7 @@ hapi:
|
||||
# graphql_enabled: true
|
||||
narrative_enabled: false
|
||||
mdm_enabled: false
|
||||
mdm_rules_json_location: "mdm-rules.json"
|
||||
# local_base_urls:
|
||||
# - https://hapi.fhir.org/baseR4
|
||||
# partitioning:
|
||||
|
||||
Reference in New Issue
Block a user