Skip to content

Commit

Permalink
Merge pull request #758 from hapifhir/rel_7_8_tracking
Browse files Browse the repository at this point in the history
Update to HAPI 8.0.0
  • Loading branch information
dotasek authored Feb 24, 2025
2 parents 98bfad0 + f87f2e8 commit 792f520
Show file tree
Hide file tree
Showing 13 changed files with 380 additions and 166 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.6.0</version>
<version>8.0.0</version>
</parent>

<artifactId>hapi-fhir-jpaserver-starter</artifactId>
Expand Down
127 changes: 79 additions & 48 deletions src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
@EnableConfigurationProperties
public class AppProperties {

private final Set<String> auto_version_reference_at_paths = new HashSet<>();
private final Set<String> local_base_urls = new HashSet<>();
private final Set<String> logical_urls = new HashSet<>();
private final List<String> custom_interceptor_classes = new ArrayList<>();
private final List<String> custom_provider_classes = new ArrayList<>();
private Boolean cr_enabled = false;
private Boolean ips_enabled = false;
private Boolean openapi_enabled = false;
Expand All @@ -37,7 +42,6 @@ public class AppProperties {
private Boolean allow_override_default_search_params = true;
private Boolean auto_create_placeholder_reference_targets = false;
private Boolean mass_ingestion_mode_enabled = false;
private final Set<String> auto_version_reference_at_paths = new HashSet<>();
private Boolean language_search_parameter_enabled = false;
private Boolean dao_scheduling_enabled = true;
private Boolean delete_expunge_enabled = false;
Expand Down Expand Up @@ -70,9 +74,7 @@ public class AppProperties {
private List<String> supported_resource_types = new ArrayList<>();
private List<Bundle.BundleType> allowed_bundle_types = null;
private Boolean narrative_enabled = true;

private Boolean ig_runtime_upload_enabled = false;

private Validation validation = new Validation();
private Map<String, Tester> tester = null;
private Logger logger = new Logger();
Expand All @@ -82,28 +84,17 @@ public class AppProperties {
private Boolean validate_resource_status_for_package_upload = true;
private Boolean install_transitive_ig_dependencies = true;
private Map<String, PackageInstallationSpec> implementationGuides = null;

private String custom_content_path = null;
private String app_content_path = null;

private Boolean lastn_enabled = false;
private boolean store_resource_in_lucene_index_enabled = false;
private NormalizedQuantitySearchLevel normalized_quantity_search_level =
NormalizedQuantitySearchLevel.NORMALIZED_QUANTITY_SEARCH_NOT_SUPPORTED;

private Boolean use_apache_address_strategy = false;
private Boolean use_apache_address_strategy_https = false;

private Integer bundle_batch_pool_size = 20;
private Integer bundle_batch_pool_max_size = 100;
private final Set<String> local_base_urls = new HashSet<>();
private final Set<String> logical_urls = new HashSet<>();

private Boolean resource_dbhistory_enabled = true;

private final List<String> custom_interceptor_classes = new ArrayList<>();

private final List<String> custom_provider_classes = new ArrayList<>();
private Boolean upliftedRefchains_enabled = false;

private boolean userRequestRetryVersionConflictsInterceptorEnabled = false;
Expand Down Expand Up @@ -226,6 +217,10 @@ public Subscription getSubscription() {
return subscription;
}

public void setSubscription(Subscription subscription) {
this.subscription = subscription;
}

public Boolean getDefault_pretty_print() {
return default_pretty_print;
}
Expand All @@ -234,10 +229,6 @@ public void setDefault_pretty_print(Boolean default_pretty_print) {
this.default_pretty_print = default_pretty_print;
}

public void setSubscription(Subscription subscription) {
this.subscription = subscription;
}

public Validation getValidation() {
return validation;
}
Expand Down Expand Up @@ -671,6 +662,22 @@ public void setUserRequestRetryVersionConflictsInterceptorEnabled(
this.userRequestRetryVersionConflictsInterceptorEnabled = userRequestRetryVersionConflictsInterceptorEnabled;
}

public boolean getEnable_index_of_type() {
return enable_index_of_type;
}

public void setEnable_index_of_type(boolean enable_index_of_type) {
this.enable_index_of_type = enable_index_of_type;
}

public Boolean getResource_dbhistory_enabled() {
return resource_dbhistory_enabled;
}

public void setResource_dbhistory_enabled(Boolean resource_dbhistory_enabled) {
this.resource_dbhistory_enabled = resource_dbhistory_enabled;
}

public static class Cors {
private Boolean allow_Credentials = true;
private List<String> allowed_origin = List.of("*");
Expand Down Expand Up @@ -800,6 +807,38 @@ public static class Partitioning {
private Boolean partitioning_include_in_search_hashes = false;
private Boolean allow_references_across_partitions = false;
private Boolean conditional_create_duplicate_identifiers_enabled = false;
private Boolean database_partition_mode_enabled = false;
private Boolean patient_id_partitioning_mode = false;
private Integer default_partition_id = 0;
private boolean request_tenant_partitioning_mode;

public boolean isRequest_tenant_partitioning_mode() {
return request_tenant_partitioning_mode;
}

public Integer getDefault_partition_id() {
return default_partition_id;
}

public void setDefault_partition_id(Integer theDefault_partition_id) {
default_partition_id = theDefault_partition_id;
}

public Boolean getDatabase_partition_mode_enabled() {
return database_partition_mode_enabled;
}

public void setDatabase_partition_mode_enabled(Boolean theDatabase_partition_mode_enabled) {
database_partition_mode_enabled = theDatabase_partition_mode_enabled;
}

public Boolean getPatient_id_partitioning_mode() {
return patient_id_partitioning_mode;
}

public void setPatient_id_partitioning_mode(Boolean thePatient_id_partitioning_mode) {
patient_id_partitioning_mode = thePatient_id_partitioning_mode;
}

public Boolean getPartitioning_include_in_search_hashes() {
return partitioning_include_in_search_hashes;
Expand All @@ -825,10 +864,22 @@ public void setConditional_create_duplicate_identifiers_enabled(
Boolean conditional_create_duplicate_identifiers_enabled) {
this.conditional_create_duplicate_identifiers_enabled = conditional_create_duplicate_identifiers_enabled;
}

public boolean getRequest_tenant_partitioning_mode() {
return request_tenant_partitioning_mode;
}

public void setRequest_tenant_partitioning_mode(boolean theRequest_tenant_partitioning_mode) {
request_tenant_partitioning_mode = theRequest_tenant_partitioning_mode;
}
}

public static class Subscription {

private Boolean resthook_enabled = false;
private Boolean websocket_enabled = false;
private Email email = null;

public Boolean getResthook_enabled() {
return resthook_enabled;
}
Expand All @@ -845,10 +896,6 @@ public void setWebsocket_enabled(Boolean websocket_enabled) {
this.websocket_enabled = websocket_enabled;
}

private Boolean resthook_enabled = false;
private Boolean websocket_enabled = false;
private Email email = null;

public Email getEmail() {
return email;
}
Expand All @@ -858,6 +905,16 @@ public void setEmail(Email email) {
}

public static class Email {
private String from;
private String host;
private Integer port = 25;
private String username;
private String password;
private Boolean auth = false;
private Boolean startTlsEnable = false;
private Boolean startTlsRequired = false;
private Boolean quitWait = false;

public String getFrom() {
return from;
}
Expand Down Expand Up @@ -929,32 +986,6 @@ public Boolean getQuitWait() {
public void setQuitWait(Boolean quitWait) {
this.quitWait = quitWait;
}

private String from;
private String host;
private Integer port = 25;
private String username;
private String password;
private Boolean auth = false;
private Boolean startTlsEnable = false;
private Boolean startTlsRequired = false;
private Boolean quitWait = false;
}
}

public boolean getEnable_index_of_type() {
return enable_index_of_type;
}

public void setEnable_index_of_type(boolean enable_index_of_type) {
this.enable_index_of_type = enable_index_of_type;
}

public Boolean getResource_dbhistory_enabled() {
return resource_dbhistory_enabled;
}

public void setResource_dbhistory_enabled(Boolean resource_dbhistory_enabled) {
this.resource_dbhistory_enabled = resource_dbhistory_enabled;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ca.uhn.fhir.jpa.starter.cdshooks;

import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
import ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties({"extension"})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package ca.uhn.fhir.jpa.starter.cdshooks;

import ca.uhn.fhir.jpa.starter.AppProperties;
import ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson;
import ca.uhn.fhir.rest.server.RestfulServer;
import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
import ca.uhn.hapi.fhir.cdshooks.api.ICdsServiceRegistry;
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceResponseJson;
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServicesJson;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster;
import ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestAuthorizationJson;
import ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson;
import ca.uhn.fhir.rest.client.api.IClientInterceptor;
import ca.uhn.fhir.rest.client.api.IGenericClient;
import ca.uhn.fhir.rest.client.interceptor.BearerTokenAuthInterceptor;
Expand All @@ -11,8 +14,6 @@
import ca.uhn.hapi.fhir.cdshooks.api.ICdsHooksDaoAuthorizationSvc;
import ca.uhn.hapi.fhir.cdshooks.api.ICdsServiceMethod;
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceJson;
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestAuthorizationJson;
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchDaoSvc;
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchFhirClientSvc;
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchSvc;
Expand Down Expand Up @@ -72,12 +73,14 @@ public ModuleConfigurationPrefetchSvc(
CdsResolutionStrategySvc theCdsResolutionStrategySvc,
CdsPrefetchDaoSvc theResourcePrefetchDao,
CdsPrefetchFhirClientSvc theResourcePrefetchFhirClient,
ICdsHooksDaoAuthorizationSvc theCdsHooksDaoAuthorizationSvc) {
ICdsHooksDaoAuthorizationSvc theCdsHooksDaoAuthorizationSvc,
IInterceptorBroadcaster theInterceptorBroadcaster) {
super(
theCdsResolutionStrategySvc,
theResourcePrefetchDao,
theResourcePrefetchFhirClient,
theCdsHooksDaoAuthorizationSvc);
theCdsHooksDaoAuthorizationSvc,
theInterceptorBroadcaster);
myResourcePrefetchFhirClient = theResourcePrefetchFhirClient;
fhirContext = theResourcePrefetchDao.getFhirContext();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ca.uhn.fhir.jpa.starter.cdshooks;

import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson;
import ca.uhn.hapi.fhir.cdshooks.api.ICdsConfigService;
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
import ca.uhn.hapi.fhir.cdshooks.svc.cr.CdsCrServiceR4;
import org.hl7.fhir.r4.model.BooleanType;
import org.hl7.fhir.r4.model.Parameters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import java.util.HashSet;
import java.util.stream.Collectors;

import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;

/**
* This is the primary configuration file for the example server
*/
Expand Down Expand Up @@ -168,7 +170,7 @@ public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) {
jpaStorageSettings.setExpireSearchResultsAfterMillis(retainCachedSearchesMinutes * 60 * 1000);

jpaStorageSettings.setFilterParameterEnabled(appProperties.getFilter_search_enabled());
jpaStorageSettings.setAdvancedHSearchIndexing(appProperties.getAdvanced_lucene_indexing());
jpaStorageSettings.setHibernateSearchIndexSearchParams(appProperties.getAdvanced_lucene_indexing());
jpaStorageSettings.setTreatBaseUrlsAsLocal(new HashSet<>(appProperties.getLocal_base_urls()));
jpaStorageSettings.setTreatReferencesAsLogical(new HashSet<>(appProperties.getLogical_urls()));

Expand Down Expand Up @@ -237,6 +239,14 @@ public PartitionSettings partitionSettings(AppProperties appProperties) {
// Partitioning
if (appProperties.getPartitioning() != null) {
retVal.setPartitioningEnabled(true);
boolean databasePartitionModeEnabled =
defaultIfNull(appProperties.getPartitioning().getDatabase_partition_mode_enabled(), Boolean.FALSE);
Integer defaultPartitionId = appProperties.getPartitioning().getDefault_partition_id();
if (databasePartitionModeEnabled) {
retVal.setDatabasePartitionMode(true);
defaultPartitionId = defaultIfNull(defaultPartitionId, 0);
}
retVal.setDefaultPartitionId(defaultPartitionId);
retVal.setIncludePartitionInSearchHashes(
appProperties.getPartitioning().getPartitioning_include_in_search_hashes());
if (appProperties.getPartitioning().getAllow_references_across_partitions()) {
Expand All @@ -251,6 +261,11 @@ public PartitionSettings partitionSettings(AppProperties appProperties) {
return retVal;
}

@Bean
public PartitionModeConfigurer partitionModeConfigurer() {
return new PartitionModeConfigurer();
}

@Primary
@Bean
public HibernatePropertiesProvider jpaStarterDialectProvider(
Expand Down
Loading

0 comments on commit 792f520

Please sign in to comment.