diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml
index 5b77bb7c699..3b3970107e7 100644
--- a/hapi-deployable-pom/pom.xml
+++ b/hapi-deployable-pom/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-android/pom.xml b/hapi-fhir-android/pom.xml
index f0b687dd3e7..bd2caced4a3 100644
--- a/hapi-fhir-android/pom.xml
+++ b/hapi-fhir-android/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml
index c260587c709..db38d2480a4 100644
--- a/hapi-fhir-base/pom.xml
+++ b/hapi-fhir-base/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-batch/pom.xml b/hapi-fhir-batch/pom.xml
index 8b0d7590023..c278af4d8a9 100644
--- a/hapi-fhir-batch/pom.xml
+++ b/hapi-fhir-batch/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-bom/pom.xml b/hapi-fhir-bom/pom.xml
index 76232254a48..79f37ad22c7 100644
--- a/hapi-fhir-bom/pom.xml
+++ b/hapi-fhir-bom/pom.xml
@@ -3,14 +3,14 @@
4.0.0
ca.uhn.hapi.fhir
hapi-fhir-bom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
pom
HAPI FHIR BOM
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-checkstyle/pom.xml b/hapi-fhir-checkstyle/pom.xml
index 331407f0cc6..5d2b1cf2c69 100644
--- a/hapi-fhir-checkstyle/pom.xml
+++ b/hapi-fhir-checkstyle/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-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 d447ef77452..3505e68b538 100644
--- a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
+++ b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-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 71ba06bdc1f..0083658941e 100644
--- a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
+++ b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-fhir-cli
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-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 41fedf5bbd2..c4751e261d2 100644
--- a/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml
+++ b/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../../hapi-deployable-pom
diff --git a/hapi-fhir-cli/pom.xml b/hapi-fhir-cli/pom.xml
index da20bab67c8..2469fbc253a 100644
--- a/hapi-fhir-cli/pom.xml
+++ b/hapi-fhir-cli/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-client-okhttp/pom.xml b/hapi-fhir-client-okhttp/pom.xml
index 6cfa818a106..96389e525f1 100644
--- a/hapi-fhir-client-okhttp/pom.xml
+++ b/hapi-fhir-client-okhttp/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-client/pom.xml b/hapi-fhir-client/pom.xml
index fccb65a9453..735413ca850 100644
--- a/hapi-fhir-client/pom.xml
+++ b/hapi-fhir-client/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-converter/pom.xml b/hapi-fhir-converter/pom.xml
index 1cb0744fb95..1ed7701885f 100644
--- a/hapi-fhir-converter/pom.xml
+++ b/hapi-fhir-converter/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-dist/pom.xml b/hapi-fhir-dist/pom.xml
index 65cd8a3137b..c6010d81016 100644
--- a/hapi-fhir-dist/pom.xml
+++ b/hapi-fhir-dist/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-docs/pom.xml b/hapi-fhir-docs/pom.xml
index 18992338cba..3d8fb140f64 100644
--- a/hapi-fhir-docs/pom.xml
+++ b/hapi-fhir-docs/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_1_0/3693-exclude-deleted-resources-with-forced-ids-from-bundle-total-in-searches.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_1_0/3693-exclude-deleted-resources-with-forced-ids-from-bundle-total-in-searches.yaml
new file mode 100644
index 00000000000..82cd5dafcb7
--- /dev/null
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_1_0/3693-exclude-deleted-resources-with-forced-ids-from-bundle-total-in-searches.yaml
@@ -0,0 +1,7 @@
+---
+type: fix
+issue: 3693
+jira: SMILE-4185
+title: "Previously, deleted resources with client generated ids were being included in the
+bundle total when searching by _id. This has been corrected by adding functionality to optionally filter
+out deleted resources when resolving forced ids to persistent ids."
diff --git a/hapi-fhir-jacoco/pom.xml b/hapi-fhir-jacoco/pom.xml
index c05789b6fb9..ca8fb92c2c7 100644
--- a/hapi-fhir-jacoco/pom.xml
+++ b/hapi-fhir-jacoco/pom.xml
@@ -11,7 +11,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jaxrsserver-base/pom.xml b/hapi-fhir-jaxrsserver-base/pom.xml
index 33ee7390790..94ea1b90f4b 100644
--- a/hapi-fhir-jaxrsserver-base/pom.xml
+++ b/hapi-fhir-jaxrsserver-base/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpa/pom.xml b/hapi-fhir-jpa/pom.xml
index 44fcbe8d7b2..40058d1db1c 100644
--- a/hapi-fhir-jpa/pom.xml
+++ b/hapi-fhir-jpa/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-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 1fd2865dfce..f91bdf8868b 100644
--- a/hapi-fhir-jpaserver-base/pom.xml
+++ b/hapi-fhir-jpaserver-base/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 6.1.0-PRE8-SNAPSHOT
+ 6.1.0-PRE9-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/IForcedIdDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/IForcedIdDao.java
index 229a32bbcd5..e878c6f81ed 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/IForcedIdDao.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/IForcedIdDao.java
@@ -1,12 +1,13 @@
package ca.uhn.fhir.jpa.dao.data;
+import ca.uhn.fhir.jpa.dao.data.custom.IForcedIdQueries;
import ca.uhn.fhir.jpa.model.entity.ForcedId;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Repository;
-import java.util.Collection;
import java.util.List;
import java.util.Optional;
@@ -29,10 +30,10 @@ import java.util.Optional;
* limitations under the License.
* #L%
*/
+@Repository
+public interface IForcedIdDao extends JpaRepository, IHapiFhirJpaRepository, IForcedIdQueries {
-public interface IForcedIdDao extends JpaRepository, IHapiFhirJpaRepository {
-
- @Query("SELECT f FROM ForcedId f WHERE myResourcePid IN (:resource_pids)")
+ @Query("SELECT f FROM ForcedId f WHERE f.myResourcePid IN (:resource_pids)")
List findAllByResourcePid(@Param("resource_pids") List theResourcePids);
@Query("SELECT f FROM ForcedId f WHERE f.myResourcePid = :resource_pid")
@@ -41,54 +42,4 @@ public interface IForcedIdDao extends JpaRepository, IHapiFhirJp
@Modifying
@Query("DELETE FROM ForcedId t WHERE t.myId = :pid")
void deleteByPid(@Param("pid") Long theId);
-
- /**
- * This method returns a Collection where each row is an element in the collection. Each element in the collection
- * is an object array, where the order matters (the array represents columns returned by the query). Be careful if you change this query in any way.
- */
- @Query("" +
- "SELECT " +
- " f.myResourceType, f.myResourcePid, f.myForcedId, t.myDeleted " +
- "FROM ForcedId f " +
- "JOIN ResourceTable t ON t.myId = f.myResourcePid " +
- "WHERE f.myResourceType = :resource_type AND f.myForcedId IN ( :forced_id )")
- Collection