Skip to content

Commit 9597721

Browse files
authored
Merge pull request #7195 from hapifhir/mergeback-2-rel-8-4
Mergeback 2 for rel 8 4
2 parents 701cf8a + 8901bcd commit 9597721

File tree

14 files changed

+678
-403
lines changed

14 files changed

+678
-403
lines changed

hapi-fhir-base/src/main/java/ca/uhn/fhir/util/AttachmentUtil.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,16 @@
2727
import ca.uhn.fhir.model.primitive.CodeDt;
2828
import org.apache.commons.lang3.Validate;
2929
import org.hl7.fhir.instance.model.api.IBase;
30+
import org.hl7.fhir.instance.model.api.IBaseExtension;
31+
import org.hl7.fhir.instance.model.api.IBaseHasExtensions;
3032
import org.hl7.fhir.instance.model.api.ICompositeType;
3133
import org.hl7.fhir.instance.model.api.IPrimitiveType;
3234

3335
import java.util.List;
36+
import java.util.Optional;
37+
import java.util.function.Predicate;
38+
39+
import static org.apache.commons.lang3.StringUtils.isNotBlank;
3440

3541
public class AttachmentUtil {
3642

@@ -93,6 +99,19 @@ public static void setSize(FhirContext theContext, ICompositeType theAttachment,
9399
}
94100
}
95101

102+
@SuppressWarnings("unchecked")
103+
public static Optional<String> getFirstExtension(
104+
IBaseHasExtensions theAttachment, String theExtension, Predicate<? super IBaseExtension<?, ?>> theFilter) {
105+
return theAttachment.getExtension().stream()
106+
.filter(theFilter)
107+
.filter(t -> theExtension.equals(t.getUrl()))
108+
.filter(t -> t.getValue() instanceof IPrimitiveType)
109+
.map(t -> (IPrimitiveType<String>) t.getValue())
110+
.map(t -> t.getValue())
111+
.filter(t -> isNotBlank(t))
112+
.findFirst();
113+
}
114+
96115
/**
97116
* This is internal API- Use with caution as it may change
98117
*/

hapi-fhir-base/src/main/java/ca/uhn/fhir/util/HapiExtensions.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ public class HapiExtensions {
8181
public static final String EXT_EXTERNALIZED_BINARY_ID =
8282
"http://hapifhir.io/fhir/StructureDefinition/externalized-binary-id";
8383

84+
/**
85+
* Extension ID for the SHA-256 hash of external binary content
86+
*/
87+
public static final String EXT_EXTERNALIZED_BINARY_HASH_SHA_256 =
88+
"http://hapifhir.io/fhir/StructureDefinition/externalized-binary-hash-sha256";
89+
8490
/**
8591
* For subscription, deliver a bundle containing a search result instead of just a single resource
8692
*/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
type: fix
3+
issue: 7179
4+
title: "A bug in the class used to copy and reuse the RequestDetails during operations
5+
invoked through the HapiFhirRepository would cause an invalid cast exception downstream
6+
when authentication interceptors were enabled for the operation. This has been fixed."
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
type: fix
3+
issue: 7183
4+
jira: SMILE-10474
5+
title: "Previously, updating the binary content of a DocumentReference or Binary resource multiple times with
6+
the same data via the $binary-access-write operation or a resource update would cause a new resource version
7+
to be created and the binary data to be re-uploaded to external binary storage. This has been fixed."
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
---
22
release-date: "2025-08-18"
3-
codename: "TBD"
3+
codename: "Amplification"

hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,6 @@ public HapiFhirJpaMigrationTasks(Set<String> theFlags) {
130130
init780();
131131
init820();
132132
init840();
133-
init860();
134-
}
135-
136-
protected void init860() {
137-
Builder version = forVersion(VersionEnum.V8_4_0);
138-
{
139-
version.onTable("HFJ_RESOURCE_MODIFIED").dropPrimaryKey("20250729.1");
140-
version.onTable("HFJ_RESOURCE_MODIFIED").addPrimaryKey("20250729.2", "RES_ID", "RES_VER", "RESOURCE_TYPE");
141-
}
142133
}
143134

144135
protected void init840() {
@@ -177,6 +168,10 @@ protected void init840() {
177168
Builder.BuilderWithTableName resLink = version.onTable("HFJ_RES_LINK");
178169
resLink.addColumn("20250515.501", "SRC_RES_TYPE_ID").nullable().type(ColumnTypeEnum.SMALLINT);
179170
resLink.addColumn("20250515.502", "TARGET_RES_TYPE_ID").nullable().type(ColumnTypeEnum.SMALLINT);
171+
172+
// Add RESOURCE_TYPE to the HFJ_RESOURCE_MODIFIED primary key
173+
version.onTable("HFJ_RESOURCE_MODIFIED").dropPrimaryKey("20250729.1");
174+
version.onTable("HFJ_RESOURCE_MODIFIED").addPrimaryKey("20250729.2", "RES_ID", "RES_VER", "RESOURCE_TYPE");
180175
}
181176
}
182177

hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/packages/PackageInstallerSvcR4Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ public void testInstallR4PackageWithExternalizedBinaries() throws Exception {
374374
runInTransaction(() -> {
375375
SearchParameterMap map = SearchParameterMap.newSynchronous();
376376
map.add(StructureDefinition.SP_URL, new UriParam("http://hl7.org/fhir/uv/shorthand/CodeSystem/shorthand-code-system"));
377-
IBundleProvider result = myCodeSystemDao.search(map);
377+
IBundleProvider result = myCodeSystemDao.search(map, mySrd);
378378
assertEquals(1, result.sizeOrThrowNpe());
379379
IBaseResource resource = result.getResources(0, 1).get(0);
380380
assertEquals("CodeSystem/shorthand-code-system/_history/1", resource.getIdElement().toString());

0 commit comments

Comments
 (0)