1
1
package ca .uhn .fhir .jpa .starter .common ;
2
2
3
- import ca .uhn .fhir .context .FhirContext ;
4
- import ca .uhn .fhir .interceptor .api .IInterceptorService ;
5
3
import ca .uhn .fhir .jpa .api .config .JpaStorageSettings ;
6
4
import ca .uhn .fhir .jpa .binary .api .IBinaryStorageSvc ;
7
5
import ca .uhn .fhir .jpa .binstore .DatabaseBinaryContentStorageSvcImpl ;
8
6
import ca .uhn .fhir .jpa .config .HibernatePropertiesProvider ;
9
- import ca .uhn .fhir .jpa .interceptor .PatientIdPartitionInterceptor ;
10
7
import ca .uhn .fhir .jpa .model .config .PartitionSettings ;
11
8
import ca .uhn .fhir .jpa .model .config .PartitionSettings .CrossPartitionReferenceMode ;
12
9
import ca .uhn .fhir .jpa .model .config .SubscriptionSettings ;
13
10
import ca .uhn .fhir .jpa .model .entity .StorageSettings ;
14
- import ca .uhn .fhir .jpa .searchparam .extractor .ISearchParamExtractor ;
15
11
import ca .uhn .fhir .jpa .starter .AppProperties ;
16
12
import ca .uhn .fhir .jpa .starter .util .JpaHibernatePropertiesProvider ;
17
13
import ca .uhn .fhir .jpa .subscription .match .deliver .email .EmailSenderImpl ;
@@ -100,31 +96,30 @@ public SubscriptionSettings subscriptionSettings(AppProperties appProperties) {
100
96
if (appProperties .getSubscription () != null ) {
101
97
if (appProperties .getSubscription ().getEmail () != null )
102
98
subscriptionSettings .setEmailFromAddress (
103
- appProperties .getSubscription ().getEmail ().getFrom ());
99
+ appProperties .getSubscription ().getEmail ().getFrom ());
104
100
105
101
// Subscriptions are enabled by channel type
106
102
if (appProperties .getSubscription ().getResthook_enabled ()) {
107
103
ourLog .info ("Enabling REST-hook subscriptions" );
108
104
subscriptionSettings .addSupportedSubscriptionType (
109
- org .hl7 .fhir .dstu2 .model .Subscription .SubscriptionChannelType .RESTHOOK );
105
+ org .hl7 .fhir .dstu2 .model .Subscription .SubscriptionChannelType .RESTHOOK );
110
106
}
111
107
if (appProperties .getSubscription ().getEmail () != null ) {
112
108
ourLog .info ("Enabling email subscriptions" );
113
109
subscriptionSettings .addSupportedSubscriptionType (
114
- org .hl7 .fhir .dstu2 .model .Subscription .SubscriptionChannelType .EMAIL );
110
+ org .hl7 .fhir .dstu2 .model .Subscription .SubscriptionChannelType .EMAIL );
115
111
}
116
112
if (appProperties .getSubscription ().getWebsocket_enabled ()) {
117
113
ourLog .info ("Enabling websocket subscriptions" );
118
114
subscriptionSettings .addSupportedSubscriptionType (
119
- org .hl7 .fhir .dstu2 .model .Subscription .SubscriptionChannelType .WEBSOCKET );
115
+ org .hl7 .fhir .dstu2 .model .Subscription .SubscriptionChannelType .WEBSOCKET );
120
116
}
121
-
122
117
}
123
118
if (appProperties .getMdm_enabled ()) {
124
119
// MDM requires the subscription of type message
125
120
ourLog .info ("Enabling message subscriptions" );
126
121
subscriptionSettings .addSupportedSubscriptionType (
127
- org .hl7 .fhir .dstu2 .model .Subscription .SubscriptionChannelType .MESSAGE );
122
+ org .hl7 .fhir .dstu2 .model .Subscription .SubscriptionChannelType .MESSAGE );
128
123
}
129
124
return subscriptionSettings ;
130
125
}
@@ -141,8 +136,7 @@ public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) {
141
136
: StorageSettings .IndexEnabledEnum .DISABLED );
142
137
jpaStorageSettings .setAutoCreatePlaceholderReferenceTargets (
143
138
appProperties .getAuto_create_placeholder_reference_targets ());
144
- jpaStorageSettings .setMassIngestionMode (
145
- appProperties .getMass_ingestion_mode_enabled ());
139
+ jpaStorageSettings .setMassIngestionMode (appProperties .getMass_ingestion_mode_enabled ());
146
140
jpaStorageSettings .setAutoVersionReferenceAtPaths (appProperties .getAuto_version_reference_at_paths ());
147
141
jpaStorageSettings .setEnforceReferentialIntegrityOnWrite (
148
142
appProperties .getEnforce_referential_integrity_on_write ());
@@ -155,7 +149,8 @@ public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) {
155
149
jpaStorageSettings .setDeleteExpungeEnabled (appProperties .getDelete_expunge_enabled ());
156
150
jpaStorageSettings .setExpungeEnabled (appProperties .getExpunge_enabled ());
157
151
jpaStorageSettings .setLanguageSearchParameterEnabled (appProperties .getLanguage_search_parameter_enabled ());
158
- jpaStorageSettings .setValidateResourceStatusForPackageUpload (appProperties .getValidate_resource_status_for_package_upload ());
152
+ jpaStorageSettings .setValidateResourceStatusForPackageUpload (
153
+ appProperties .getValidate_resource_status_for_package_upload ());
159
154
jpaStorageSettings .setIndexOnUpliftedRefchains (appProperties .getUpliftedRefchains_enabled ());
160
155
161
156
if (!appProperties .getSearch_prefetch_thresholds ().isEmpty ()) {
@@ -174,8 +169,6 @@ public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) {
174
169
Long retainCachedSearchesMinutes = appProperties .getRetain_cached_searches_mins ();
175
170
jpaStorageSettings .setExpireSearchResultsAfterMillis (retainCachedSearchesMinutes * 60 * 1000 );
176
171
177
-
178
-
179
172
jpaStorageSettings .setFilterParameterEnabled (appProperties .getFilter_search_enabled ());
180
173
jpaStorageSettings .setHibernateSearchIndexSearchParams (appProperties .getAdvanced_lucene_indexing ());
181
174
jpaStorageSettings .setTreatBaseUrlsAsLocal (new HashSet <>(appProperties .getLocal_base_urls ()));
@@ -222,8 +215,8 @@ public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) {
222
215
jpaStorageSettings .setResourceServerIdStrategy (appProperties .getServer_id_strategy ());
223
216
ourLog .info ("Server configured to use '" + appProperties .getServer_id_strategy () + "' Server ID Strategy" );
224
217
}
225
-
226
- //to Disable the Resource History
218
+
219
+ // to Disable the Resource History
227
220
jpaStorageSettings .setResourceDbHistoryEnabled (appProperties .getResource_dbhistory_enabled ());
228
221
229
222
// Parallel Batch GET execution settings
@@ -239,15 +232,15 @@ public YamlPropertySourceLoader yamlPropertySourceLoader() {
239
232
return new YamlPropertySourceLoader ();
240
233
}
241
234
242
-
243
235
@ Bean
244
236
public PartitionSettings partitionSettings (AppProperties appProperties ) {
245
237
PartitionSettings retVal = new PartitionSettings ();
246
238
247
239
// Partitioning
248
240
if (appProperties .getPartitioning () != null ) {
249
241
retVal .setPartitioningEnabled (true );
250
- boolean databasePartitionModeEnabled = defaultIfNull (appProperties .getPartitioning ().getDatabase_partition_mode_enabled (), Boolean .FALSE );
242
+ boolean databasePartitionModeEnabled =
243
+ defaultIfNull (appProperties .getPartitioning ().getDatabase_partition_mode_enabled (), Boolean .FALSE );
251
244
Integer defaultPartitionId = appProperties .getPartitioning ().getDefault_partition_id ();
252
245
if (databasePartitionModeEnabled ) {
253
246
retVal .setDatabasePartitionMode (true );
@@ -262,10 +255,9 @@ public PartitionSettings partitionSettings(AppProperties appProperties) {
262
255
retVal .setAllowReferencesAcrossPartitions (CrossPartitionReferenceMode .NOT_ALLOWED );
263
256
}
264
257
retVal .setConditionalCreateDuplicateIdentifiersEnabled (
265
- appProperties .getPartitioning ().getConditional_create_duplicate_identifiers_enabled ());
258
+ appProperties .getPartitioning ().getConditional_create_duplicate_identifiers_enabled ());
266
259
}
267
260
268
-
269
261
return retVal ;
270
262
}
271
263
@@ -274,7 +266,6 @@ public PartitionModeConfigurer partitionModeConfigurer() {
274
266
return new PartitionModeConfigurer ();
275
267
}
276
268
277
-
278
269
@ Primary
279
270
@ Bean
280
271
public HibernatePropertiesProvider jpaStarterDialectProvider (
0 commit comments