Adding properties:

- enforce referential integrity on delete
- enforce referential integrity on write
- auto create reference targets
This commit is contained in:
Sean McIlvenna
2019-10-01 11:12:32 -07:00
parent cc7a56be20
commit 2fcad90e93
3 changed files with 25 additions and 2 deletions

View File

@@ -28,6 +28,9 @@ public class FhirServerConfigCommon {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirServerConfigCommon.class);
private Boolean autoCreatePlaceholderReferenceTargets = HapiProperties.getAutoCreatePlaceholderReferenceTargets();
private Boolean enforceReferentialIntegrityOnWrite = HapiProperties.getEnforceReferentialIntegrityOnWrite();
private Boolean enforceReferentialIntegrityOnDelete = HapiProperties.getEnforceReferentialIntegrityOnDelete();
private Boolean allowContainsSearches = HapiProperties.getAllowContainsSearches();
private Boolean allowMultipleDelete = HapiProperties.getAllowMultipleDelete();
private Boolean allowExternalReferences = HapiProperties.getAllowExternalReferences();
@@ -82,6 +85,9 @@ public class FhirServerConfigCommon {
public DaoConfig daoConfig() {
DaoConfig retVal = new DaoConfig();
retVal.setAutoCreatePlaceholderReferenceTargets(this.autoCreatePlaceholderReferenceTargets);
retVal.setEnforceReferentialIntegrityOnWrite(this.enforceReferentialIntegrityOnWrite);
retVal.setEnforceReferentialIntegrityOnDelete(this.enforceReferentialIntegrityOnDelete);
retVal.setAllowContainsSearches(this.allowContainsSearches);
retVal.setAllowMultipleDelete(this.allowMultipleDelete);
retVal.setAllowExternalReferences(this.allowExternalReferences);

View File

@@ -16,7 +16,10 @@ import java.util.stream.Collectors;
import static org.apache.commons.lang3.StringUtils.*;
public class HapiProperties {
public static final String BINARY_STORAGE_ENABLED = "binary_storage.enabled";
static final String AUTO_CREATE_PLACEHOLDER_REFERENCE_TARGETS = "auto_create_placeholder_reference_targets";
static final String ENFORCE_REFERENTIAL_INTEGRITY_ON_WRITE = "enforce_referential_integrity_on_write";
static final String ENFORCE_REFERENTIAL_INTEGRITY_ON_DELETE = "enforce_referential_integrity_on_delete";
static final String BINARY_STORAGE_ENABLED = "binary_storage.enabled";
static final String ALLOW_EXTERNAL_REFERENCES = "allow_external_references";
static final String ALLOW_MULTIPLE_DELETE = "allow_multiple_delete";
static final String ALLOW_PLACEHOLDER_REFERENCES = "allow_placeholder_references";
@@ -377,8 +380,19 @@ public class HapiProperties {
}
public static boolean getGraphqlEnabled() {
return HapiProperties.getBooleanProperty(GRAPHQL_ENABLED, true);
return HapiProperties.getBooleanProperty(GRAPHQL_ENABLED, true);
}
public static boolean getEnforceReferentialIntegrityOnDelete() {
return HapiProperties.getBooleanProperty(ENFORCE_REFERENTIAL_INTEGRITY_ON_DELETE, true);
}
public static boolean getEnforceReferentialIntegrityOnWrite() {
return HapiProperties.getBooleanProperty(ENFORCE_REFERENTIAL_INTEGRITY_ON_WRITE, true);
}
public static boolean getAutoCreatePlaceholderReferenceTargets() {
return HapiProperties.getBooleanProperty(AUTO_CREATE_PLACEHOLDER_REFERENCE_TARGETS, true);
}
}

View File

@@ -13,6 +13,9 @@ fhir_version=R4
# accessible from the server itself.
server_address=http://localhost:8080/hapi-fhir-jpaserver/fhir/
auto_create_placeholder_reference_targets=true
enforce_referential_integrity_on_write=true
enforce_referential_integrity_on_delete=true
default_encoding=JSON
etag_support=ENABLED
reuse_cached_search_results_millis=-1