Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Stevens committed Dec 2, 2024
2 parents a8fc127 + 744a0d7 commit adcc25d
Show file tree
Hide file tree
Showing 247 changed files with 5,549 additions and 2,700 deletions.
2 changes: 1 addition & 1 deletion hapi-deployable-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-android/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,15 @@ private void initializeResourceLists() {
@Override
public List<IBaseResource> fetchAllConformanceResources() {
ArrayList<IBaseResource> retVal = new ArrayList<>();
retVal.addAll(myCodeSystems.values());
retVal.addAll(myStructureDefinitions.values());
retVal.addAll(myValueSets.values());
if (myCodeSystems != null) {
retVal.addAll(myCodeSystems.values());
}
if (myStructureDefinitions != null) {
retVal.addAll(myStructureDefinitions.values());
}
if (myValueSets != null) {
retVal.addAll(myValueSets.values());
}
return retVal;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class ValidationSupportContext {
private final Set<String> myCurrentlyGeneratingSnapshots = new HashSet<>();

public ValidationSupportContext(IValidationSupport theRootValidationSupport) {
Validate.notNull(theRootValidationSupport, "theRootValidationSupport musty not be null");
Validate.notNull(theRootValidationSupport, "theRootValidationSupport must not be null");
myRootValidationSupport = theRootValidationSupport;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ default IIdType newIdType(String theValue) {
return retVal;
}

/**
* Creates a new {@link IIdType} instance for the given version with the given value
*
* @since 8.0.0
*/
default IIdType newIdType(String theResourceType, String theIdPart) {
IIdType retVal = newIdType();
retVal.setParts(null, theResourceType, theIdPart, null);
return retVal;
}

/**
* Returns an instance of <code>IFhirVersionServer<code> for this version.
* Note that this method may only be called if the <code>hapi-fhir-server</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,22 @@
*/
package ca.uhn.fhir.rest.param;

import java.util.Collections;
import java.util.Map;

public class HistorySearchDateRangeParam extends DateRangeParam {
/**
* Constructor
*
* @since 8.0.0
*/
public HistorySearchDateRangeParam() {
this(Collections.emptyMap(), new DateRangeParam(), null);
}

/**
* Constructor
*/
public HistorySearchDateRangeParam(
Map<String, String[]> theParameters, DateRangeParam theDateRange, Integer theOffset) {
super(theDateRange);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static String formatFileSize(long theBytes) {
if (theBytes <= 0) {
return "0 " + UNITS[0];
}
int digitGroups = (int) (Math.log10(theBytes) / Math.log10(1024));
int digitGroups = (int) (Math.log10((double) theBytes) / Math.log10(1024));
digitGroups = Math.min(digitGroups, UNITS.length - 1);
return new DecimalFormat("###0.#").format(theBytes / Math.pow(1024, digitGroups)) + " " + UNITS[digitGroups];
}
Expand Down
4 changes: 2 additions & 2 deletions hapi-fhir-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-bom</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<packaging>pom</packaging>
<name>HAPI FHIR BOM</name>

<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-checkstyle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-cli</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-client-okhttp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-converter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: fix
issue: 6409
title: "When performing a `_history` query using the `_at` parameter, the time value
is now converted to a zoned-date before being passed to the database. This should
avoid conflicts around date changes on some databases.
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: perf
issue: 6409
title: "When searching in versioned tag mode, the JPA server now avoids a redundant
lookup of the un-versioned tags, avoiding an extra unnecessary database query
in some cases.
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
type: perf
issue: 6409
title: "The JPA server will no longer use the HFJ_RES_VER_PROV table to store and index values from
the `Resource.meta.source` element. Beginning in HAPI FHIR 6.8.0 (and Smile CDR 2023.08.R01), a
new pair of columns have been used to store data for this element, so this change only affects
data which was stored in HAPI FHIR prior to version 6.8.0 (released August 2023). If you have
FHIR resources which were stored in a JPA server prior to this version, and you use the
Resource.meta.source element and/or the `_source` search parameter, you should perform a complete
reindex of your server to ensure that data is not lost. See the upgrade notes for more information.
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
type: perf
issue: 6478
jira: SMILE-8955
title: "Transactions with multiple saved search urls will have the saved search urls
deleted in a batch, instead of 1 at a time.
This is a minor performance update.
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: perf
issue: 6522
title: "Several memory caches in various parts of the JPA server have been removed in an
effort to consolidate caching in this system to two places: The MemoryCacheService, and
ValidationSupportChain. This should make management of the system easier."

Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# Upgrade Notes

The JPA server stores values for the field `Resource.meta.source` in dedicated columns in its database so that they can be indexes and searched for as needed, using the `_source` Search Parameter.

Prior to HAPI FHIR 6.8.0 (and Smile CDR 2023.08.R01), these values were stored in a dedicated table called `HFJ_RES_VER_PROV`. Beginning in HAPI FHIR 6.8.0 (Smile CDR 2023.08.R01), two new columns were added to the `HFJ_RES_VER`
table which store the same data and make it available for searches.

As of HAPI FHIR 8.0.0, the legacy table is no longer searched by default. If you do not have Resource.meta.source data stored in HAPI FHIR that was last created/updated prior to version 6.8.0, this change will not affect you and no action needs to be taken.

If you do have such data, you should follow the following steps:

* Enable the JpaStorageSettings setting `setAccessMetaSourceInformationFromProvenanceTable(true)` to configure the server to continue using the legacy table.

* Perform a server resource reindex by invoking the [$reindex Operation (server)](https://smilecdr.com/docs/fhir_repository/search_parameter_reindexing.html#reindex-server) with the `optimizeStorage` parameter set to `ALL_VERSIONS`.

* When this reindex operation has successfully completed, the setting above can be disabled. Disabling this setting avoids an extra database round-trip when loading data, so this change will have a positive performance impact on your server.

# Fulltext Search with _lastUpdated Filter

Fulltext searches have been updated to support `_lastUpdated` search parameter. A reindexing of Search Parameters
is required to migrate old data to support the `_lastUpdated` search parameter.
Fulltext searches have been updated to support `_lastUpdated` search parameter. If you are using Advanced Hibernate Search indexing and wish to use the `_lastUpdated` search parameetr with this feature, a full reindex of your repository is required.
2 changes: 1 addition & 1 deletion hapi-fhir-jacoco/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jaxrsserver-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.7.8-SNAPSHOT</version>
<version>7.7.9-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.api.svc.IIdHelperService;
import ca.uhn.fhir.jpa.api.svc.ResolveIdentityMode;
import ca.uhn.fhir.jpa.dao.data.IResourceTableDao;
import ca.uhn.fhir.jpa.model.cross.IResourceLookup;
import ca.uhn.fhir.jpa.model.dao.JpaPid;
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import ca.uhn.fhir.rest.api.server.SystemRequestDetails;
Expand All @@ -37,6 +39,7 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import static org.slf4j.LoggerFactory.getLogger;
Expand Down Expand Up @@ -90,20 +93,9 @@ public ResourceVersionMap getVersionMap(
public ResourcePersistentIdMap getLatestVersionIdsForResourceIds(
RequestPartitionId theRequestPartitionId, List<IIdType> theIds) {
ResourcePersistentIdMap idToPID = new ResourcePersistentIdMap();
HashMap<String, List<IIdType>> resourceTypeToIds = new HashMap<>();

for (IIdType id : theIds) {
String resourceType = id.getResourceType();
if (!resourceTypeToIds.containsKey(resourceType)) {
resourceTypeToIds.put(resourceType, new ArrayList<>());
}
resourceTypeToIds.get(resourceType).add(id);
}

for (List<IIdType> nextIds : resourceTypeToIds.values()) {
ResourcePersistentIdMap idAndPID = getIdsOfExistingResources(theRequestPartitionId, nextIds);
idToPID.putAll(idAndPID);
}
ResourcePersistentIdMap idAndPID = getIdsOfExistingResources(theRequestPartitionId, theIds);
idToPID.putAll(idAndPID);

return idToPID;
}
Expand All @@ -124,14 +116,17 @@ private ResourcePersistentIdMap getIdsOfExistingResources(
return retval;
}

List<JpaPid> jpaPids =
myIdHelperService.resolveResourcePersistentIdsWithCache(thePartitionId, new ArrayList<>(theIds));
Map<IIdType, IResourceLookup<JpaPid>> identities = myIdHelperService.resolveResourceIdentities(
thePartitionId,
new ArrayList<>(theIds),
ResolveIdentityMode.includeDeleted().cacheOk());

// we'll use this map to fetch pids that require versions
HashMap<Long, JpaPid> pidsToVersionToResourcePid = new HashMap<>();

// fill in our map
for (JpaPid pid : jpaPids) {
for (IResourceLookup<JpaPid> identity : identities.values()) {
JpaPid pid = identity.getPersistentId();
if (pid.getVersion() == null) {
pidsToVersionToResourcePid.put(pid.getId(), pid);
}
Expand Down
Loading

0 comments on commit adcc25d

Please sign in to comment.