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