diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml
index 1b7c182e078..e441d7d527b 100644
--- a/hapi-deployable-pom/pom.xml
+++ b/hapi-deployable-pom/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-fhir
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../pom.xml
diff --git a/hapi-fhir-android/pom.xml b/hapi-fhir-android/pom.xml
index 5818dfe25a1..a1c20ea9219 100644
--- a/hapi-fhir-android/pom.xml
+++ b/hapi-fhir-android/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml
index 09ddbf0237c..527d33045cd 100644
--- a/hapi-fhir-base/pom.xml
+++ b/hapi-fhir-base/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-bom/pom.xml b/hapi-fhir-bom/pom.xml
index a99eaf1df80..c284916d5eb 100644
--- a/hapi-fhir-bom/pom.xml
+++ b/hapi-fhir-bom/pom.xml
@@ -4,14 +4,16 @@
4.0.0
ca.uhn.hapi.fhir
hapi-fhir-bom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
pom
HAPI FHIR BOM
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-checkstyle/pom.xml b/hapi-fhir-checkstyle/pom.xml
index ce1e98b167d..5dfd29dbf5b 100644
--- a/hapi-fhir-checkstyle/pom.xml
+++ b/hapi-fhir-checkstyle/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-fhir
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../pom.xml
diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
index eb6a202b53f..7d28ec0892e 100644
--- a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
+++ b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
@@ -4,7 +4,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
index 7ea8223ec77..fdbd8852b6e 100644
--- a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
+++ b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
@@ -6,7 +6,8 @@
ca.uhn.hapi.fhir
hapi-fhir-cli
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../pom.xml
diff --git a/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml
index 395e1c3804f..7b91c6a1835 100644
--- a/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml
+++ b/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml
@@ -6,7 +6,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../../hapi-deployable-pom
diff --git a/hapi-fhir-cli/pom.xml b/hapi-fhir-cli/pom.xml
index b10e5c6a525..e575e9f19f1 100644
--- a/hapi-fhir-cli/pom.xml
+++ b/hapi-fhir-cli/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-fhir
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../pom.xml
diff --git a/hapi-fhir-client-okhttp/pom.xml b/hapi-fhir-client-okhttp/pom.xml
index d286cbfe899..8cce88f6f38 100644
--- a/hapi-fhir-client-okhttp/pom.xml
+++ b/hapi-fhir-client-okhttp/pom.xml
@@ -4,7 +4,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-client/pom.xml b/hapi-fhir-client/pom.xml
index 46e3d673a8a..353b3e5f911 100644
--- a/hapi-fhir-client/pom.xml
+++ b/hapi-fhir-client/pom.xml
@@ -4,7 +4,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-converter/pom.xml b/hapi-fhir-converter/pom.xml
index 59fc6c3391f..d104e6e1d83 100644
--- a/hapi-fhir-converter/pom.xml
+++ b/hapi-fhir-converter/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-dist/pom.xml b/hapi-fhir-dist/pom.xml
index 34b5ae46560..f5bff28ee82 100644
--- a/hapi-fhir-dist/pom.xml
+++ b/hapi-fhir-dist/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-fhir
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../pom.xml
diff --git a/hapi-fhir-docs/pom.xml b/hapi-fhir-docs/pom.xml
index 76a4092c1ae..0f9fb71b21f 100644
--- a/hapi-fhir-docs/pom.xml
+++ b/hapi-fhir-docs/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_6_0/4663-cr-bundleiterable.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_6_0/4663-cr-bundleiterable.yaml
new file mode 100644
index 00000000000..62aafd18863
--- /dev/null
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_6_0/4663-cr-bundleiterable.yaml
@@ -0,0 +1,4 @@
+---
+type: fix
+issue: 4663
+title: "Removing previous bundle provider to allow for iterableBundle provider, which will allow for paging resources instead of full consumption of patient resources at once"
diff --git a/hapi-fhir-jacoco/pom.xml b/hapi-fhir-jacoco/pom.xml
index 8e631445293..817e3ba5360 100644
--- a/hapi-fhir-jacoco/pom.xml
+++ b/hapi-fhir-jacoco/pom.xml
@@ -11,7 +11,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jaxrsserver-base/pom.xml b/hapi-fhir-jaxrsserver-base/pom.xml
index 51905769ddc..33a2db27f7d 100644
--- a/hapi-fhir-jaxrsserver-base/pom.xml
+++ b/hapi-fhir-jaxrsserver-base/pom.xml
@@ -4,7 +4,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpa/pom.xml b/hapi-fhir-jpa/pom.xml
index 5a975911383..cca0c44b1ce 100644
--- a/hapi-fhir-jpa/pom.xml
+++ b/hapi-fhir-jpa/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
4.0.0
diff --git a/hapi-fhir-jpaserver-base/pom.xml b/hapi-fhir-jpaserver-base/pom.xml
index 15ff024a435..919495a0656 100644
--- a/hapi-fhir-jpaserver-base/pom.xml
+++ b/hapi-fhir-jpaserver-base/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ParsedLocationParam.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ParsedLocationParam.java
index 9cbff347df4..83a039bae4d 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ParsedLocationParam.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ParsedLocationParam.java
@@ -1,3 +1,22 @@
+/*-
+ * #%L
+ * HAPI FHIR JPA Server
+ * %%
+ * Copyright (C) 2014 - 2023 Smile CDR, Inc.
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
package ca.uhn.fhir.jpa.search.builder.predicate;
import ca.uhn.fhir.i18n.Msg;
diff --git a/hapi-fhir-jpaserver-elastic-test-utilities/pom.xml b/hapi-fhir-jpaserver-elastic-test-utilities/pom.xml
index 155f910781b..9366244137b 100644
--- a/hapi-fhir-jpaserver-elastic-test-utilities/pom.xml
+++ b/hapi-fhir-jpaserver-elastic-test-utilities/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-ips/pom.xml b/hapi-fhir-jpaserver-ips/pom.xml
index a5299f65b0c..d2b73607d76 100644
--- a/hapi-fhir-jpaserver-ips/pom.xml
+++ b/hapi-fhir-jpaserver-ips/pom.xml
@@ -3,7 +3,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-mdm/pom.xml b/hapi-fhir-jpaserver-mdm/pom.xml
index 7c7e3cf63df..e8ea1cf50bf 100644
--- a/hapi-fhir-jpaserver-mdm/pom.xml
+++ b/hapi-fhir-jpaserver-mdm/pom.xml
@@ -6,7 +6,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-model/pom.xml b/hapi-fhir-jpaserver-model/pom.xml
index 32bda9446b2..5f4d44eb132 100644
--- a/hapi-fhir-jpaserver-model/pom.xml
+++ b/hapi-fhir-jpaserver-model/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-searchparam/pom.xml b/hapi-fhir-jpaserver-searchparam/pom.xml
index 919bc44e3d2..c4a9573c00b 100755
--- a/hapi-fhir-jpaserver-searchparam/pom.xml
+++ b/hapi-fhir-jpaserver-searchparam/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-subscription/pom.xml b/hapi-fhir-jpaserver-subscription/pom.xml
index 31057f5d5cf..44f9f99114e 100644
--- a/hapi-fhir-jpaserver-subscription/pom.xml
+++ b/hapi-fhir-jpaserver-subscription/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-test-dstu2/pom.xml b/hapi-fhir-jpaserver-test-dstu2/pom.xml
index b47403a8aed..a17747196fb 100644
--- a/hapi-fhir-jpaserver-test-dstu2/pom.xml
+++ b/hapi-fhir-jpaserver-test-dstu2/pom.xml
@@ -6,7 +6,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-test-dstu3/pom.xml b/hapi-fhir-jpaserver-test-dstu3/pom.xml
index 6e3d678efaa..3736e0c4db6 100644
--- a/hapi-fhir-jpaserver-test-dstu3/pom.xml
+++ b/hapi-fhir-jpaserver-test-dstu3/pom.xml
@@ -6,7 +6,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-test-r4/pom.xml b/hapi-fhir-jpaserver-test-r4/pom.xml
index 9440a00dd7f..fd9b3ed19a4 100644
--- a/hapi-fhir-jpaserver-test-r4/pom.xml
+++ b/hapi-fhir-jpaserver-test-r4/pom.xml
@@ -6,7 +6,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-test-r4b/pom.xml b/hapi-fhir-jpaserver-test-r4b/pom.xml
index 4ec28024f50..9c3a6a89453 100644
--- a/hapi-fhir-jpaserver-test-r4b/pom.xml
+++ b/hapi-fhir-jpaserver-test-r4b/pom.xml
@@ -6,7 +6,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-test-r5/pom.xml b/hapi-fhir-jpaserver-test-r5/pom.xml
index dc6d9004053..1c89efe3595 100644
--- a/hapi-fhir-jpaserver-test-r5/pom.xml
+++ b/hapi-fhir-jpaserver-test-r5/pom.xml
@@ -6,7 +6,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-test-utilities/pom.xml b/hapi-fhir-jpaserver-test-utilities/pom.xml
index 1c1d73a5bcb..7ad67eb5a2a 100644
--- a/hapi-fhir-jpaserver-test-utilities/pom.xml
+++ b/hapi-fhir-jpaserver-test-utilities/pom.xml
@@ -6,7 +6,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml
index 1f402d2e2b8..2a0c24e8643 100644
--- a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml
+++ b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-fhir
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../pom.xml
diff --git a/hapi-fhir-server-mdm/pom.xml b/hapi-fhir-server-mdm/pom.xml
index fbc55be0278..bf5f2f7e63a 100644
--- a/hapi-fhir-server-mdm/pom.xml
+++ b/hapi-fhir-server-mdm/pom.xml
@@ -7,7 +7,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-server-openapi/pom.xml b/hapi-fhir-server-openapi/pom.xml
index a6b7820b943..1aa1f3964e3 100644
--- a/hapi-fhir-server-openapi/pom.xml
+++ b/hapi-fhir-server-openapi/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-server/pom.xml b/hapi-fhir-server/pom.xml
index ca546a930b7..9ac559847fa 100644
--- a/hapi-fhir-server/pom.xml
+++ b/hapi-fhir-server/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-serviceloaders/hapi-fhir-caching-api/pom.xml b/hapi-fhir-serviceloaders/hapi-fhir-caching-api/pom.xml
index 7bf0def22b2..1ee90c11193 100644
--- a/hapi-fhir-serviceloaders/hapi-fhir-caching-api/pom.xml
+++ b/hapi-fhir-serviceloaders/hapi-fhir-caching-api/pom.xml
@@ -7,7 +7,8 @@
hapi-fhir-serviceloaders
ca.uhn.hapi.fhir
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../pom.xml
diff --git a/hapi-fhir-serviceloaders/hapi-fhir-caching-caffeine/pom.xml b/hapi-fhir-serviceloaders/hapi-fhir-caching-caffeine/pom.xml
index 1c714597adc..7f0b4cb5393 100644
--- a/hapi-fhir-serviceloaders/hapi-fhir-caching-caffeine/pom.xml
+++ b/hapi-fhir-serviceloaders/hapi-fhir-caching-caffeine/pom.xml
@@ -7,7 +7,8 @@
hapi-fhir-serviceloaders
ca.uhn.hapi.fhir
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../pom.xml
@@ -20,7 +21,8 @@
ca.uhn.hapi.fhir
hapi-fhir-caching-api
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
com.github.ben-manes.caffeine
diff --git a/hapi-fhir-serviceloaders/hapi-fhir-caching-guava/pom.xml b/hapi-fhir-serviceloaders/hapi-fhir-caching-guava/pom.xml
index d4b4fb9eef3..daf46316b28 100644
--- a/hapi-fhir-serviceloaders/hapi-fhir-caching-guava/pom.xml
+++ b/hapi-fhir-serviceloaders/hapi-fhir-caching-guava/pom.xml
@@ -7,7 +7,8 @@
hapi-fhir-serviceloaders
ca.uhn.hapi.fhir
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../pom.xml
diff --git a/hapi-fhir-serviceloaders/hapi-fhir-caching-testing/pom.xml b/hapi-fhir-serviceloaders/hapi-fhir-caching-testing/pom.xml
index 431ae23be57..c31afccb6c6 100644
--- a/hapi-fhir-serviceloaders/hapi-fhir-caching-testing/pom.xml
+++ b/hapi-fhir-serviceloaders/hapi-fhir-caching-testing/pom.xml
@@ -7,7 +7,8 @@
hapi-fhir
ca.uhn.hapi.fhir
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../../pom.xml
diff --git a/hapi-fhir-serviceloaders/pom.xml b/hapi-fhir-serviceloaders/pom.xml
index fb1f0f59a34..9ad1901fcb1 100644
--- a/hapi-fhir-serviceloaders/pom.xml
+++ b/hapi-fhir-serviceloaders/pom.xml
@@ -5,7 +5,7 @@
hapi-deployable-pom
ca.uhn.hapi.fhir
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml
index 3d08b37a1a8..e252a859ba6 100644
--- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml
+++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml
index aeca5576baf..654e5b26f4c 100644
--- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml
+++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir-spring-boot-samples
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
hapi-fhir-spring-boot-sample-client-apache
diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml
index d80bae417aa..fc133911fe5 100644
--- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml
+++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-fhir-spring-boot-samples
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
hapi-fhir-spring-boot-sample-client-okhttp
diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml
index 9564ad68070..921216e8166 100644
--- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml
+++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-fhir-spring-boot-samples
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
hapi-fhir-spring-boot-sample-server-jersey
diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml
index d770448c31e..8c8264d5925 100644
--- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml
+++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-fhir-spring-boot
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
hapi-fhir-spring-boot-samples
diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml
index dc9f2ef620d..40503f51578 100644
--- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml
+++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-spring-boot/pom.xml b/hapi-fhir-spring-boot/pom.xml
index facbc3d28e9..07414ae1840 100644
--- a/hapi-fhir-spring-boot/pom.xml
+++ b/hapi-fhir-spring-boot/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-fhir
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../pom.xml
diff --git a/hapi-fhir-sql-migrate/pom.xml b/hapi-fhir-sql-migrate/pom.xml
index efeb350e52f..f60f09c4c5e 100644
--- a/hapi-fhir-sql-migrate/pom.xml
+++ b/hapi-fhir-sql-migrate/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-storage-batch2-jobs/pom.xml b/hapi-fhir-storage-batch2-jobs/pom.xml
index 937c77e9ca2..228e8647f17 100644
--- a/hapi-fhir-storage-batch2-jobs/pom.xml
+++ b/hapi-fhir-storage-batch2-jobs/pom.xml
@@ -5,7 +5,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
4.0.0
diff --git a/hapi-fhir-storage-batch2-test-utilities/pom.xml b/hapi-fhir-storage-batch2-test-utilities/pom.xml
index e529da84be2..0975820d7e7 100644
--- a/hapi-fhir-storage-batch2-test-utilities/pom.xml
+++ b/hapi-fhir-storage-batch2-test-utilities/pom.xml
@@ -7,7 +7,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-storage-batch2/pom.xml b/hapi-fhir-storage-batch2/pom.xml
index 6dc1ae63e3d..ed8bec9ece7 100644
--- a/hapi-fhir-storage-batch2/pom.xml
+++ b/hapi-fhir-storage-batch2/pom.xml
@@ -7,7 +7,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-storage-cr/pom.xml b/hapi-fhir-storage-cr/pom.xml
index 318071ec63e..9deef4b95a6 100644
--- a/hapi-fhir-storage-cr/pom.xml
+++ b/hapi-fhir-storage-cr/pom.xml
@@ -7,7 +7,8 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.5.8-SNAPSHOT
+ 6.5.9-SNAPSHOT
+
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/common/BundleIterable.java b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/common/BundleIterable.java
new file mode 100644
index 00000000000..23dc63bbeba
--- /dev/null
+++ b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/common/BundleIterable.java
@@ -0,0 +1,108 @@
+/*-
+ * #%L
+ * HAPI FHIR - Clinical Reasoning
+ * %%
+ * Copyright (C) 2014 - 2023 Smile CDR, Inc.
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * #L%
+ */
+package ca.uhn.fhir.cr.common;
+
+import ca.uhn.fhir.rest.api.server.IBundleProvider;
+import ca.uhn.fhir.rest.api.server.RequestDetails;
+import org.hl7.fhir.instance.model.api.IBaseResource;
+
+import javax.annotation.concurrent.NotThreadSafe;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This class leverages IBundleProvider Iterable to provide an iterator for processing bundle search results into manageable paginated chunks. This helped to avoid loading large result sets into lists
+ **/
+
+@NotThreadSafe
+public class BundleIterable implements Iterable {
+
+ private final IBundleProvider sourceBundleProvider;
+ private final RequestDetails requestDetails;
+
+
+ public BundleIterable(RequestDetails requestDetails, IBundleProvider bundleProvider) {
+ this.sourceBundleProvider = bundleProvider;
+ this.requestDetails = requestDetails;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new BundleIterator(this.requestDetails, this.sourceBundleProvider);
+ }
+
+ static class BundleIterator implements Iterator {
+
+ private IBundleProvider bundleProvider;
+
+ private int offset = 0;
+ private int increment = 50;
+ private List currentResourceList;
+
+ private final RequestDetails requestDetails;
+
+ private int currentResourceListIndex = 0;
+
+
+ public BundleIterator(RequestDetails requestDetails, IBundleProvider bundleProvider) {
+ this.bundleProvider = bundleProvider;
+ this.requestDetails = requestDetails;
+ initChunk();
+ }
+
+ private void initChunk() {
+ this.currentResourceList = this.bundleProvider.getResources(offset, increment + offset);
+ // next offset created
+ offset += increment;
+ //restart counter on new chunk
+ currentResourceListIndex = 0;
+ }
+
+ private void loadNextChunk() {
+ initChunk();
+ }
+
+ @Override
+ public boolean hasNext() {
+ // We still have things in the current chunk to return
+ if (this.currentResourceListIndex < this.currentResourceList.size()) {
+ return true;
+ } else if (this.currentResourceList.size() == 0) {
+ // no more resources!
+ return false;
+ }
+
+ // We need our next chunk
+ this.loadNextChunk();
+ return this.hasNext();
+ }
+
+
+ @Override
+ public IBaseResource next() {
+ assert this.currentResourceListIndex < this.currentResourceList.size();
+
+ var result = this.currentResourceList.get(this.currentResourceListIndex);
+ this.currentResourceListIndex++;
+ return result;
+ }
+ }
+}
+
diff --git a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/common/HapiFhirDal.java b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/common/HapiFhirDal.java
index 2b722913cc8..2c958efc38f 100644
--- a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/common/HapiFhirDal.java
+++ b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/common/HapiFhirDal.java
@@ -37,7 +37,7 @@ public class HapiFhirDal implements FhirDal {
protected final RequestDetails myRequestDetails;
public HapiFhirDal(DaoRegistry theDaoRegistry) {
- this(theDaoRegistry, null);
+ this(theDaoRegistry,null);
}
public HapiFhirDal(DaoRegistry theDaoRegistry, RequestDetails theRequestDetails) {
@@ -70,15 +70,15 @@ public class HapiFhirDal implements FhirDal {
@Override
public Iterable search(String theResourceType) {
var b = this.myDaoRegistry.getResourceDao(theResourceType)
- .search(SearchParameterMap.newSynchronous(), myRequestDetails);
- return TypedBundleProvider.fromBundleProvider(b).getAllResources();
+ .search(new SearchParameterMap(), myRequestDetails);
+ return new BundleIterable(myRequestDetails, b);
}
@Override
public Iterable searchByUrl(String theResourceType, String theUrl) {
- var c = this.myDaoRegistry.getResourceDao(theResourceType)
- .search(SearchParameterMap.newSynchronous().add("url", new UriParam(theUrl)), myRequestDetails);
- return TypedBundleProvider.fromBundleProvider(c).getAllResources();
+ var b = this.myDaoRegistry.getResourceDao(theResourceType)
+ .search(new SearchParameterMap().add("url", new UriParam(theUrl)), myRequestDetails);
+ return new BundleIterable(myRequestDetails, b);
}
diff --git a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/common/HapiFhirRetrieveProvider.java b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/common/HapiFhirRetrieveProvider.java
index 4c205d5a015..d3200d6df73 100644
--- a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/common/HapiFhirRetrieveProvider.java
+++ b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/common/HapiFhirRetrieveProvider.java
@@ -21,7 +21,6 @@ package ca.uhn.fhir.cr.common;
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.model.api.IQueryParameterType;
-import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.api.server.SystemRequestDetails;
import org.hl7.fhir.instance.model.api.IBaseResource;
@@ -31,13 +30,11 @@ import org.opencds.cqf.cql.engine.fhir.searchparam.SearchParameterResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.stream.Collectors;
+import java.util.function.BiFunction;
/**
* This class provides an implementation of the cql-engine's RetrieveProvider
@@ -51,6 +48,7 @@ public class HapiFhirRetrieveProvider extends SearchParamFhirRetrieveProvider im
private final DaoRegistry myDaoRegistry;
private final RequestDetails myRequestDetails;
+
public HapiFhirRetrieveProvider(DaoRegistry theDaoRegistry, SearchParameterResolver theSearchParameterResolver) {
this(theDaoRegistry, theSearchParameterResolver, new SystemRequestDetails());
}
@@ -62,47 +60,98 @@ public class HapiFhirRetrieveProvider extends SearchParamFhirRetrieveProvider im
this.myRequestDetails = requestDetails;
}
+ /**
+ * The queryIterable class provides an Iterable to cycle through a series of search queries and results of those queries, implementation of this avoided loading all resources into a list.
+ */
+ static class QueryIterable implements Iterable