Skip to content

Commit

Permalink
Backport for 7.6.1 (#6559)
Browse files Browse the repository at this point in the history
* Extend meta source length (#6532)

* Add test

* Extend field

* Migration (aimed to backport)

* Add migration for HFJ_RES_VER_PROV table

---------

Co-authored-by: juan.marchionatto <[email protected]>

* Contained device in narrowing (#6537)

Co-authored-by: James Agnew <[email protected]>

---------

Co-authored-by: James Agnew <[email protected]>

* release 7.6.1  - version bump

* release 7.6.1  - version bump fixes

* Changed VersionSpecificWorkerContextWrapper to never expire StructureDefinition entries in the cache - backport for 7.6.1

* Changed VersionSpecificWorkerContextWrapper to never expire StructureDefinition entries in the cache - backport for 7.6.1 fix

---------

Co-authored-by: jmarchionatto <[email protected]>
Co-authored-by: juan.marchionatto <[email protected]>
Co-authored-by: Tadgh <[email protected]>
Co-authored-by: James Agnew <[email protected]>
  • Loading branch information
5 people authored Dec 19, 2024
1 parent 6d7f94b commit 63b2df5
Show file tree
Hide file tree
Showing 101 changed files with 922 additions and 145 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.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
12 changes: 12 additions & 0 deletions hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,18 @@ private void scanResourceForSearchParams(
providesMembershipInCompartments.add(name);
}

/**
* In the base FHIR R4 specification, the Device resource is not a part of the Patient compartment.
* However, it is a patient-specific resource that most users expect to be, and several derivative
* specifications including g(10) testing expect it to be, and the fact that it is not has led to many
* bug reports in HAPI FHIR. As of HAPI FHIR 8.0.0 it is being manually added in response to those
* requests.
* See https://github.com/hapifhir/hapi-fhir/issues/6536 for more information.
*/
if (searchParam.name().equals("patient") && searchParam.path().equals("Device.patient")) {
providesMembershipInCompartments.add("Patient");
}

List<RuntimeSearchParam.Component> components = null;
if (paramType == RestSearchParameterTypeEnum.COMPOSITE) {
components = new ArrayList<>();
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.6.1-SNAPSHOT</version>
<version>7.6.1</version>

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

<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ public List<IAuthRule> buildRuleList(RequestDetails theRequestDetails) {
}
};
// END SNIPPET: advancedCompartment

}

@SuppressWarnings("InnerClassMayBeStatic")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
release-date: "2024-11-15"
codename: "TBD"
codename: "Despina"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
type: change
issue: 6424
title: "Changed VersionSpecificWorkerContextWrapper to never expire StructureDefinition entries in the cache,
which is needed because the validator makes assumptions about StructureDefinitions never changing."
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Device membership in Patient Compartment

As of 7.6.1, versions of FHIR below R5 now consider the `Device` resource's `patient` Search Parameter to be in the Patient Compartment. The following features are affected:

- Patient Search with `_revInclude=*`
- Patient instance-level `$everything` operation
- Patient type-level `$everything` operation
- Automatic Search Narrowing
- Bulk Export

Previously, there were various shims in the code that permitted similar behaviour in these features. Those shims have been removed. The only remaining component is [Advanced Compartment Authorization](/hapi-fhir/docs/security/authorization_interceptor.html#advanced-compartment-authorization), which can still be used
to add other Search Parameters into a given compartment.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
release-date: "2024-12-18"
codename: "Despina"
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
type: fix
issue: 6502
backport: 7.6.1
title: "Support ReferenceParam in addition to UriParam for `_profile` in queries using the SearchParameterMap to match the change in the specification from DSTU3 to R4."
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
type: add
jira: SMILE-9260
backport: 7.6.1
title: "The `patient` search parameter for the `Device` resource has been added to the Patient Compartment for the purposes of:
- AuthorizationInterceptor
- SearchNarrowingInterceptor
- $everything Operation
- Patient/Group Bulk Export
This means that a search for $everything on a patient will return devices associated to this patient. This used to be possible
via the [Advanced Compartment Authorization](/hapi-fhir/docs/security/authorization_interceptor.html#advanced-compartment-authorization), but that would only apply to authorization,
and not these other use cases. This solution adds this Search Parameter to all places where compartment membership would be checked.
"
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.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</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.6.1-SNAPSHOT</version>
<version>7.6.1</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,26 @@ public HapiFhirJpaMigrationTasks(Set<String> theFlags) {
init700();
init720();
init740();
init760();
}

/**
* Built at 2024.11.02 to be backported to version 7.6
*/
protected void init760() {
final Builder version = forVersion(VersionEnum.V7_6_0);

version.onTable("HFJ_RES_VER")
.modifyColumn("20241102.10", "SOURCE_URI")
.nullable()
.withType(ColumnTypeEnum.STRING, 768)
.failureAllowed();

version.onTable("HFJ_RES_VER_PROV")
.modifyColumn("20241102.20", "SOURCE_URI")
.nullable()
.withType(ColumnTypeEnum.STRING, 768)
.failureAllowed();
}

protected void init740() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@
import ca.uhn.fhir.jpa.dao.data.IResourceTableDao;
import ca.uhn.fhir.jpa.model.config.PartitionSettings;
import ca.uhn.fhir.jpa.model.dao.JpaPid;
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
import ca.uhn.fhir.jpa.util.MemoryCacheService;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import jakarta.persistence.EntityManager;
import jakarta.persistence.Tuple;
import jakarta.persistence.TypedQuery;
import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.Path;
import jakarta.persistence.criteria.Root;
import org.hl7.fhir.r4.model.Patient;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Answers;
import org.mockito.ArgumentMatchers;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;
Expand All @@ -31,19 +27,10 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

@ExtendWith(MockitoExtension.class)
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-elastic-test-utilities/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-deployable-pom</artifactId>
<version>7.6.1-SNAPSHOT</version>
<version>7.6.1</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

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

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

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-mdm/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-deployable-pom</artifactId>
<version>7.6.1-SNAPSHOT</version>
<version>7.6.1</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-model/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.6.1-SNAPSHOT</version>
<version>7.6.1</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
})
public class ResourceHistoryTable extends BaseHasResource implements Serializable {
public static final String IDX_RESVER_ID_VER = "IDX_RESVER_ID_VER";
public static final int SOURCE_URI_LENGTH = 100;
public static final int SOURCE_URI_LENGTH = ResourceIndexedSearchParamString.MAX_LENGTH;
/**
* @see ResourceEncodingEnum
*/
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-searchparam/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.6.1-SNAPSHOT</version>
<version>7.6.1</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-subscription/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.6.1-SNAPSHOT</version>
<version>7.6.1</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-test-dstu2/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-deployable-pom</artifactId>
<version>7.6.1-SNAPSHOT</version>
<version>7.6.1</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-test-dstu3/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-deployable-pom</artifactId>
<version>7.6.1-SNAPSHOT</version>
<version>7.6.1</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
Loading

0 comments on commit 63b2df5

Please sign in to comment.