Merge branch 'master' into rel_5_4_0
This commit is contained in:
@@ -189,6 +189,13 @@ spring:
|
|||||||
password: admin
|
password: admin
|
||||||
driverClassName: com.mysql.jdbc.Driver
|
driverClassName: com.mysql.jdbc.Driver
|
||||||
```
|
```
|
||||||
|
On some systems, it might be necessary to override hibernate's default naming strategy. The naming strategy must be set using spring.jpa.hibernate.physical_naming_strategy.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
spring:
|
||||||
|
jpa:
|
||||||
|
hibernate.physical_naming_strategy: NAME_OF_PREFERRED_STRATEGY
|
||||||
|
```
|
||||||
|
|
||||||
### PostgreSQL configuration
|
### PostgreSQL configuration
|
||||||
|
|
||||||
|
|||||||
@@ -62,324 +62,326 @@ import java.util.stream.Collectors;
|
|||||||
public class BaseJpaRestfulServer extends RestfulServer {
|
public class BaseJpaRestfulServer extends RestfulServer {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Autowired
|
@Autowired
|
||||||
DaoRegistry daoRegistry;
|
DaoRegistry daoRegistry;
|
||||||
@Autowired
|
@Autowired
|
||||||
DaoConfig daoConfig;
|
DaoConfig daoConfig;
|
||||||
@Autowired
|
@Autowired
|
||||||
ISearchParamRegistry searchParamRegistry;
|
ISearchParamRegistry searchParamRegistry;
|
||||||
@Autowired
|
@Autowired
|
||||||
IFhirSystemDao fhirSystemDao;
|
IFhirSystemDao fhirSystemDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
ResourceProviderFactory resourceProviders;
|
ResourceProviderFactory resourceProviders;
|
||||||
@Autowired
|
@Autowired
|
||||||
IJpaSystemProvider jpaSystemProvider;
|
IJpaSystemProvider jpaSystemProvider;
|
||||||
@Autowired
|
@Autowired
|
||||||
IInterceptorBroadcaster interceptorBroadcaster;
|
IInterceptorBroadcaster interceptorBroadcaster;
|
||||||
@Autowired
|
@Autowired
|
||||||
DatabaseBackedPagingProvider databaseBackedPagingProvider;
|
DatabaseBackedPagingProvider databaseBackedPagingProvider;
|
||||||
@Autowired
|
@Autowired
|
||||||
IInterceptorService interceptorService;
|
IInterceptorService interceptorService;
|
||||||
@Autowired
|
@Autowired
|
||||||
IValidatorModule validatorModule;
|
IValidatorModule validatorModule;
|
||||||
@Autowired
|
@Autowired
|
||||||
Optional<GraphQLProvider> graphQLProvider;
|
Optional<GraphQLProvider> graphQLProvider;
|
||||||
@Autowired
|
@Autowired
|
||||||
BulkDataExportProvider bulkDataExportProvider;
|
BulkDataExportProvider bulkDataExportProvider;
|
||||||
@Autowired
|
@Autowired
|
||||||
PartitionManagementProvider partitionManagementProvider;
|
PartitionManagementProvider partitionManagementProvider;
|
||||||
@Autowired
|
@Autowired
|
||||||
BinaryStorageInterceptor binaryStorageInterceptor;
|
BinaryStorageInterceptor binaryStorageInterceptor;
|
||||||
@Autowired
|
@Autowired
|
||||||
IPackageInstallerSvc packageInstallerSvc;
|
IPackageInstallerSvc packageInstallerSvc;
|
||||||
@Autowired
|
@Autowired
|
||||||
AppProperties appProperties;
|
AppProperties appProperties;
|
||||||
@Autowired
|
@Autowired
|
||||||
ApplicationContext myApplicationContext;
|
ApplicationContext myApplicationContext;
|
||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
IRepositoryValidationInterceptorFactory factory;
|
IRepositoryValidationInterceptorFactory factory;
|
||||||
// These are set only if the features are enabled
|
// These are set only if the features are enabled
|
||||||
private CqlProviderLoader cqlProviderLoader;
|
private CqlProviderLoader cqlProviderLoader;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IValidationSupport myValidationSupport;
|
private IValidationSupport myValidationSupport;
|
||||||
|
|
||||||
public BaseJpaRestfulServer() {
|
public BaseJpaRestfulServer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
private static final long serialVersionUID = 1L;
|
||||||
@Override
|
|
||||||
protected void initialize() throws ServletException {
|
|
||||||
super.initialize();
|
|
||||||
|
|
||||||
/*
|
@SuppressWarnings("unchecked")
|
||||||
* Create a FhirContext object that uses the version of FHIR
|
@Override
|
||||||
* specified in the properties file.
|
protected void initialize() throws ServletException {
|
||||||
*/
|
super.initialize();
|
||||||
// Customize supported resource types
|
|
||||||
List<String> supportedResourceTypes = appProperties.getSupported_resource_types();
|
|
||||||
|
|
||||||
if (!supportedResourceTypes.isEmpty() && !supportedResourceTypes.contains("SearchParameter")) {
|
/*
|
||||||
supportedResourceTypes.add("SearchParameter");
|
* Create a FhirContext object that uses the version of FHIR
|
||||||
daoRegistry.setSupportedResourceTypes(supportedResourceTypes);
|
* specified in the properties file.
|
||||||
}
|
*/
|
||||||
|
// Customize supported resource types
|
||||||
|
List<String> supportedResourceTypes = appProperties.getSupported_resource_types();
|
||||||
|
|
||||||
setFhirContext(fhirSystemDao.getContext());
|
if (!supportedResourceTypes.isEmpty() && !supportedResourceTypes.contains("SearchParameter")) {
|
||||||
|
supportedResourceTypes.add("SearchParameter");
|
||||||
|
daoRegistry.setSupportedResourceTypes(supportedResourceTypes);
|
||||||
|
}
|
||||||
|
|
||||||
registerProviders(resourceProviders.createProviders());
|
setFhirContext(fhirSystemDao.getContext());
|
||||||
registerProvider(jpaSystemProvider);
|
|
||||||
|
|
||||||
/*
|
registerProviders(resourceProviders.createProviders());
|
||||||
* The conformance provider exports the supported resources, search parameters, etc for
|
registerProvider(jpaSystemProvider);
|
||||||
* this server. The JPA version adds resourceProviders counts to the exported statement, so it
|
|
||||||
* is a nice addition.
|
|
||||||
*
|
|
||||||
* You can also create your own subclass of the conformance provider if you need to
|
|
||||||
* provide further customization of your server's CapabilityStatement
|
|
||||||
*/
|
|
||||||
|
|
||||||
FhirVersionEnum fhirVersion = fhirSystemDao.getContext().getVersion().getVersion();
|
/*
|
||||||
if (fhirVersion == FhirVersionEnum.DSTU2) {
|
* The conformance provider exports the supported resources, search parameters, etc for
|
||||||
|
* this server. The JPA version adds resourceProviders counts to the exported statement, so it
|
||||||
|
* is a nice addition.
|
||||||
|
*
|
||||||
|
* You can also create your own subclass of the conformance provider if you need to
|
||||||
|
* provide further customization of your server's CapabilityStatement
|
||||||
|
*/
|
||||||
|
|
||||||
JpaConformanceProviderDstu2 confProvider = new JpaConformanceProviderDstu2(this, fhirSystemDao,
|
FhirVersionEnum fhirVersion = fhirSystemDao.getContext().getVersion().getVersion();
|
||||||
daoConfig);
|
if (fhirVersion == FhirVersionEnum.DSTU2) {
|
||||||
confProvider.setImplementationDescription("HAPI FHIR DSTU2 Server");
|
|
||||||
setServerConformanceProvider(confProvider);
|
|
||||||
} else {
|
|
||||||
if (fhirVersion == FhirVersionEnum.DSTU3) {
|
|
||||||
|
|
||||||
JpaConformanceProviderDstu3 confProvider = new JpaConformanceProviderDstu3(this, fhirSystemDao,
|
JpaConformanceProviderDstu2 confProvider = new JpaConformanceProviderDstu2(this, fhirSystemDao,
|
||||||
daoConfig, searchParamRegistry);
|
daoConfig);
|
||||||
confProvider.setImplementationDescription("HAPI FHIR DSTU3 Server");
|
confProvider.setImplementationDescription("HAPI FHIR DSTU2 Server");
|
||||||
setServerConformanceProvider(confProvider);
|
setServerConformanceProvider(confProvider);
|
||||||
} else if (fhirVersion == FhirVersionEnum.R4) {
|
} else {
|
||||||
|
if (fhirVersion == FhirVersionEnum.DSTU3) {
|
||||||
|
|
||||||
|
JpaConformanceProviderDstu3 confProvider = new JpaConformanceProviderDstu3(this, fhirSystemDao,
|
||||||
|
daoConfig, searchParamRegistry);
|
||||||
|
confProvider.setImplementationDescription("HAPI FHIR DSTU3 Server");
|
||||||
|
setServerConformanceProvider(confProvider);
|
||||||
|
} else if (fhirVersion == FhirVersionEnum.R4) {
|
||||||
|
|
||||||
JpaCapabilityStatementProvider confProvider = new JpaCapabilityStatementProvider(this, fhirSystemDao,
|
JpaCapabilityStatementProvider confProvider = new JpaCapabilityStatementProvider(this, fhirSystemDao,
|
||||||
daoConfig, searchParamRegistry, myValidationSupport);
|
daoConfig, searchParamRegistry, myValidationSupport);
|
||||||
confProvider.setImplementationDescription("HAPI FHIR R4 Server");
|
confProvider.setImplementationDescription("HAPI FHIR R4 Server");
|
||||||
setServerConformanceProvider(confProvider);
|
setServerConformanceProvider(confProvider);
|
||||||
} else if (fhirVersion == FhirVersionEnum.R5) {
|
} else if (fhirVersion == FhirVersionEnum.R5) {
|
||||||
|
|
||||||
JpaCapabilityStatementProvider confProvider = new JpaCapabilityStatementProvider(this, fhirSystemDao,
|
JpaCapabilityStatementProvider confProvider = new JpaCapabilityStatementProvider(this, fhirSystemDao,
|
||||||
daoConfig, searchParamRegistry, myValidationSupport);
|
daoConfig, searchParamRegistry, myValidationSupport);
|
||||||
confProvider.setImplementationDescription("HAPI FHIR R5 Server");
|
confProvider.setImplementationDescription("HAPI FHIR R5 Server");
|
||||||
setServerConformanceProvider(confProvider);
|
setServerConformanceProvider(confProvider);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ETag Support
|
* ETag Support
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (appProperties.getEtag_support_enabled() == false)
|
if (appProperties.getEtag_support_enabled() == false)
|
||||||
setETagSupport(ETagSupportEnum.DISABLED);
|
setETagSupport(ETagSupportEnum.DISABLED);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This server tries to dynamically generate narratives
|
* This server tries to dynamically generate narratives
|
||||||
*/
|
*/
|
||||||
FhirContext ctx = getFhirContext();
|
FhirContext ctx = getFhirContext();
|
||||||
INarrativeGenerator theNarrativeGenerator =
|
INarrativeGenerator theNarrativeGenerator =
|
||||||
appProperties.getNarrative_enabled() ?
|
appProperties.getNarrative_enabled() ?
|
||||||
new DefaultThymeleafNarrativeGenerator() :
|
new DefaultThymeleafNarrativeGenerator() :
|
||||||
new NullNarrativeGenerator();
|
new NullNarrativeGenerator();
|
||||||
ctx.setNarrativeGenerator(theNarrativeGenerator);
|
ctx.setNarrativeGenerator(theNarrativeGenerator);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default to JSON and pretty printing
|
* Default to JSON and pretty printing
|
||||||
*/
|
*/
|
||||||
setDefaultPrettyPrint(appProperties.getDefault_pretty_print());
|
setDefaultPrettyPrint(appProperties.getDefault_pretty_print());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default encoding
|
* Default encoding
|
||||||
*/
|
*/
|
||||||
setDefaultResponseEncoding(appProperties.getDefault_encoding());
|
setDefaultResponseEncoding(appProperties.getDefault_encoding());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This configures the server to page search results to and from
|
* This configures the server to page search results to and from
|
||||||
* the database, instead of only paging them to memory. This may mean
|
* the database, instead of only paging them to memory. This may mean
|
||||||
* a performance hit when performing searches that return lots of results,
|
* a performance hit when performing searches that return lots of results,
|
||||||
* but makes the server much more scalable.
|
* but makes the server much more scalable.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
setPagingProvider(databaseBackedPagingProvider);
|
setPagingProvider(databaseBackedPagingProvider);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This interceptor formats the output using nice colourful
|
* This interceptor formats the output using nice colourful
|
||||||
* HTML output when the request is detected to come from a
|
* HTML output when the request is detected to come from a
|
||||||
* browser.
|
* browser.
|
||||||
*/
|
*/
|
||||||
ResponseHighlighterInterceptor responseHighlighterInterceptor = new ResponseHighlighterInterceptor();
|
ResponseHighlighterInterceptor responseHighlighterInterceptor = new ResponseHighlighterInterceptor();
|
||||||
this.registerInterceptor(responseHighlighterInterceptor);
|
this.registerInterceptor(responseHighlighterInterceptor);
|
||||||
|
|
||||||
if (appProperties.getFhirpath_interceptor_enabled()) {
|
if (appProperties.getFhirpath_interceptor_enabled()) {
|
||||||
registerInterceptor(new FhirPathFilterInterceptor());
|
registerInterceptor(new FhirPathFilterInterceptor());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add some logging for each request
|
* Add some logging for each request
|
||||||
*/
|
*/
|
||||||
LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
|
LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
|
||||||
loggingInterceptor.setLoggerName(appProperties.getLogger().getName());
|
loggingInterceptor.setLoggerName(appProperties.getLogger().getName());
|
||||||
loggingInterceptor.setMessageFormat(appProperties.getLogger().getFormat());
|
loggingInterceptor.setMessageFormat(appProperties.getLogger().getFormat());
|
||||||
loggingInterceptor.setErrorMessageFormat(appProperties.getLogger().getError_format());
|
loggingInterceptor.setErrorMessageFormat(appProperties.getLogger().getError_format());
|
||||||
loggingInterceptor.setLogExceptions(appProperties.getLogger().getLog_exceptions());
|
loggingInterceptor.setLogExceptions(appProperties.getLogger().getLog_exceptions());
|
||||||
this.registerInterceptor(loggingInterceptor);
|
this.registerInterceptor(loggingInterceptor);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If you are hosting this server at a specific DNS name, the server will try to
|
* If you are hosting this server at a specific DNS name, the server will try to
|
||||||
* figure out the FHIR base URL based on what the web container tells it, but
|
* figure out the FHIR base URL based on what the web container tells it, but
|
||||||
* this doesn't always work. If you are setting links in your search bundles that
|
* this doesn't always work. If you are setting links in your search bundles that
|
||||||
* just refer to "localhost", you might want to use a server address strategy:
|
* just refer to "localhost", you might want to use a server address strategy:
|
||||||
*/
|
*/
|
||||||
String serverAddress = appProperties.getServer_address();
|
String serverAddress = appProperties.getServer_address();
|
||||||
if (!Strings.isNullOrEmpty(serverAddress)) {
|
if (!Strings.isNullOrEmpty(serverAddress)) {
|
||||||
setServerAddressStrategy(new HardcodedServerAddressStrategy(serverAddress));
|
setServerAddressStrategy(new HardcodedServerAddressStrategy(serverAddress));
|
||||||
} else if (appProperties.getUse_apache_address_strategy()) {
|
} else if (appProperties.getUse_apache_address_strategy()) {
|
||||||
boolean useHttps = appProperties.getUse_apache_address_strategy_https();
|
boolean useHttps = appProperties.getUse_apache_address_strategy_https();
|
||||||
setServerAddressStrategy(useHttps ? ApacheProxyAddressStrategy.forHttps() :
|
setServerAddressStrategy(useHttps ? ApacheProxyAddressStrategy.forHttps() :
|
||||||
ApacheProxyAddressStrategy.forHttp());
|
ApacheProxyAddressStrategy.forHttp());
|
||||||
} else {
|
} else {
|
||||||
setServerAddressStrategy(new IncomingRequestAddressStrategy());
|
setServerAddressStrategy(new IncomingRequestAddressStrategy());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If you are using DSTU3+, you may want to add a terminology uploader, which allows
|
* If you are using DSTU3+, you may want to add a terminology uploader, which allows
|
||||||
* uploading of external terminologies such as Snomed CT. Note that this uploader
|
* uploading of external terminologies such as Snomed CT. Note that this uploader
|
||||||
* does not have any security attached (any anonymous user may use it by default)
|
* does not have any security attached (any anonymous user may use it by default)
|
||||||
* so it is a potential security vulnerability. Consider using an AuthorizationInterceptor
|
* so it is a potential security vulnerability. Consider using an AuthorizationInterceptor
|
||||||
* with this feature.
|
* with this feature.
|
||||||
*/
|
*/
|
||||||
if (ctx.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) { // <-- ENABLED RIGHT NOW
|
if (ctx.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) { // <-- ENABLED RIGHT NOW
|
||||||
registerProvider(myApplicationContext.getBean(TerminologyUploaderProvider.class));
|
registerProvider(myApplicationContext.getBean(TerminologyUploaderProvider.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If you want to enable the $trigger-subscription operation to allow
|
// If you want to enable the $trigger-subscription operation to allow
|
||||||
// manual triggering of a subscription delivery, enable this provider
|
// manual triggering of a subscription delivery, enable this provider
|
||||||
if (true) { // <-- ENABLED RIGHT NOW
|
if (true) { // <-- ENABLED RIGHT NOW
|
||||||
registerProvider(myApplicationContext.getBean(SubscriptionTriggeringProvider.class));
|
registerProvider(myApplicationContext.getBean(SubscriptionTriggeringProvider.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define your CORS configuration. This is an example
|
// Define your CORS configuration. This is an example
|
||||||
// showing a typical setup. You should customize this
|
// showing a typical setup. You should customize this
|
||||||
// to your specific needs
|
// to your specific needs
|
||||||
if (appProperties.getCors() != null) {
|
if (appProperties.getCors() != null) {
|
||||||
CorsConfiguration config = new CorsConfiguration();
|
CorsConfiguration config = new CorsConfiguration();
|
||||||
config.addAllowedHeader(HttpHeaders.ORIGIN);
|
config.addAllowedHeader(HttpHeaders.ORIGIN);
|
||||||
config.addAllowedHeader(HttpHeaders.ACCEPT);
|
config.addAllowedHeader(HttpHeaders.ACCEPT);
|
||||||
config.addAllowedHeader(HttpHeaders.CONTENT_TYPE);
|
config.addAllowedHeader(HttpHeaders.CONTENT_TYPE);
|
||||||
config.addAllowedHeader(HttpHeaders.AUTHORIZATION);
|
config.addAllowedHeader(HttpHeaders.AUTHORIZATION);
|
||||||
config.addAllowedHeader(HttpHeaders.CACHE_CONTROL);
|
config.addAllowedHeader(HttpHeaders.CACHE_CONTROL);
|
||||||
config.addAllowedHeader("x-fhir-starter");
|
config.addAllowedHeader("x-fhir-starter");
|
||||||
config.addAllowedHeader("X-Requested-With");
|
config.addAllowedHeader("X-Requested-With");
|
||||||
config.addAllowedHeader("Prefer");
|
config.addAllowedHeader("Prefer");
|
||||||
List<String> allAllowedCORSOrigins = appProperties.getCors().getAllowed_origin();
|
List<String> allAllowedCORSOrigins = appProperties.getCors().getAllowed_origin();
|
||||||
allAllowedCORSOrigins.forEach(config::addAllowedOrigin);
|
allAllowedCORSOrigins.forEach(config::addAllowedOriginPattern);
|
||||||
|
|
||||||
|
|
||||||
config.addExposedHeader("Location");
|
config.addExposedHeader("Location");
|
||||||
config.addExposedHeader("Content-Location");
|
config.addExposedHeader("Content-Location");
|
||||||
config.setAllowedMethods(
|
config.setAllowedMethods(
|
||||||
Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH", "HEAD"));
|
Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH", "HEAD"));
|
||||||
config.setAllowCredentials(appProperties.getCors().getAllow_Credentials());
|
config.setAllowCredentials(appProperties.getCors().getAllow_Credentials());
|
||||||
|
|
||||||
// Create the interceptor and register it
|
// Create the interceptor and register it
|
||||||
CorsInterceptor interceptor = new CorsInterceptor(config);
|
CorsInterceptor interceptor = new CorsInterceptor(config);
|
||||||
registerInterceptor(interceptor);
|
registerInterceptor(interceptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If subscriptions are enabled, we want to register the interceptor that
|
// If subscriptions are enabled, we want to register the interceptor that
|
||||||
// will activate them and match results against them
|
// will activate them and match results against them
|
||||||
if (appProperties.getSubscription() != null) {
|
if (appProperties.getSubscription() != null) {
|
||||||
// Subscription debug logging
|
// Subscription debug logging
|
||||||
interceptorService.registerInterceptor(new SubscriptionDebugLogInterceptor());
|
interceptorService.registerInterceptor(new SubscriptionDebugLogInterceptor());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cascading deletes
|
// Cascading deletes
|
||||||
|
|
||||||
|
|
||||||
if (appProperties.getAllow_cascading_deletes()) {
|
if (appProperties.getAllow_cascading_deletes()) {
|
||||||
CascadingDeleteInterceptor cascadingDeleteInterceptor = new CascadingDeleteInterceptor(ctx,
|
CascadingDeleteInterceptor cascadingDeleteInterceptor = new CascadingDeleteInterceptor(ctx,
|
||||||
daoRegistry, interceptorBroadcaster);
|
daoRegistry, interceptorBroadcaster);
|
||||||
getInterceptorService().registerInterceptor(cascadingDeleteInterceptor);
|
getInterceptorService().registerInterceptor(cascadingDeleteInterceptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Binary Storage
|
// Binary Storage
|
||||||
if (appProperties.getBinary_storage_enabled()) {
|
if (appProperties.getBinary_storage_enabled()) {
|
||||||
getInterceptorService().registerInterceptor(binaryStorageInterceptor);
|
getInterceptorService().registerInterceptor(binaryStorageInterceptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validation
|
// Validation
|
||||||
|
|
||||||
if (validatorModule != null) {
|
if (validatorModule != null) {
|
||||||
if (appProperties.getValidation().getRequests_enabled()) {
|
if (appProperties.getValidation().getRequests_enabled()) {
|
||||||
RequestValidatingInterceptor interceptor = new RequestValidatingInterceptor();
|
RequestValidatingInterceptor interceptor = new RequestValidatingInterceptor();
|
||||||
interceptor.setFailOnSeverity(ResultSeverityEnum.ERROR);
|
interceptor.setFailOnSeverity(ResultSeverityEnum.ERROR);
|
||||||
interceptor.setValidatorModules(Collections.singletonList(validatorModule));
|
interceptor.setValidatorModules(Collections.singletonList(validatorModule));
|
||||||
registerInterceptor(interceptor);
|
registerInterceptor(interceptor);
|
||||||
}
|
}
|
||||||
if (appProperties.getValidation().getResponses_enabled()) {
|
if (appProperties.getValidation().getResponses_enabled()) {
|
||||||
ResponseValidatingInterceptor interceptor = new ResponseValidatingInterceptor();
|
ResponseValidatingInterceptor interceptor = new ResponseValidatingInterceptor();
|
||||||
interceptor.setFailOnSeverity(ResultSeverityEnum.ERROR);
|
interceptor.setFailOnSeverity(ResultSeverityEnum.ERROR);
|
||||||
interceptor.setValidatorModules(Collections.singletonList(validatorModule));
|
interceptor.setValidatorModules(Collections.singletonList(validatorModule));
|
||||||
registerInterceptor(interceptor);
|
registerInterceptor(interceptor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GraphQL
|
// GraphQL
|
||||||
if (appProperties.getGraphql_enabled()) {
|
if (appProperties.getGraphql_enabled()) {
|
||||||
if (fhirVersion.isEqualOrNewerThan(FhirVersionEnum.DSTU3)) {
|
if (fhirVersion.isEqualOrNewerThan(FhirVersionEnum.DSTU3)) {
|
||||||
registerProvider(graphQLProvider.get());
|
registerProvider(graphQLProvider.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appProperties.getAllowed_bundle_types() != null) {
|
if (appProperties.getAllowed_bundle_types() != null) {
|
||||||
daoConfig.setBundleTypesAllowedForStorage(appProperties.getAllowed_bundle_types().stream().map(BundleType::toCode).collect(Collectors.toSet()));
|
daoConfig.setBundleTypesAllowedForStorage(appProperties.getAllowed_bundle_types().stream().map(BundleType::toCode).collect(Collectors.toSet()));
|
||||||
}
|
}
|
||||||
|
|
||||||
daoConfig.setDeferIndexingForCodesystemsOfSize(appProperties.getDefer_indexing_for_codesystems_of_size());
|
daoConfig.setDeferIndexingForCodesystemsOfSize(appProperties.getDefer_indexing_for_codesystems_of_size());
|
||||||
|
|
||||||
// Bulk Export
|
// Bulk Export
|
||||||
if (appProperties.getBulk_export_enabled()) {
|
if (appProperties.getBulk_export_enabled()) {
|
||||||
registerProvider(bulkDataExportProvider);
|
registerProvider(bulkDataExportProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Partitioning
|
// Partitioning
|
||||||
if (appProperties.getPartitioning() != null) {
|
if (appProperties.getPartitioning() != null) {
|
||||||
registerInterceptor(new RequestTenantPartitionInterceptor());
|
registerInterceptor(new RequestTenantPartitionInterceptor());
|
||||||
setTenantIdentificationStrategy(new UrlBaseTenantIdentificationStrategy());
|
setTenantIdentificationStrategy(new UrlBaseTenantIdentificationStrategy());
|
||||||
registerProviders(partitionManagementProvider);
|
registerProviders(partitionManagementProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appProperties.getClient_id_strategy() == DaoConfig.ClientIdStrategyEnum.ANY) {
|
if (appProperties.getClient_id_strategy() == DaoConfig.ClientIdStrategyEnum.ANY) {
|
||||||
daoConfig.setResourceServerIdStrategy(DaoConfig.IdStrategyEnum.UUID);
|
daoConfig.setResourceServerIdStrategy(DaoConfig.IdStrategyEnum.UUID);
|
||||||
daoConfig.setResourceClientIdStrategy(appProperties.getClient_id_strategy());
|
daoConfig.setResourceClientIdStrategy(appProperties.getClient_id_strategy());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appProperties.getImplementationGuides() != null) {
|
if (appProperties.getImplementationGuides() != null) {
|
||||||
Map<String, AppProperties.ImplementationGuide> guides = appProperties.getImplementationGuides();
|
Map<String, AppProperties.ImplementationGuide> guides = appProperties.getImplementationGuides();
|
||||||
for (Map.Entry<String, AppProperties.ImplementationGuide> guide : guides.entrySet()) {
|
for (Map.Entry<String, AppProperties.ImplementationGuide> guide : guides.entrySet()) {
|
||||||
packageInstallerSvc.install(new PackageInstallationSpec()
|
packageInstallerSvc.install(new PackageInstallationSpec()
|
||||||
.setPackageUrl(guide.getValue().getUrl())
|
.setPackageUrl(guide.getValue().getUrl())
|
||||||
.setName(guide.getValue().getName())
|
.setName(guide.getValue().getName())
|
||||||
.setVersion(guide.getValue().getVersion())
|
.setVersion(guide.getValue().getVersion())
|
||||||
.setInstallMode(PackageInstallationSpec.InstallModeEnum.STORE_AND_INSTALL));
|
.setInstallMode(PackageInstallationSpec.InstallModeEnum.STORE_AND_INSTALL));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (factory != null) {
|
if(factory != null) {
|
||||||
interceptorService.registerInterceptor(factory.buildUsingStoredStructureDefinitions());
|
interceptorService.registerInterceptor(factory.buildUsingStoredStructureDefinitions());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (appProperties.getLastn_enabled()) {
|
if (appProperties.getLastn_enabled()) {
|
||||||
daoConfig.setLastNEnabled(true);
|
daoConfig.setLastNEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
daoConfig.getModelConfig().setNormalizedQuantitySearchLevel(appProperties.getNormalized_quantity_search_level());
|
daoConfig.getModelConfig().setNormalizedQuantitySearchLevel(appProperties.getNormalized_quantity_search_level());
|
||||||
|
|
||||||
daoConfig.getModelConfig().setIndexOnContainedResources(appProperties.getEnable_index_contained_resource());
|
daoConfig.getModelConfig().setIndexOnContainedResources(appProperties.getEnable_index_contained_resource());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,46 +21,42 @@ spring:
|
|||||||
# hibernate.cache.use_second_level_cache: false
|
# hibernate.cache.use_second_level_cache: false
|
||||||
# hibernate.cache.use_structured_entries: false
|
# hibernate.cache.use_structured_entries: false
|
||||||
# hibernate.cache.use_minimal_puts: false
|
# hibernate.cache.use_minimal_puts: false
|
||||||
|
### These settings will enable fulltext search with lucene
|
||||||
# These settings will enable fulltext search with lucene
|
|
||||||
# hibernate.search.enabled: true
|
# hibernate.search.enabled: true
|
||||||
# hibernate.search.backend.type: lucene
|
# hibernate.search.backend.type: lucene
|
||||||
# hibernate.search.backend.analysis.configurer: ca.uhn.fhir.jpa.search.HapiLuceneAnalysisConfigurer
|
# hibernate.search.backend.analysis.configurer: ca.uhn.fhir.jpa.search.HapiLuceneAnalysisConfigurer
|
||||||
# hibernate.search.backend.directory.type: local-filesystem
|
# hibernate.search.backend.directory.type: local-filesystem
|
||||||
# hibernate.search.backend.directory.root: target/lucenefiles
|
# hibernate.search.backend.directory.root: target/lucenefiles
|
||||||
# hibernate.search.backend.lucene_version: lucene_current
|
# hibernate.search.backend.lucene_version: lucene_current
|
||||||
|
|
||||||
batch:
|
batch:
|
||||||
job:
|
job:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
hapi:
|
hapi:
|
||||||
fhir:
|
fhir:
|
||||||
### enable to use the ApacheProxyAddressStrategy which uses X-Forwarded-* headers
|
|
||||||
### to determine the FHIR server address
|
|
||||||
# use_apache_address_strategy: false
|
|
||||||
### forces the use of the https:// protocol for the returned server address.
|
|
||||||
### alternatively, it may be set using the X-Forwarded-Proto header.
|
|
||||||
# use_apache_address_strategy_https: false
|
|
||||||
### enable to set the Server URL
|
|
||||||
# server_address: http://hapi.fhir.org/baseR4
|
|
||||||
### This is the FHIR version. Choose between, DSTU2, DSTU3, R4 or R5
|
### This is the FHIR version. Choose between, DSTU2, DSTU3, R4 or R5
|
||||||
fhir_version: R4
|
fhir_version: R4
|
||||||
|
### enable to use the ApacheProxyAddressStrategy which uses X-Forwarded-* headers
|
||||||
|
### to determine the FHIR server address
|
||||||
|
# use_apache_address_strategy: false
|
||||||
|
### forces the use of the https:// protocol for the returned server address.
|
||||||
|
### alternatively, it may be set using the X-Forwarded-Proto header.
|
||||||
|
# use_apache_address_strategy_https: false
|
||||||
|
### enable to set the Server URL
|
||||||
|
# server_address: http://hapi.fhir.org/baseR4
|
||||||
# defer_indexing_for_codesystems_of_size: 101
|
# defer_indexing_for_codesystems_of_size: 101
|
||||||
#implementationguides:
|
# implementationguides:
|
||||||
#example from registry (packages.fhir.org)
|
### example from registry (packages.fhir.org)
|
||||||
#swiss:
|
# swiss:
|
||||||
#name: swiss.mednet.fhir
|
# name: swiss.mednet.fhir
|
||||||
#version: 0.8.0
|
# version: 0.8.0
|
||||||
#example not from registry
|
# example not from registry
|
||||||
#ips_1_0_0:
|
# ips_1_0_0:
|
||||||
#url: https://build.fhir.org/ig/HL7/fhir-ips/package.tgz
|
# url: https://build.fhir.org/ig/HL7/fhir-ips/package.tgz
|
||||||
#name: hl7.fhir.uv.ips
|
# name: hl7.fhir.uv.ips
|
||||||
#version: 1.0.0
|
# version: 1.0.0
|
||||||
|
# supported_resource_types:
|
||||||
#supported_resource_types:
|
# - Patient
|
||||||
# - Patient
|
# - Observation
|
||||||
# - Observation
|
|
||||||
# allow_cascading_deletes: true
|
# allow_cascading_deletes: true
|
||||||
# allow_contains_searches: true
|
# allow_contains_searches: true
|
||||||
# allow_external_references: true
|
# allow_external_references: true
|
||||||
@@ -80,19 +76,19 @@ hapi:
|
|||||||
# etag_support_enabled: true
|
# etag_support_enabled: true
|
||||||
# expunge_enabled: true
|
# expunge_enabled: true
|
||||||
# daoconfig_client_id_strategy: null
|
# daoconfig_client_id_strategy: null
|
||||||
|
# client_id_strategy: ALPHANUMERIC
|
||||||
# fhirpath_interceptor_enabled: false
|
# fhirpath_interceptor_enabled: false
|
||||||
# filter_search_enabled: true
|
# filter_search_enabled: true
|
||||||
# graphql_enabled: true
|
# graphql_enabled: true
|
||||||
# narrative_enabled: true
|
# narrative_enabled: true
|
||||||
#partitioning:
|
# partitioning:
|
||||||
# allow_references_across_partitions: false
|
# allow_references_across_partitions: false
|
||||||
# partitioning_include_in_search_hashes: false
|
# partitioning_include_in_search_hashes: false
|
||||||
#cors:
|
cors:
|
||||||
# allow_Credentials: true
|
allow_Credentials: true
|
||||||
# Supports multiple, comma separated allowed origin entries
|
# These are allowed_origin patterns, see: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/cors/CorsConfiguration.html#setAllowedOriginPatterns-java.util.List-
|
||||||
# cors.allowed_origin=http://localhost:8080,https://localhost:8080,https://fhirtest.uhn.ca
|
allowed_origin:
|
||||||
# allowed_origin:
|
- '*'
|
||||||
# - '*'
|
|
||||||
|
|
||||||
# Search coordinator thread pool sizes
|
# Search coordinator thread pool sizes
|
||||||
search-coord-core-pool-size: 20
|
search-coord-core-pool-size: 20
|
||||||
@@ -113,13 +109,11 @@ hapi:
|
|||||||
# retain_cached_searches_mins: 60
|
# retain_cached_searches_mins: 60
|
||||||
# reuse_cached_search_results_millis: 60000
|
# reuse_cached_search_results_millis: 60000
|
||||||
tester:
|
tester:
|
||||||
|
|
||||||
home:
|
home:
|
||||||
name: Local Tester
|
name: Local Tester
|
||||||
server_address: 'http://localhost:8080/fhir'
|
server_address: 'http://localhost:8080/fhir'
|
||||||
refuse_to_fetch_third_party_urls: false
|
refuse_to_fetch_third_party_urls: false
|
||||||
fhir_version: R4
|
fhir_version: R4
|
||||||
|
|
||||||
global:
|
global:
|
||||||
name: Global Tester
|
name: Global Tester
|
||||||
server_address: "http://hapi.fhir.org/baseR4"
|
server_address: "http://hapi.fhir.org/baseR4"
|
||||||
@@ -144,14 +138,11 @@ hapi:
|
|||||||
# startTlsRequired:
|
# startTlsRequired:
|
||||||
# quitWait:
|
# quitWait:
|
||||||
# lastn_enabled: true
|
# lastn_enabled: true
|
||||||
### This is configuration for normalized quantity serach level default is 0
|
### This is configuration for normalized quantity serach level default is 0
|
||||||
### 0: NORMALIZED_QUANTITY_SEARCH_NOT_SUPPORTED - default
|
### 0: NORMALIZED_QUANTITY_SEARCH_NOT_SUPPORTED - default
|
||||||
### 1: NORMALIZED_QUANTITY_STORAGE_SUPPORTED
|
### 1: NORMALIZED_QUANTITY_STORAGE_SUPPORTED
|
||||||
### 2: NORMALIZED_QUANTITY_SEARCH_SUPPORTED
|
### 2: NORMALIZED_QUANTITY_SEARCH_SUPPORTED
|
||||||
# normalized_quantity_search_level: 2
|
# normalized_quantity_search_level: 2
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
#elasticsearch:
|
#elasticsearch:
|
||||||
# debug:
|
# debug:
|
||||||
# pretty_print_json_log: false
|
# pretty_print_json_log: false
|
||||||
|
|||||||
Reference in New Issue
Block a user