Skip to content

Commit 792f520

Browse files
authored
Merge pull request #758 from hapifhir/rel_7_8_tracking
Update to HAPI 8.0.0
2 parents 98bfad0 + f87f2e8 commit 792f520

13 files changed

+380
-166
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<groupId>ca.uhn.hapi.fhir</groupId>
1616
<artifactId>hapi-fhir</artifactId>
17-
<version>7.6.0</version>
17+
<version>8.0.0</version>
1818
</parent>
1919

2020
<artifactId>hapi-fhir-jpaserver-starter</artifactId>

src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java

Lines changed: 79 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
@EnableConfigurationProperties
2424
public class AppProperties {
2525

26+
private final Set<String> auto_version_reference_at_paths = new HashSet<>();
27+
private final Set<String> local_base_urls = new HashSet<>();
28+
private final Set<String> logical_urls = new HashSet<>();
29+
private final List<String> custom_interceptor_classes = new ArrayList<>();
30+
private final List<String> custom_provider_classes = new ArrayList<>();
2631
private Boolean cr_enabled = false;
2732
private Boolean ips_enabled = false;
2833
private Boolean openapi_enabled = false;
@@ -37,7 +42,6 @@ public class AppProperties {
3742
private Boolean allow_override_default_search_params = true;
3843
private Boolean auto_create_placeholder_reference_targets = false;
3944
private Boolean mass_ingestion_mode_enabled = false;
40-
private final Set<String> auto_version_reference_at_paths = new HashSet<>();
4145
private Boolean language_search_parameter_enabled = false;
4246
private Boolean dao_scheduling_enabled = true;
4347
private Boolean delete_expunge_enabled = false;
@@ -70,9 +74,7 @@ public class AppProperties {
7074
private List<String> supported_resource_types = new ArrayList<>();
7175
private List<Bundle.BundleType> allowed_bundle_types = null;
7276
private Boolean narrative_enabled = true;
73-
7477
private Boolean ig_runtime_upload_enabled = false;
75-
7678
private Validation validation = new Validation();
7779
private Map<String, Tester> tester = null;
7880
private Logger logger = new Logger();
@@ -82,28 +84,17 @@ public class AppProperties {
8284
private Boolean validate_resource_status_for_package_upload = true;
8385
private Boolean install_transitive_ig_dependencies = true;
8486
private Map<String, PackageInstallationSpec> implementationGuides = null;
85-
8687
private String custom_content_path = null;
8788
private String app_content_path = null;
88-
8989
private Boolean lastn_enabled = false;
9090
private boolean store_resource_in_lucene_index_enabled = false;
9191
private NormalizedQuantitySearchLevel normalized_quantity_search_level =
9292
NormalizedQuantitySearchLevel.NORMALIZED_QUANTITY_SEARCH_NOT_SUPPORTED;
93-
9493
private Boolean use_apache_address_strategy = false;
9594
private Boolean use_apache_address_strategy_https = false;
96-
9795
private Integer bundle_batch_pool_size = 20;
9896
private Integer bundle_batch_pool_max_size = 100;
99-
private final Set<String> local_base_urls = new HashSet<>();
100-
private final Set<String> logical_urls = new HashSet<>();
101-
10297
private Boolean resource_dbhistory_enabled = true;
103-
104-
private final List<String> custom_interceptor_classes = new ArrayList<>();
105-
106-
private final List<String> custom_provider_classes = new ArrayList<>();
10798
private Boolean upliftedRefchains_enabled = false;
10899

109100
private boolean userRequestRetryVersionConflictsInterceptorEnabled = false;
@@ -226,6 +217,10 @@ public Subscription getSubscription() {
226217
return subscription;
227218
}
228219

220+
public void setSubscription(Subscription subscription) {
221+
this.subscription = subscription;
222+
}
223+
229224
public Boolean getDefault_pretty_print() {
230225
return default_pretty_print;
231226
}
@@ -234,10 +229,6 @@ public void setDefault_pretty_print(Boolean default_pretty_print) {
234229
this.default_pretty_print = default_pretty_print;
235230
}
236231

237-
public void setSubscription(Subscription subscription) {
238-
this.subscription = subscription;
239-
}
240-
241232
public Validation getValidation() {
242233
return validation;
243234
}
@@ -671,6 +662,22 @@ public void setUserRequestRetryVersionConflictsInterceptorEnabled(
671662
this.userRequestRetryVersionConflictsInterceptorEnabled = userRequestRetryVersionConflictsInterceptorEnabled;
672663
}
673664

665+
public boolean getEnable_index_of_type() {
666+
return enable_index_of_type;
667+
}
668+
669+
public void setEnable_index_of_type(boolean enable_index_of_type) {
670+
this.enable_index_of_type = enable_index_of_type;
671+
}
672+
673+
public Boolean getResource_dbhistory_enabled() {
674+
return resource_dbhistory_enabled;
675+
}
676+
677+
public void setResource_dbhistory_enabled(Boolean resource_dbhistory_enabled) {
678+
this.resource_dbhistory_enabled = resource_dbhistory_enabled;
679+
}
680+
674681
public static class Cors {
675682
private Boolean allow_Credentials = true;
676683
private List<String> allowed_origin = List.of("*");
@@ -800,6 +807,38 @@ public static class Partitioning {
800807
private Boolean partitioning_include_in_search_hashes = false;
801808
private Boolean allow_references_across_partitions = false;
802809
private Boolean conditional_create_duplicate_identifiers_enabled = false;
810+
private Boolean database_partition_mode_enabled = false;
811+
private Boolean patient_id_partitioning_mode = false;
812+
private Integer default_partition_id = 0;
813+
private boolean request_tenant_partitioning_mode;
814+
815+
public boolean isRequest_tenant_partitioning_mode() {
816+
return request_tenant_partitioning_mode;
817+
}
818+
819+
public Integer getDefault_partition_id() {
820+
return default_partition_id;
821+
}
822+
823+
public void setDefault_partition_id(Integer theDefault_partition_id) {
824+
default_partition_id = theDefault_partition_id;
825+
}
826+
827+
public Boolean getDatabase_partition_mode_enabled() {
828+
return database_partition_mode_enabled;
829+
}
830+
831+
public void setDatabase_partition_mode_enabled(Boolean theDatabase_partition_mode_enabled) {
832+
database_partition_mode_enabled = theDatabase_partition_mode_enabled;
833+
}
834+
835+
public Boolean getPatient_id_partitioning_mode() {
836+
return patient_id_partitioning_mode;
837+
}
838+
839+
public void setPatient_id_partitioning_mode(Boolean thePatient_id_partitioning_mode) {
840+
patient_id_partitioning_mode = thePatient_id_partitioning_mode;
841+
}
803842

804843
public Boolean getPartitioning_include_in_search_hashes() {
805844
return partitioning_include_in_search_hashes;
@@ -825,10 +864,22 @@ public void setConditional_create_duplicate_identifiers_enabled(
825864
Boolean conditional_create_duplicate_identifiers_enabled) {
826865
this.conditional_create_duplicate_identifiers_enabled = conditional_create_duplicate_identifiers_enabled;
827866
}
867+
868+
public boolean getRequest_tenant_partitioning_mode() {
869+
return request_tenant_partitioning_mode;
870+
}
871+
872+
public void setRequest_tenant_partitioning_mode(boolean theRequest_tenant_partitioning_mode) {
873+
request_tenant_partitioning_mode = theRequest_tenant_partitioning_mode;
874+
}
828875
}
829876

830877
public static class Subscription {
831878

879+
private Boolean resthook_enabled = false;
880+
private Boolean websocket_enabled = false;
881+
private Email email = null;
882+
832883
public Boolean getResthook_enabled() {
833884
return resthook_enabled;
834885
}
@@ -845,10 +896,6 @@ public void setWebsocket_enabled(Boolean websocket_enabled) {
845896
this.websocket_enabled = websocket_enabled;
846897
}
847898

848-
private Boolean resthook_enabled = false;
849-
private Boolean websocket_enabled = false;
850-
private Email email = null;
851-
852899
public Email getEmail() {
853900
return email;
854901
}
@@ -858,6 +905,16 @@ public void setEmail(Email email) {
858905
}
859906

860907
public static class Email {
908+
private String from;
909+
private String host;
910+
private Integer port = 25;
911+
private String username;
912+
private String password;
913+
private Boolean auth = false;
914+
private Boolean startTlsEnable = false;
915+
private Boolean startTlsRequired = false;
916+
private Boolean quitWait = false;
917+
861918
public String getFrom() {
862919
return from;
863920
}
@@ -929,32 +986,6 @@ public Boolean getQuitWait() {
929986
public void setQuitWait(Boolean quitWait) {
930987
this.quitWait = quitWait;
931988
}
932-
933-
private String from;
934-
private String host;
935-
private Integer port = 25;
936-
private String username;
937-
private String password;
938-
private Boolean auth = false;
939-
private Boolean startTlsEnable = false;
940-
private Boolean startTlsRequired = false;
941-
private Boolean quitWait = false;
942989
}
943990
}
944-
945-
public boolean getEnable_index_of_type() {
946-
return enable_index_of_type;
947-
}
948-
949-
public void setEnable_index_of_type(boolean enable_index_of_type) {
950-
this.enable_index_of_type = enable_index_of_type;
951-
}
952-
953-
public Boolean getResource_dbhistory_enabled() {
954-
return resource_dbhistory_enabled;
955-
}
956-
957-
public void setResource_dbhistory_enabled(Boolean resource_dbhistory_enabled) {
958-
this.resource_dbhistory_enabled = resource_dbhistory_enabled;
959-
}
960991
}

src/main/java/ca/uhn/fhir/jpa/starter/cdshooks/CdsHooksRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package ca.uhn.fhir.jpa.starter.cdshooks;
22

3-
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
3+
import ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson;
44
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
55

66
@JsonIgnoreProperties({"extension"})

src/main/java/ca/uhn/fhir/jpa/starter/cdshooks/CdsHooksServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package ca.uhn.fhir.jpa.starter.cdshooks;
22

33
import ca.uhn.fhir.jpa.starter.AppProperties;
4+
import ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson;
45
import ca.uhn.fhir.rest.server.RestfulServer;
56
import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
67
import ca.uhn.hapi.fhir.cdshooks.api.ICdsServiceRegistry;
7-
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
88
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceResponseJson;
99
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServicesJson;
1010
import com.fasterxml.jackson.databind.ObjectMapper;

src/main/java/ca/uhn/fhir/jpa/starter/cdshooks/ModuleConfigurationPrefetchSvc.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import ca.uhn.fhir.context.FhirContext;
44
import ca.uhn.fhir.i18n.Msg;
5+
import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster;
6+
import ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestAuthorizationJson;
7+
import ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson;
58
import ca.uhn.fhir.rest.client.api.IClientInterceptor;
69
import ca.uhn.fhir.rest.client.api.IGenericClient;
710
import ca.uhn.fhir.rest.client.interceptor.BearerTokenAuthInterceptor;
@@ -11,8 +14,6 @@
1114
import ca.uhn.hapi.fhir.cdshooks.api.ICdsHooksDaoAuthorizationSvc;
1215
import ca.uhn.hapi.fhir.cdshooks.api.ICdsServiceMethod;
1316
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceJson;
14-
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestAuthorizationJson;
15-
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
1617
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchDaoSvc;
1718
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchFhirClientSvc;
1819
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchSvc;
@@ -72,12 +73,14 @@ public ModuleConfigurationPrefetchSvc(
7273
CdsResolutionStrategySvc theCdsResolutionStrategySvc,
7374
CdsPrefetchDaoSvc theResourcePrefetchDao,
7475
CdsPrefetchFhirClientSvc theResourcePrefetchFhirClient,
75-
ICdsHooksDaoAuthorizationSvc theCdsHooksDaoAuthorizationSvc) {
76+
ICdsHooksDaoAuthorizationSvc theCdsHooksDaoAuthorizationSvc,
77+
IInterceptorBroadcaster theInterceptorBroadcaster) {
7678
super(
7779
theCdsResolutionStrategySvc,
7880
theResourcePrefetchDao,
7981
theResourcePrefetchFhirClient,
80-
theCdsHooksDaoAuthorizationSvc);
82+
theCdsHooksDaoAuthorizationSvc,
83+
theInterceptorBroadcaster);
8184
myResourcePrefetchFhirClient = theResourcePrefetchFhirClient;
8285
fhirContext = theResourcePrefetchDao.getFhirContext();
8386
}

src/main/java/ca/uhn/fhir/jpa/starter/cdshooks/UpdatedCdsCrServiceR4.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package ca.uhn.fhir.jpa.starter.cdshooks;
22

33
import ca.uhn.fhir.rest.api.server.RequestDetails;
4+
import ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson;
45
import ca.uhn.hapi.fhir.cdshooks.api.ICdsConfigService;
5-
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
66
import ca.uhn.hapi.fhir.cdshooks.svc.cr.CdsCrServiceR4;
77
import org.hl7.fhir.r4.model.BooleanType;
88
import org.hl7.fhir.r4.model.Parameters;

src/main/java/ca/uhn/fhir/jpa/starter/common/FhirServerConfigCommon.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import java.util.HashSet;
2828
import java.util.stream.Collectors;
2929

30+
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
31+
3032
/**
3133
* This is the primary configuration file for the example server
3234
*/
@@ -168,7 +170,7 @@ public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) {
168170
jpaStorageSettings.setExpireSearchResultsAfterMillis(retainCachedSearchesMinutes * 60 * 1000);
169171

170172
jpaStorageSettings.setFilterParameterEnabled(appProperties.getFilter_search_enabled());
171-
jpaStorageSettings.setAdvancedHSearchIndexing(appProperties.getAdvanced_lucene_indexing());
173+
jpaStorageSettings.setHibernateSearchIndexSearchParams(appProperties.getAdvanced_lucene_indexing());
172174
jpaStorageSettings.setTreatBaseUrlsAsLocal(new HashSet<>(appProperties.getLocal_base_urls()));
173175
jpaStorageSettings.setTreatReferencesAsLogical(new HashSet<>(appProperties.getLogical_urls()));
174176

@@ -237,6 +239,14 @@ public PartitionSettings partitionSettings(AppProperties appProperties) {
237239
// Partitioning
238240
if (appProperties.getPartitioning() != null) {
239241
retVal.setPartitioningEnabled(true);
242+
boolean databasePartitionModeEnabled =
243+
defaultIfNull(appProperties.getPartitioning().getDatabase_partition_mode_enabled(), Boolean.FALSE);
244+
Integer defaultPartitionId = appProperties.getPartitioning().getDefault_partition_id();
245+
if (databasePartitionModeEnabled) {
246+
retVal.setDatabasePartitionMode(true);
247+
defaultPartitionId = defaultIfNull(defaultPartitionId, 0);
248+
}
249+
retVal.setDefaultPartitionId(defaultPartitionId);
240250
retVal.setIncludePartitionInSearchHashes(
241251
appProperties.getPartitioning().getPartitioning_include_in_search_hashes());
242252
if (appProperties.getPartitioning().getAllow_references_across_partitions()) {
@@ -251,6 +261,11 @@ public PartitionSettings partitionSettings(AppProperties appProperties) {
251261
return retVal;
252262
}
253263

264+
@Bean
265+
public PartitionModeConfigurer partitionModeConfigurer() {
266+
return new PartitionModeConfigurer();
267+
}
268+
254269
@Primary
255270
@Bean
256271
public HibernatePropertiesProvider jpaStarterDialectProvider(

0 commit comments

Comments
 (0)