use of ca.uhn.fhir.jpa.api.config.DaoConfig in project fhir-bridge by ehrbase.
the class HapiFhirJpaConfiguration method daoConfig.
@Bean
public DaoConfig daoConfig(HapiFhirJpaProperties properties) {
DaoConfig config = new DaoConfig();
config.setAllowInlineMatchUrlReferences(properties.isAllowInlineMatchUrlReferences());
config.setReuseCachedSearchResultsForMillis(null);
config.setResourceServerIdStrategy(DaoConfig.IdStrategyEnum.UUID);
return config;
}
use of ca.uhn.fhir.jpa.api.config.DaoConfig in project hapi-fhir-jpaserver-starter by hapifhir.
the class FhirServerConfigCommon method daoConfig.
/**
* Configure FHIR properties around the the JPA server via this bean
*/
@Bean
public DaoConfig daoConfig(AppProperties appProperties) {
DaoConfig retVal = new DaoConfig();
retVal.setIndexMissingFields(appProperties.getEnable_index_missing_fields() ? DaoConfig.IndexEnabledEnum.ENABLED : DaoConfig.IndexEnabledEnum.DISABLED);
retVal.setAutoCreatePlaceholderReferenceTargets(appProperties.getAuto_create_placeholder_reference_targets());
retVal.setEnforceReferentialIntegrityOnWrite(appProperties.getEnforce_referential_integrity_on_write());
retVal.setEnforceReferentialIntegrityOnDelete(appProperties.getEnforce_referential_integrity_on_delete());
retVal.setAllowContainsSearches(appProperties.getAllow_contains_searches());
retVal.setAllowMultipleDelete(appProperties.getAllow_multiple_delete());
retVal.setAllowExternalReferences(appProperties.getAllow_external_references());
retVal.setSchedulingDisabled(!appProperties.getDao_scheduling_enabled());
retVal.setDeleteExpungeEnabled(appProperties.getDelete_expunge_enabled());
retVal.setExpungeEnabled(appProperties.getExpunge_enabled());
if (appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null)
retVal.setEmailFromAddress(appProperties.getSubscription().getEmail().getFrom());
Integer maxFetchSize = appProperties.getMax_page_size();
retVal.setFetchSizeDefaultMaximum(maxFetchSize);
ourLog.info("Server configured to have a maximum fetch size of " + (maxFetchSize == Integer.MAX_VALUE ? "'unlimited'" : maxFetchSize));
Long reuseCachedSearchResultsMillis = appProperties.getReuse_cached_search_results_millis();
retVal.setReuseCachedSearchResultsForMillis(reuseCachedSearchResultsMillis);
ourLog.info("Server configured to cache search results for {} milliseconds", reuseCachedSearchResultsMillis);
Long retainCachedSearchesMinutes = appProperties.getRetain_cached_searches_mins();
retVal.setExpireSearchResultsAfterMillis(retainCachedSearchesMinutes * 60 * 1000);
if (appProperties.getSubscription() != null) {
// Subscriptions are enabled by channel type
if (appProperties.getSubscription().getResthook_enabled()) {
ourLog.info("Enabling REST-hook subscriptions");
retVal.addSupportedSubscriptionType(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.RESTHOOK);
}
if (appProperties.getSubscription().getEmail() != null) {
ourLog.info("Enabling email subscriptions");
retVal.addSupportedSubscriptionType(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.EMAIL);
}
if (appProperties.getSubscription().getWebsocket_enabled()) {
ourLog.info("Enabling websocket subscriptions");
retVal.addSupportedSubscriptionType(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.WEBSOCKET);
}
}
retVal.setFilterParameterEnabled(appProperties.getFilter_search_enabled());
retVal.setAdvancedLuceneIndexing(appProperties.getAdvanced_lucene_indexing());
retVal.setTreatBaseUrlsAsLocal(new HashSet<>(appProperties.getLocal_base_urls()));
return retVal;
}
use of ca.uhn.fhir.jpa.api.config.DaoConfig in project cqf-ruler by DBCG.
the class Server method initialize.
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
protected void initialize() throws ServletException {
super.initialize();
log.info("Loading metadata extenders from plugins");
Map<String, MetadataExtender> extenders = myApplicationContext.getBeansOfType(MetadataExtender.class);
for (MetadataExtender o : extenders.values()) {
log.info("Found {} extender", o.getClass().getName());
}
FhirVersionEnum fhirVersion = fhirSystemDao.getContext().getVersion().getVersion();
String implementationDescription = myServerProperties.getImplementation_description();
if (fhirVersion == FhirVersionEnum.DSTU2) {
List<MetadataExtender<Conformance>> extenderList = extenders.values().stream().map(x -> (MetadataExtender<Conformance>) x).collect(Collectors.toList());
ExtensibleJpaConformanceProviderDstu2 confProvider = new ExtensibleJpaConformanceProviderDstu2(this, fhirSystemDao, daoConfig, extenderList);
confProvider.setImplementationDescription(firstNonNull(implementationDescription, "CQF RULER DSTU2 Server"));
setServerConformanceProvider(confProvider);
} else {
if (fhirVersion == FhirVersionEnum.DSTU3) {
List<MetadataExtender<CapabilityStatement>> extenderList = extenders.values().stream().map(x -> (MetadataExtender<CapabilityStatement>) x).collect(Collectors.toList());
ExtensibleJpaConformanceProviderDstu3 confProvider = new ExtensibleJpaConformanceProviderDstu3(this, fhirSystemDao, daoConfig, searchParamRegistry, extenderList);
confProvider.setImplementationDescription(firstNonNull(implementationDescription, "CQF RULER DSTU3 Server"));
setServerConformanceProvider(confProvider);
} else if (fhirVersion == FhirVersionEnum.R4) {
List<MetadataExtender<IBaseConformance>> extenderList = extenders.values().stream().map(x -> (MetadataExtender<IBaseConformance>) x).collect(Collectors.toList());
ExtensibleJpaCapabilityStatementProvider confProvider = new ExtensibleJpaCapabilityStatementProvider(this, fhirSystemDao, daoConfig, searchParamRegistry, myValidationSupport, extenderList);
confProvider.setImplementationDescription(firstNonNull(implementationDescription, "CQF RULER R4 Server"));
setServerConformanceProvider(confProvider);
} else if (fhirVersion == FhirVersionEnum.R5) {
List<MetadataExtender<IBaseConformance>> extenderList = extenders.values().stream().map(x -> (MetadataExtender<IBaseConformance>) x).collect(Collectors.toList());
ExtensibleJpaCapabilityStatementProvider confProvider = new ExtensibleJpaCapabilityStatementProvider(this, fhirSystemDao, daoConfig, searchParamRegistry, myValidationSupport, extenderList);
confProvider.setImplementationDescription(firstNonNull(implementationDescription, "CQF RULER R5 Server"));
setServerConformanceProvider(confProvider);
} else {
throw new IllegalStateException();
}
}
log.info("Loading operation providers from plugins");
Map<String, OperationProvider> providers = myApplicationContext.getBeansOfType(OperationProvider.class);
for (OperationProvider o : providers.values()) {
log.info("Registering {}", o.getClass().getName());
this.registerProvider(o);
}
log.info("Loading interceptors from plugins");
Map<String, Interceptor> interceptors = myApplicationContext.getBeansOfType(Interceptor.class);
for (Interceptor o : interceptors.values()) {
log.info("Registering {} interceptor", o.getClass().getName());
this.registerInterceptor(o);
}
}
Aggregations