HAPI FHIR Dependency Bumps (#5576)
* HAPI FHIR Dependency Bumps * Hibernate search 6 * Dep bumps * Bump mockito * Fix memory leak * Test cleanup * Test fix * Test fixes * Test fix * Test fix * Test fix * Test fix * Prepare to try and rework max clauses * Refactor large VS expansion * Spotless * Test fix * Version bump * Test fixes * Bump maven container * Build fix * Add license headers * Version bump * License headers
This commit is contained in:
parent
5286829585
commit
878e27b06d
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -209,7 +209,7 @@ public class GenericClientDstu3IT {
|
|||
@Test
|
||||
public void testClientFailures() {
|
||||
ResponseBody body = mock(ResponseBody.class);
|
||||
when(body.source()).thenThrow(IllegalStateException.class, RuntimeException.class);
|
||||
when(body.byteStream()).thenThrow(IllegalStateException.class, RuntimeException.class);
|
||||
|
||||
myHttpResponse = new Response.Builder()
|
||||
.request(myRequest)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Core Library
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 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.model.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-bom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
<name>HAPI FHIR BOM</name>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-cli</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,20 +4,24 @@
|
|||
title: "The version of a few dependencies have been bumped to the latest versions
|
||||
(dependent HAPI modules listed in brackets):
|
||||
<ul>
|
||||
<li>Jackson (Base): 2.15.3 -> 2.16.0</li>
|
||||
<li>Jackson (Base): 2.15.3 -> 2.16.1</li>
|
||||
<li>SLF4j (Base): 2.0.3 -> 2.0.9</li>
|
||||
<li>Logback (Base): 1.4.7 -> 1.4.14</li>
|
||||
<li>Caffeine (Base): 3.1.1 -> 3.1.8</li>
|
||||
<li>Spring Framework (JPA): 5.3.27 -> 6.1.1</li>
|
||||
<li>Spring Boot (JPA-Starter): 5.3.27 -> 6.2.0</li>
|
||||
<li>Spring Data BOM (JPA): 2021.2.2 -> 2023.1.0</li>
|
||||
<li>Hibernate (JPA): 5.6.15.Final -> 6.4.0.Final</li>
|
||||
<li>Hibernate (JPA): 5.6.15.Final -> 6.4.1.Final</li>
|
||||
<li>Hibernate Validator (JPA): 6.1.5.Final -> 8.0.0.Final</li>
|
||||
<li>Hibernate Search (JPA): 6.1.6.Final -> 6.2.2.Final</li>
|
||||
<li>Hibernate Search (JPA): 6.1.6.Final -> 7.0.0.Final</li>
|
||||
<li>Commons-DBCP2 (JPA): 2.9.0 -> 2.11.0</li>
|
||||
<li>DataSource-Proxy (JPA): 1.9 -> 1.10</li>
|
||||
<li>Spring Boot (Boot+Starter): 2.7.12 -> 3.1.4</li>
|
||||
<li>Jetty (CLI): 10.0.14 -> 12.0.3</li>
|
||||
<li>Jansi (CLI): 2.4.0 -> 2.4.1</li>
|
||||
<li>Derby (CLI): 10.14.2.0 -> 10.17.1.0</li>
|
||||
<li>Commons-Lang3 (CLI): 3.12.0 -> 3.14.0</li>
|
||||
<li>Commons-CSV (CLI): 1.8 -> 1.10.0</li>
|
||||
<li>Phloc Schematron (Schematron Validator): 5.6.5 -> 7.1.2</li>
|
||||
<li>RestEasy (JAX-RS Server): 5.0.2.Final -> 6.2.5.Final</li>
|
||||
</ul>"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
@ -53,7 +53,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.search</groupId>
|
||||
<artifactId>hibernate-search-mapper-orm-orm6</artifactId>
|
||||
<artifactId>hibernate-search-mapper-orm</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
@ -340,11 +340,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-analyzers-phonetic</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-backward-codecs</artifactId>
|
||||
<artifactId>lucene-analysis-phonetic</artifactId>
|
||||
</dependency>
|
||||
<!-- Misc -->
|
||||
<dependency>
|
||||
|
|
|
@ -111,7 +111,7 @@ public class JpaBulkExportProcessor implements IBulkExportProcessor<JpaPid> {
|
|||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Autowired
|
||||
private IMdmLinkDao myMdmLinkDao;
|
||||
protected IMdmLinkDao myMdmLinkDao;
|
||||
|
||||
@Autowired
|
||||
private MdmExpansionCacheSvc myMdmExpansionCacheSvc;
|
||||
|
|
|
@ -582,7 +582,7 @@ public class IdHelperService implements IIdHelperService<JpaPid> {
|
|||
return retVal;
|
||||
}
|
||||
|
||||
RequestPartitionId replaceDefault(RequestPartitionId theRequestPartitionId) {
|
||||
public RequestPartitionId replaceDefault(RequestPartitionId theRequestPartitionId) {
|
||||
if (myPartitionSettings.getDefaultPartitionId() != null) {
|
||||
if (!theRequestPartitionId.isAllPartitions() && theRequestPartitionId.hasDefaultPartitionId()) {
|
||||
List<Integer> partitionIds = theRequestPartitionId.getPartitionIds().stream()
|
||||
|
@ -712,7 +712,7 @@ public class IdHelperService implements IIdHelperService<JpaPid> {
|
|||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void setPartitionSettingsForUnitTest(PartitionSettings thePartitionSettings) {
|
||||
public void setPartitionSettingsForUnitTest(PartitionSettings thePartitionSettings) {
|
||||
myPartitionSettings = thePartitionSettings;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ public class SynchronousSearchSvcImpl implements ISynchronousSearchSvc {
|
|||
private JpaStorageSettings myStorageSettings;
|
||||
|
||||
@Autowired
|
||||
private SearchBuilderFactory mySearchBuilderFactory;
|
||||
protected SearchBuilderFactory mySearchBuilderFactory;
|
||||
|
||||
@Autowired
|
||||
private DaoRegistry myDaoRegistry;
|
||||
|
|
|
@ -98,14 +98,13 @@ import jakarta.persistence.EntityManager;
|
|||
import jakarta.persistence.NonUniqueResultException;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
import jakarta.persistence.PersistenceContextType;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.apache.lucene.index.Term;
|
||||
import org.apache.lucene.search.BooleanQuery;
|
||||
import org.apache.lucene.search.IndexSearcher;
|
||||
import org.hibernate.CacheMode;
|
||||
import org.hibernate.search.engine.search.predicate.dsl.BooleanPredicateClausesStep;
|
||||
import org.hibernate.search.engine.search.predicate.dsl.PredicateFinalStep;
|
||||
|
@ -175,6 +174,7 @@ import java.util.StringTokenizer;
|
|||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static ca.uhn.fhir.jpa.entity.TermConceptPropertyBinder.CONCEPT_PROPERTY_PREFIX_NAME;
|
||||
|
@ -1135,77 +1135,90 @@ public class TermReadSvcImpl implements ITermReadSvc, IHasScheduledJobs {
|
|||
}
|
||||
int chunkSize = chunkSizeOpt.get();
|
||||
|
||||
SearchProperties searchProps = buildSearchScroll(
|
||||
/*
|
||||
* Turn the filter into one or more Hibernate Search queries. Ideally we want it
|
||||
* to be handled by a single query, but Lucene/ES don't like it when we exceed
|
||||
* 1024 different terms in a single query. So if we have that many terms (which
|
||||
* can happen if a ValueSet has a lot of explicitly enumerated codes that it's
|
||||
* including) we split this into multiple searches. The method below builds these
|
||||
* searches lazily, returning a Supplier that creates and executes the search
|
||||
* when it's actually time to.
|
||||
*/
|
||||
SearchProperties searchProps = buildSearchScrolls(
|
||||
theTermCodeSystemVersion,
|
||||
theExpansionFilter,
|
||||
theSystem,
|
||||
theIncludeOrExclude,
|
||||
chunkSize,
|
||||
includeOrExcludeVersion);
|
||||
|
||||
int accumulatedBatchesSoFar = 0;
|
||||
try (SearchScroll<EntityReference> scroll = searchProps.getSearchScroll()) {
|
||||
for (var next : searchProps.getSearchScroll()) {
|
||||
try (SearchScroll<EntityReference> scroll = next.get()) {
|
||||
|
||||
ourLog.debug(
|
||||
"Beginning batch expansion for {} with max results per batch: {}",
|
||||
(theAdd ? "inclusion" : "exclusion"),
|
||||
chunkSize);
|
||||
for (SearchScrollResult<EntityReference> chunk = scroll.next(); chunk.hasHits(); chunk = scroll.next()) {
|
||||
int countForBatch = 0;
|
||||
ourLog.debug(
|
||||
"Beginning batch expansion for {} with max results per batch: {}",
|
||||
(theAdd ? "inclusion" : "exclusion"),
|
||||
chunkSize);
|
||||
for (SearchScrollResult<EntityReference> chunk = scroll.next();
|
||||
chunk.hasHits();
|
||||
chunk = scroll.next()) {
|
||||
int countForBatch = 0;
|
||||
|
||||
List<Long> pids = chunk.hits().stream().map(t -> (Long) t.id()).collect(Collectors.toList());
|
||||
List<Long> pids =
|
||||
chunk.hits().stream().map(t -> (Long) t.id()).collect(Collectors.toList());
|
||||
|
||||
List<TermConcept> termConcepts = myTermConceptDao.fetchConceptsAndDesignationsByPid(pids);
|
||||
List<TermConcept> termConcepts = myTermConceptDao.fetchConceptsAndDesignationsByPid(pids);
|
||||
|
||||
// If the include section had multiple codes, return the codes in the same order
|
||||
termConcepts = sortTermConcepts(searchProps, termConcepts);
|
||||
// If the include section had multiple codes, return the codes in the same order
|
||||
termConcepts = sortTermConcepts(searchProps, termConcepts);
|
||||
|
||||
// int firstResult = theQueryIndex * maxResultsPerBatch;// TODO GGG HS we lose the ability to check the
|
||||
// index of the first result, so just best-guessing it here.
|
||||
Optional<PredicateFinalStep> expansionStepOpt = searchProps.getExpansionStepOpt();
|
||||
int delta = 0;
|
||||
for (TermConcept concept : termConcepts) {
|
||||
count++;
|
||||
countForBatch++;
|
||||
if (theAdd && expansionStepOpt.isPresent()) {
|
||||
ValueSet.ConceptReferenceComponent theIncludeConcept =
|
||||
getMatchedConceptIncludedInValueSet(theIncludeOrExclude, concept);
|
||||
if (theIncludeConcept != null && isNotBlank(theIncludeConcept.getDisplay())) {
|
||||
concept.setDisplay(theIncludeConcept.getDisplay());
|
||||
// int firstResult = theQueryIndex * maxResultsPerBatch;
|
||||
// TODO GGG HS we lose the ability to check the
|
||||
// index of the first result, so just best-guessing it here.
|
||||
int delta = 0;
|
||||
for (TermConcept concept : termConcepts) {
|
||||
count++;
|
||||
countForBatch++;
|
||||
if (theAdd && searchProps.hasIncludeOrExcludeCodes()) {
|
||||
ValueSet.ConceptReferenceComponent theIncludeConcept =
|
||||
getMatchedConceptIncludedInValueSet(theIncludeOrExclude, concept);
|
||||
if (theIncludeConcept != null && isNotBlank(theIncludeConcept.getDisplay())) {
|
||||
concept.setDisplay(theIncludeConcept.getDisplay());
|
||||
}
|
||||
}
|
||||
boolean added = addCodeIfNotAlreadyAdded(
|
||||
theExpansionOptions,
|
||||
theValueSetCodeAccumulator,
|
||||
theAddedCodes,
|
||||
concept,
|
||||
theAdd,
|
||||
includeOrExcludeVersion);
|
||||
if (added) {
|
||||
delta++;
|
||||
}
|
||||
}
|
||||
boolean added = addCodeIfNotAlreadyAdded(
|
||||
theExpansionOptions,
|
||||
theValueSetCodeAccumulator,
|
||||
theAddedCodes,
|
||||
concept,
|
||||
theAdd,
|
||||
includeOrExcludeVersion);
|
||||
if (added) {
|
||||
delta++;
|
||||
}
|
||||
|
||||
ourLog.debug(
|
||||
"Batch expansion scroll for {} with offset {} produced {} results in {}ms",
|
||||
(theAdd ? "inclusion" : "exclusion"),
|
||||
accumulatedBatchesSoFar,
|
||||
chunk.hits().size(),
|
||||
chunk.took().toMillis());
|
||||
|
||||
theValueSetCodeAccumulator.incrementOrDecrementTotalConcepts(theAdd, delta);
|
||||
accumulatedBatchesSoFar += countForBatch;
|
||||
|
||||
// keep session bounded
|
||||
myEntityManager.flush();
|
||||
myEntityManager.clear();
|
||||
}
|
||||
|
||||
ourLog.debug(
|
||||
"Batch expansion scroll for {} with offset {} produced {} results in {}ms",
|
||||
"Expansion for {} produced {} results in {}ms",
|
||||
(theAdd ? "inclusion" : "exclusion"),
|
||||
accumulatedBatchesSoFar,
|
||||
chunk.hits().size(),
|
||||
chunk.took().toMillis());
|
||||
|
||||
theValueSetCodeAccumulator.incrementOrDecrementTotalConcepts(theAdd, delta);
|
||||
accumulatedBatchesSoFar += countForBatch;
|
||||
|
||||
// keep session bounded
|
||||
myEntityManager.flush();
|
||||
myEntityManager.clear();
|
||||
count,
|
||||
fullOperationSw.getMillis());
|
||||
}
|
||||
|
||||
ourLog.debug(
|
||||
"Expansion for {} produced {} results in {}ms",
|
||||
(theAdd ? "inclusion" : "exclusion"),
|
||||
count,
|
||||
fullOperationSw.getMillis());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1243,7 +1256,7 @@ public class TermReadSvcImpl implements ITermReadSvc, IHasScheduledJobs {
|
|||
return maxResultsPerBatch > 0 ? Optional.of(maxResultsPerBatch) : Optional.empty();
|
||||
}
|
||||
|
||||
private SearchProperties buildSearchScroll(
|
||||
private SearchProperties buildSearchScrolls(
|
||||
TermCodeSystemVersion theTermCodeSystemVersion,
|
||||
ExpansionFilter theExpansionFilter,
|
||||
String theSystem,
|
||||
|
@ -1255,54 +1268,68 @@ public class TermReadSvcImpl implements ITermReadSvc, IHasScheduledJobs {
|
|||
SearchPredicateFactory predicate =
|
||||
searchSession.scope(TermConcept.class).predicate();
|
||||
|
||||
// Build the top-level expansion on filters.
|
||||
PredicateFinalStep step = predicate.bool(b -> {
|
||||
b.must(predicate.match().field("myCodeSystemVersionPid").matching(theTermCodeSystemVersion.getPid()));
|
||||
|
||||
if (theExpansionFilter.hasCode()) {
|
||||
b.must(predicate.match().field("myCode").matching(theExpansionFilter.getCode()));
|
||||
}
|
||||
|
||||
String codeSystemUrlAndVersion = buildCodeSystemUrlAndVersion(theSystem, theIncludeOrExcludeVersion);
|
||||
for (ValueSet.ConceptSetFilterComponent nextFilter : theIncludeOrExclude.getFilter()) {
|
||||
handleFilter(codeSystemUrlAndVersion, predicate, b, nextFilter);
|
||||
}
|
||||
for (ValueSet.ConceptSetFilterComponent nextFilter : theExpansionFilter.getFilters()) {
|
||||
handleFilter(codeSystemUrlAndVersion, predicate, b, nextFilter);
|
||||
}
|
||||
});
|
||||
|
||||
SearchProperties returnProps = new SearchProperties();
|
||||
|
||||
List<String> codes = theIncludeOrExclude.getConcept().stream()
|
||||
List<String> allCodes = theIncludeOrExclude.getConcept().stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(ValueSet.ConceptReferenceComponent::getCode)
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.collect(Collectors.toList());
|
||||
returnProps.setIncludeOrExcludeCodes(codes);
|
||||
|
||||
Optional<PredicateFinalStep> expansionStepOpt = buildExpansionPredicate(codes, predicate);
|
||||
final PredicateFinalStep finishedQuery =
|
||||
expansionStepOpt.isPresent() ? predicate.bool().must(step).must(expansionStepOpt.get()) : step;
|
||||
returnProps.setExpansionStepOpt(expansionStepOpt);
|
||||
SearchProperties returnProps = new SearchProperties();
|
||||
returnProps.setIncludeOrExcludeCodes(allCodes);
|
||||
|
||||
/*
|
||||
* DM 2019-08-21 - Processing slows after any ValueSets with many codes explicitly identified. This might
|
||||
* be due to the dark arts that is memory management. Will monitor but not do anything about this right now.
|
||||
* Lucene/ES can't typically handle more than 1024 clauses per search, so if
|
||||
* we have more than that number (e.g. because of a ValueSet that explicitly
|
||||
* includes thousands of codes), we break this up into multiple searches.
|
||||
*/
|
||||
List<List<String>> partitionedCodes = ListUtils.partition(allCodes, IndexSearcher.getMaxClauseCount() - 10);
|
||||
if (partitionedCodes.isEmpty()) {
|
||||
partitionedCodes = List.of(List.of());
|
||||
}
|
||||
|
||||
// BooleanQuery.setMaxClauseCount(SearchBuilder.getMaximumPageSize());
|
||||
// TODO GGG HS looks like we can't set max clause count, but it can be set server side.
|
||||
// BooleanQuery.setMaxClauseCount(10000);
|
||||
// JM 22-02-15 - Hopefully increasing maxClauseCount should be not needed anymore
|
||||
for (List<String> nextCodePartition : partitionedCodes) {
|
||||
Supplier<SearchScroll<EntityReference>> nextScroll = () -> {
|
||||
// Build the top-level expansion on filters.
|
||||
PredicateFinalStep step = predicate.bool(b -> {
|
||||
b.must(predicate
|
||||
.match()
|
||||
.field("myCodeSystemVersionPid")
|
||||
.matching(theTermCodeSystemVersion.getPid()));
|
||||
|
||||
SearchQuery<EntityReference> termConceptsQuery = searchSession
|
||||
.search(TermConcept.class)
|
||||
.selectEntityReference()
|
||||
.where(f -> finishedQuery)
|
||||
.toQuery();
|
||||
if (theExpansionFilter.hasCode()) {
|
||||
b.must(predicate.match().field("myCode").matching(theExpansionFilter.getCode()));
|
||||
}
|
||||
|
||||
String codeSystemUrlAndVersion =
|
||||
buildCodeSystemUrlAndVersion(theSystem, theIncludeOrExcludeVersion);
|
||||
for (ValueSet.ConceptSetFilterComponent nextFilter : theIncludeOrExclude.getFilter()) {
|
||||
handleFilter(codeSystemUrlAndVersion, predicate, b, nextFilter);
|
||||
}
|
||||
for (ValueSet.ConceptSetFilterComponent nextFilter : theExpansionFilter.getFilters()) {
|
||||
handleFilter(codeSystemUrlAndVersion, predicate, b, nextFilter);
|
||||
}
|
||||
});
|
||||
|
||||
// Add a selector on any explicitly enumerated codes in the VS component
|
||||
final PredicateFinalStep finishedQuery;
|
||||
if (nextCodePartition.isEmpty()) {
|
||||
finishedQuery = step;
|
||||
} else {
|
||||
PredicateFinalStep expansionStep = buildExpansionPredicate(nextCodePartition, predicate);
|
||||
finishedQuery = predicate.bool().must(step).must(expansionStep);
|
||||
}
|
||||
|
||||
SearchQuery<EntityReference> termConceptsQuery = searchSession
|
||||
.search(TermConcept.class)
|
||||
.selectEntityReference()
|
||||
.where(f -> finishedQuery)
|
||||
.toQuery();
|
||||
|
||||
return termConceptsQuery.scroll(theScrollChunkSize);
|
||||
};
|
||||
|
||||
returnProps.addSearchScroll(nextScroll);
|
||||
}
|
||||
|
||||
returnProps.setSearchScroll(termConceptsQuery.scroll(theScrollChunkSize));
|
||||
return returnProps;
|
||||
}
|
||||
|
||||
|
@ -1317,29 +1344,9 @@ public class TermReadSvcImpl implements ITermReadSvc, IHasScheduledJobs {
|
|||
/**
|
||||
* Helper method which builds a predicate for the expansion
|
||||
*/
|
||||
private Optional<PredicateFinalStep> buildExpansionPredicate(
|
||||
List<String> theCodes, SearchPredicateFactory thePredicate) {
|
||||
if (CollectionUtils.isEmpty(theCodes)) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
if (theCodes.size() < BooleanQuery.getMaxClauseCount()) {
|
||||
return Optional.of(thePredicate.simpleQueryString().field("myCode").matching(String.join(" | ", theCodes)));
|
||||
}
|
||||
|
||||
// Number of codes is larger than maxClauseCount, so we split the query in several clauses
|
||||
|
||||
// partition codes in lists of BooleanQuery.getMaxClauseCount() size
|
||||
List<List<String>> listOfLists = ListUtils.partition(theCodes, BooleanQuery.getMaxClauseCount());
|
||||
|
||||
PredicateFinalStep step = thePredicate.bool(b -> {
|
||||
b.minimumShouldMatchNumber(1);
|
||||
for (List<String> codeList : listOfLists) {
|
||||
b.should(p -> p.simpleQueryString().field("myCode").matching(String.join(" | ", codeList)));
|
||||
}
|
||||
});
|
||||
|
||||
return Optional.of(step);
|
||||
private PredicateFinalStep buildExpansionPredicate(List<String> theCodes, SearchPredicateFactory thePredicate) {
|
||||
assert !theCodes.isEmpty();
|
||||
return thePredicate.simpleQueryString().field("myCode").matching(String.join(" | ", theCodes));
|
||||
}
|
||||
|
||||
private String buildCodeSystemUrlAndVersion(String theSystem, String theIncludeOrExcludeVersion) {
|
||||
|
@ -3150,24 +3157,15 @@ public class TermReadSvcImpl implements ITermReadSvc, IHasScheduledJobs {
|
|||
* Properties returned from method buildSearchScroll
|
||||
*/
|
||||
private static final class SearchProperties {
|
||||
private SearchScroll<EntityReference> mySearchScroll;
|
||||
private Optional<PredicateFinalStep> myExpansionStepOpt;
|
||||
private List<Supplier<SearchScroll<EntityReference>>> mySearchScroll = new ArrayList<>();
|
||||
private List<String> myIncludeOrExcludeCodes;
|
||||
|
||||
public SearchScroll<EntityReference> getSearchScroll() {
|
||||
public List<Supplier<SearchScroll<EntityReference>>> getSearchScroll() {
|
||||
return mySearchScroll;
|
||||
}
|
||||
|
||||
public void setSearchScroll(SearchScroll<EntityReference> theSearchScroll) {
|
||||
mySearchScroll = theSearchScroll;
|
||||
}
|
||||
|
||||
public Optional<PredicateFinalStep> getExpansionStepOpt() {
|
||||
return myExpansionStepOpt;
|
||||
}
|
||||
|
||||
public void setExpansionStepOpt(Optional<PredicateFinalStep> theExpansionStepOpt) {
|
||||
myExpansionStepOpt = theExpansionStepOpt;
|
||||
public void addSearchScroll(Supplier<SearchScroll<EntityReference>> theSearchScrollSupplier) {
|
||||
mySearchScroll.add(theSearchScrollSupplier);
|
||||
}
|
||||
|
||||
public List<String> getIncludeOrExcludeCodes() {
|
||||
|
@ -3177,6 +3175,10 @@ public class TermReadSvcImpl implements ITermReadSvc, IHasScheduledJobs {
|
|||
public void setIncludeOrExcludeCodes(List<String> theIncludeOrExcludeCodes) {
|
||||
myIncludeOrExcludeCodes = theIncludeOrExcludeCodes;
|
||||
}
|
||||
|
||||
public boolean hasIncludeOrExcludeCodes() {
|
||||
return !myIncludeOrExcludeCodes.isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
static boolean isValueSetDisplayLanguageMatch(ValueSetExpansionOptions theExpansionOptions, String theStoredLang) {
|
||||
|
|
|
@ -35,6 +35,7 @@ import org.hl7.fhir.r4.model.Group;
|
|||
import org.hl7.fhir.r4.model.IdType;
|
||||
import org.hl7.fhir.r4.model.Observation;
|
||||
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.junit.jupiter.params.ParameterizedTest;
|
||||
|
@ -152,6 +153,12 @@ public class JpaBulkExportProcessorTest {
|
|||
@InjectMocks
|
||||
private JpaBulkExportProcessor myProcessor;
|
||||
|
||||
@BeforeEach
|
||||
public void init() {
|
||||
myProcessor.mySearchBuilderFactory = mySearchBuilderFactory;
|
||||
myProcessor.myMdmLinkDao = myMdmLinkDao;
|
||||
}
|
||||
|
||||
private ExportPIDIteratorParameters createExportParameters(BulkExportJobParameters.ExportStyle theExportStyle) {
|
||||
ExportPIDIteratorParameters parameters = new ExportPIDIteratorParameters();
|
||||
parameters.setInstanceId("instanceId");
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
@ -86,7 +86,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.search</groupId>
|
||||
<artifactId>hibernate-search-mapper-orm-orm6</artifactId>
|
||||
<artifactId>hibernate-search-mapper-orm</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.search</groupId>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
@ -125,7 +125,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.search</groupId>
|
||||
<artifactId>hibernate-search-mapper-orm-orm6</artifactId>
|
||||
<artifactId>hibernate-search-mapper-orm</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jscience</groupId>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -38,6 +38,7 @@ public class SynchronousSearchSvcImplTest extends BaseSearchSvc {
|
|||
@BeforeEach
|
||||
public void before() {
|
||||
mySynchronousSearchSvc.setContext(ourCtx);
|
||||
mySynchronousSearchSvc.mySearchBuilderFactory = mySearchBuilderFactory;
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -21,7 +21,11 @@ import org.hl7.fhir.r4.model.Subscription;
|
|||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.ArgumentMatchers;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.event.Level;
|
||||
|
@ -50,6 +54,7 @@ import static org.mockito.Mockito.mock;
|
|||
/**
|
||||
* Test the rest-hook subscriptions
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class RestHookWithInterceptorR4Test extends BaseSubscriptionsR4Test {
|
||||
|
||||
private static final Logger ourLog = LoggerFactory.getLogger(RestHookWithInterceptorR4Test.class);
|
||||
|
@ -61,6 +66,9 @@ public class RestHookWithInterceptorR4Test extends BaseSubscriptionsR4Test {
|
|||
private static boolean ourNextAddHeader;
|
||||
private static final FhirContext ourCtx = FhirContext.forR4Cached();
|
||||
|
||||
@Mock(strictness = Mock.Strictness.STRICT_STUBS)
|
||||
Logger loggerMock;
|
||||
|
||||
@Autowired
|
||||
StoppableSubscriptionDeliveringRestHookSubscriber myStoppableSubscriptionDeliveringRestHookSubscriber;
|
||||
@Autowired
|
||||
|
@ -223,14 +231,13 @@ public class RestHookWithInterceptorR4Test extends BaseSubscriptionsR4Test {
|
|||
@Test
|
||||
public void testDebugLoggingInterceptor() throws Exception {
|
||||
List<String> messages = new ArrayList<>();
|
||||
Logger loggerMock = mock(Logger.class);
|
||||
doAnswer(t -> {
|
||||
Object msg = t.getArguments()[0];
|
||||
Object[] args = Arrays.copyOfRange(t.getArguments(), 1, t.getArguments().length);
|
||||
String formattedMessage = MessageFormatter.arrayFormat((String) msg, args).getMessage();
|
||||
messages.add(formattedMessage);
|
||||
return null;
|
||||
}).when(loggerMock).debug(any(), ArgumentMatchers.<Object[]>any());
|
||||
}).when(loggerMock).debug(any(), any(Object[].class));
|
||||
|
||||
SubscriptionDebugLogInterceptor interceptor = new SubscriptionDebugLogInterceptor();
|
||||
myInterceptorRegistry.registerInterceptor(interceptor);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
@ -85,6 +85,10 @@
|
|||
<groupId>org.apache.derby</groupId>
|
||||
<artifactId>derby</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.derby</groupId>
|
||||
<artifactId>derbytools</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-test</artifactId>
|
||||
|
|
|
@ -52,12 +52,8 @@ import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
|
|||
import ca.uhn.fhir.rest.server.util.ISearchParamRegistry;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.lucene.search.BooleanQuery;
|
||||
import org.hibernate.search.engine.search.predicate.dsl.PredicateFinalStep;
|
||||
import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory;
|
||||
import org.hibernate.search.engine.search.query.SearchQuery;
|
||||
import org.hibernate.search.mapper.orm.Search;
|
||||
import org.apache.lucene.search.IndexSearcher;
|
||||
import org.hibernate.search.mapper.orm.common.EntityReference;
|
||||
import org.hibernate.search.mapper.orm.session.SearchSession;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.hl7.fhir.r4.model.CodeSystem;
|
||||
import org.hl7.fhir.r4.model.ValueSet;
|
||||
|
@ -72,7 +68,6 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.test.util.AopTestUtils;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
@ -80,7 +75,6 @@ import jakarta.persistence.EntityManager;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
|
@ -1944,7 +1938,7 @@ public abstract class BaseValueSetHSearchExpansionR4Test extends BaseJpaTest {
|
|||
|
||||
@Test
|
||||
public void testShouldNotFindAny() {
|
||||
List<EntityReference> hits = search(allCodesNotIncludingSearched);
|
||||
List<String> hits = search(allCodesNotIncludingSearched);
|
||||
assertNotNull(hits);
|
||||
assertTrue(hits.isEmpty());
|
||||
}
|
||||
|
@ -1952,12 +1946,12 @@ public abstract class BaseValueSetHSearchExpansionR4Test extends BaseJpaTest {
|
|||
|
||||
@Test
|
||||
public void testHitsInFirstSublist() {
|
||||
int insertIndex = BooleanQuery.getMaxClauseCount() / 2;
|
||||
int insertIndex = IndexSearcher.getMaxClauseCount() / 2;
|
||||
|
||||
// insert existing codes into list of codes searched
|
||||
allCodesNotIncludingSearched.addAll(insertIndex, existingCodes);
|
||||
|
||||
List<EntityReference> hits = search(allCodesNotIncludingSearched);
|
||||
List<String> hits = search(allCodesNotIncludingSearched);
|
||||
assertEquals(existingCodes.size(), hits.size());
|
||||
}
|
||||
|
||||
|
@ -1967,7 +1961,7 @@ public abstract class BaseValueSetHSearchExpansionR4Test extends BaseJpaTest {
|
|||
// insert existing codes into list of codes searched
|
||||
allCodesNotIncludingSearched.addAll(allCodesNotIncludingSearched.size(), existingCodes);
|
||||
|
||||
List<EntityReference> hits = search(allCodesNotIncludingSearched);
|
||||
List<String> hits = search(allCodesNotIncludingSearched);
|
||||
|
||||
assertEquals(existingCodes.size(), hits.size());
|
||||
}
|
||||
|
@ -1986,42 +1980,20 @@ public abstract class BaseValueSetHSearchExpansionR4Test extends BaseJpaTest {
|
|||
// insert last partition of existing codes into last sublist of searched codes
|
||||
allCodesNotIncludingSearched.addAll(allCodesNotIncludingSearched.size(), partitionedExistingCodes.get(1));
|
||||
|
||||
List<EntityReference> hits = search(allCodesNotIncludingSearched);
|
||||
List<String> hits = search(allCodesNotIncludingSearched);
|
||||
assertEquals(existingCodes.size(), hits.size());
|
||||
}
|
||||
|
||||
private List<EntityReference> search(List<String> theSearchedCodes) {
|
||||
return runInTransaction(() -> {
|
||||
TermCodeSystemVersion termCsVersion = myTermCodeSystemVersionDao.findCurrentVersionForCodeSystemResourcePid(termCsId);
|
||||
Long termCsvPid = termCsVersion.getPid();
|
||||
|
||||
SearchSession searchSession = Search.session(myEntityManager);
|
||||
SearchPredicateFactory predicate = searchSession.scope(TermConcept.class).predicate();
|
||||
|
||||
Optional<PredicateFinalStep> lastStepOpt = ReflectionTestUtils.invokeMethod(
|
||||
new TermReadSvcImpl(), "buildExpansionPredicate", theSearchedCodes, predicate);
|
||||
|
||||
assertNotNull(lastStepOpt);
|
||||
assertTrue(lastStepOpt.isPresent());
|
||||
|
||||
PredicateFinalStep step = predicate.bool(b -> {
|
||||
b.must(predicate.match().field("myCodeSystemVersionPid").matching(termCsvPid));
|
||||
b.must(lastStepOpt.get());
|
||||
});
|
||||
|
||||
int maxResultsPerBatch = 800;
|
||||
|
||||
SearchQuery<EntityReference> termConceptsQuery = searchSession
|
||||
.search(TermConcept.class)
|
||||
.selectEntityReference()
|
||||
.where(f -> step)
|
||||
.toQuery();
|
||||
|
||||
ourLog.trace("About to query: {}", termConceptsQuery.queryString());
|
||||
|
||||
return termConceptsQuery.fetchHits(0, maxResultsPerBatch);
|
||||
});
|
||||
|
||||
private List<String> search(List<String> theSearchedCodes) {
|
||||
// Include
|
||||
ValueSet vs = new ValueSet();
|
||||
ValueSet.ConceptSetComponent include = vs.getCompose().addInclude();
|
||||
include.setSystem(LOINC_URI);
|
||||
for (var next : theSearchedCodes) {
|
||||
include.addConcept().setCode(next);
|
||||
}
|
||||
ValueSet outcome = myTermSvc.expandValueSet(null, vs);
|
||||
return toCodesContains(outcome.getExpansion().getContains());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao.index;
|
||||
package ca.uhn.fhir.jpa.cache;
|
||||
|
||||
import ca.uhn.fhir.interceptor.model.RequestPartitionId;
|
||||
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
|
||||
|
@ -6,6 +6,7 @@ import ca.uhn.fhir.jpa.api.svc.IIdHelperService;
|
|||
import ca.uhn.fhir.jpa.cache.ResourcePersistentIdMap;
|
||||
import ca.uhn.fhir.jpa.cache.ResourceVersionSvcDaoImpl;
|
||||
import ca.uhn.fhir.jpa.dao.data.IResourceTableDao;
|
||||
import ca.uhn.fhir.jpa.dao.index.IdHelperService;
|
||||
import ca.uhn.fhir.jpa.model.config.PartitionSettings;
|
||||
import ca.uhn.fhir.jpa.model.dao.JpaPid;
|
||||
import ca.uhn.fhir.jpa.model.entity.ForcedId;
|
||||
|
@ -14,6 +15,7 @@ import ca.uhn.fhir.model.primitive.IdDt;
|
|||
import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.InjectMocks;
|
||||
|
@ -52,6 +54,11 @@ public class ResourceVersionSvcTest {
|
|||
@InjectMocks
|
||||
private ResourceVersionSvcDaoImpl myResourceVersionSvc;
|
||||
|
||||
@BeforeEach
|
||||
public void before() {
|
||||
myResourceVersionSvc.myIdHelperService = myIdHelperService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a ResourceTable record for getResourceVersionsForPid
|
||||
* Order matters!
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -29,7 +29,7 @@ class CdsHooksContextBooterTest {
|
|||
void validateJsonThrowsExceptionWhenInputIsInvalid() {
|
||||
// setup
|
||||
final String expected = "HAPI-2378: Invalid JSON: Unrecognized token 'abc': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n" +
|
||||
" at [Source: (String)\"abc\"; line: 1, column: 4]";
|
||||
" at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 4]";
|
||||
// execute
|
||||
final UnprocessableEntityException actual = assertThrows(UnprocessableEntityException.class, () -> myFixture.validateJson("abc"));
|
||||
// validate
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<artifactId>hapi-fhir-serviceloaders</artifactId>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<artifactId>hapi-fhir-serviceloaders</artifactId>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
@ -21,7 +21,7 @@
|
|||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-caching-api</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<artifactId>hapi-fhir-serviceloaders</artifactId>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>hapi-fhir-spring-boot-sample-client-apache</artifactId>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-spring-boot</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
package ca.uhn.fhir.jpa.migrate.taskdef;
|
||||
|
||||
import ca.uhn.fhir.jpa.migrate.DriverTypeEnum;
|
||||
import ca.uhn.fhir.jpa.migrate.JdbcUtils;
|
||||
import org.intellij.lang.annotations.Language;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -56,6 +57,10 @@ public class DropTableTask extends BaseTableTask {
|
|||
logInfo(ourLog, "Table {} has the following indexes: {}", getTableName(), indexNames);
|
||||
|
||||
for (String next : foreignKeys) {
|
||||
if (getDriverType() == DriverTypeEnum.DERBY_EMBEDDED && next.contains("-")) {
|
||||
// Derby creates special internal indexes with GUID names that can't be deleted
|
||||
continue;
|
||||
}
|
||||
List<String> sql = DropForeignKeyTask.generateSql(getTableName(), next, getDriverType());
|
||||
for (@Language("SQL") String nextSql : sql) {
|
||||
executeSql(getTableName(), nextSql);
|
||||
|
@ -69,6 +74,10 @@ public class DropTableTask extends BaseTableTask {
|
|||
.setDriverType(getDriverType())
|
||||
.setDryRun(isDryRun());
|
||||
for (String nextIndex : indexNames) {
|
||||
if (getDriverType() == DriverTypeEnum.DERBY_EMBEDDED && nextIndex.contains("-")) {
|
||||
// Derby creates special internal indexes with GUID names that can't be deleted
|
||||
continue;
|
||||
}
|
||||
theIndexTask.setIndexName(nextIndex).execute();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -58,6 +58,7 @@ import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
|||
import ca.uhn.fhir.rest.server.interceptor.ResponseTerminologyTranslationSvc;
|
||||
import ca.uhn.fhir.util.BinaryUtil;
|
||||
import ca.uhn.fhir.util.FhirTerser;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.ListMultimap;
|
||||
import jakarta.annotation.Nonnull;
|
||||
|
@ -456,4 +457,9 @@ public class ExpandResourceAndWriteBinaryStep
|
|||
protected OutputStreamWriter getStreamWriter(ByteArrayOutputStream theOutputStream) {
|
||||
return new OutputStreamWriter(theOutputStream, Constants.CHARSET_UTF8);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public void setIdHelperServiceForUnitTest(IIdHelperService theIdHelperService) {
|
||||
myIdHelperService = theIdHelperService;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ import ca.uhn.fhir.rest.api.server.bulk.BulkExportJobParameters;
|
|||
import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId;
|
||||
import ca.uhn.fhir.rest.param.TokenOrListParam;
|
||||
import ca.uhn.fhir.rest.server.interceptor.ResponseTerminologyTranslationSvc;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.ListMultimap;
|
||||
import jakarta.annotation.Nonnull;
|
||||
|
@ -287,4 +288,9 @@ public class ExpandResourcesStep
|
|||
// see WriteBinaryStep as well
|
||||
return myFhirContext.newJsonParser().setPrettyPrint(false);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public void setIdHelperServiceForUnitTest(IIdHelperService theIdHelperService) {
|
||||
myIdHelperService = theIdHelperService;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import ca.uhn.fhir.jpa.bulk.export.api.IBulkExportProcessor;
|
|||
import ca.uhn.fhir.jpa.bulk.export.model.ExportPIDIteratorParameters;
|
||||
import ca.uhn.fhir.rest.api.server.bulk.BulkExportJobParameters;
|
||||
import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import jakarta.annotation.Nonnull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -159,4 +160,9 @@ public class FetchResourceIdsStep implements IFirstJobStepWorker<BulkExportJobPa
|
|||
|
||||
theDataSink.accept(idList);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public void setBulkExportProcessorForUnitTest(IBulkExportProcessor theBulkExportProcessor) {
|
||||
myBulkExportProcessor = theBulkExportProcessor;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,6 +123,7 @@ public class ExpandResourceAndWriteBinaryStepTest {
|
|||
@BeforeEach
|
||||
public void init() {
|
||||
ourLog.addAppender(myAppender);
|
||||
myFinalStep.setIdHelperServiceForUnitTest(myIdHelperService);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
|
|
|
@ -27,6 +27,7 @@ import ca.uhn.fhir.rest.server.SimpleBundleProvider;
|
|||
import ca.uhn.fhir.rest.server.interceptor.ResponseTerminologyTranslationSvc;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.r4.model.Patient;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
@ -82,6 +83,11 @@ public class ExpandResourcesStepTest {
|
|||
@InjectMocks
|
||||
private ExpandResourcesStep mySecondStep;
|
||||
|
||||
@BeforeEach
|
||||
public void init() {
|
||||
mySecondStep.setIdHelperServiceForUnitTest(myIdHelperService);
|
||||
}
|
||||
|
||||
private BulkExportJobParameters createParameters(boolean thePartitioned) {
|
||||
BulkExportJobParameters parameters = new BulkExportJobParameters();
|
||||
parameters.setResourceTypes(Arrays.asList("Patient", "Observation"));
|
||||
|
|
|
@ -65,6 +65,7 @@ public class FetchResourceIdsStepTest {
|
|||
@BeforeEach
|
||||
public void init() {
|
||||
ourLog.addAppender(myAppender);
|
||||
myFirstStep.setBulkExportProcessorForUnitTest(myBulkExportProcessor);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 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.r4;
|
||||
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 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.r4.cpg;
|
||||
|
||||
import ca.uhn.fhir.cr.r4.ILibraryEvaluationServiceFactory;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
@ -85,7 +85,7 @@
|
|||
|
||||
<dependency>
|
||||
<groupId>org.hibernate.search</groupId>
|
||||
<artifactId>hibernate-search-mapper-orm-orm6</artifactId>
|
||||
<artifactId>hibernate-search-mapper-orm</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.search</groupId>
|
||||
|
@ -166,12 +166,6 @@
|
|||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-inline</artifactId>
|
||||
<version>${mockito_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
@ -88,7 +88,7 @@
|
|||
<!-- Hibernate -->
|
||||
<dependency>
|
||||
<groupId>org.hibernate.search</groupId>
|
||||
<artifactId>hibernate-search-mapper-orm-orm6</artifactId>
|
||||
<artifactId>hibernate-search-mapper-orm</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.validator</groupId>
|
||||
|
|
|
@ -20,9 +20,11 @@
|
|||
package ca.uhn.fhir.test.utilities.server;
|
||||
|
||||
import jakarta.servlet.ServletConfig;
|
||||
import org.mockito.quality.Strictness;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.mockito.Mockito.withSettings;
|
||||
|
||||
public class MockServletUtil {
|
||||
|
||||
|
@ -34,7 +36,7 @@ public class MockServletUtil {
|
|||
}
|
||||
|
||||
public static ServletConfig createServletConfig() {
|
||||
ServletConfig sc = mock(ServletConfig.class);
|
||||
ServletConfig sc = mock(ServletConfig.class, withSettings().strictness(Strictness.LENIENT));
|
||||
when(sc.getServletContext()).thenReturn(null);
|
||||
return sc;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>6.11.9-SNAPSHOT</version>
|
||||
<version>6.11.10-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package ca.uhn.fhir.fhirpath;
|
||||
|
||||
import ca.uhn.fhir.test.BaseTest;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
public abstract class BaseValidationTestWithInlineMocks extends BaseTest {
|
||||
|
||||
/**
|
||||
* Avoid memory leaks due to inline mocks. See https://github.com/mockito/mockito/pull/1619
|
||||
* Note that we don't declare the test classes in this
|
||||
* module with @ExtendWith(MockitoExtension.class) because
|
||||
* Mockito 5 seems to not like mixing inline mocks with
|
||||
* extension managed ones.
|
||||
*/
|
||||
@AfterEach
|
||||
public void clearMocks() {
|
||||
Mockito.framework().clearInlineMocks();
|
||||
}
|
||||
|
||||
}
|
|
@ -4,6 +4,7 @@ import ca.uhn.fhir.context.FhirContext;
|
|||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.util.FhirTerser;
|
||||
import ca.uhn.fhir.util.TestUtil;
|
||||
import jakarta.annotation.Nonnull;
|
||||
import org.hl7.fhir.instance.model.api.IBase;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.r4.model.HumanName;
|
||||
|
@ -11,7 +12,6 @@ import org.junit.jupiter.api.AfterAll;
|
|||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
import jakarta.annotation.Nonnull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
@ -21,7 +21,7 @@ import static org.hamcrest.Matchers.containsString;
|
|||
import static org.hamcrest.Matchers.endsWith;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class FhirPathTest {
|
||||
public class FhirPathTest extends BaseValidationTestWithInlineMocks {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideContexts")
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ca.uhn.fhir.rest.server;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks;
|
||||
import ca.uhn.fhir.i18n.Msg;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
|
@ -17,13 +18,11 @@ import ca.uhn.fhir.rest.param.StringParam;
|
|||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor;
|
||||
import ca.uhn.fhir.test.utilities.HttpClientExtension;
|
||||
import ca.uhn.fhir.test.utilities.JettyUtil;
|
||||
import ca.uhn.fhir.test.utilities.server.RestfulServerExtension;
|
||||
import ca.uhn.fhir.util.TestUtil;
|
||||
import ca.uhn.fhir.validation.IValidationContext;
|
||||
import ca.uhn.fhir.validation.IValidatorModule;
|
||||
import ca.uhn.fhir.validation.ResultSeverityEnum;
|
||||
import ca.uhn.hapi.converters.server.VersionedApiConverterInterceptor;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
|
@ -32,12 +31,6 @@ import org.apache.http.client.methods.HttpGet;
|
|||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.ee10.servlet.ServletHandler;
|
||||
import org.eclipse.jetty.ee10.servlet.ServletHolder;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.hl7.fhir.common.hapi.validation.validator.FhirInstanceValidator;
|
||||
import org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender;
|
||||
|
@ -45,7 +38,6 @@ import org.hl7.fhir.dstu3.model.IdType;
|
|||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
@ -53,13 +45,12 @@ import org.mockito.Mockito;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
public class RequestValidatingInterceptorDstu3Test {
|
||||
public class RequestValidatingInterceptorDstu3Test extends BaseValidationTestWithInlineMocks {
|
||||
|
||||
private static final FhirContext ourCtx = FhirContext.forDstu3Cached();
|
||||
private static boolean ourLastRequestWasSearch;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ca.uhn.fhir.rest.server;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks;
|
||||
import ca.uhn.fhir.i18n.Msg;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
import ca.uhn.fhir.rest.annotation.Create;
|
||||
|
@ -59,7 +60,7 @@ import static org.hamcrest.Matchers.not;
|
|||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
public class RequestValidatingInterceptorR4Test {
|
||||
public class RequestValidatingInterceptorR4Test extends BaseValidationTestWithInlineMocks {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(RequestValidatingInterceptorR4Test.class);
|
||||
@RegisterExtension
|
||||
static HttpClientExtension ourClient = new HttpClientExtension();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ca.uhn.fhir.rest.server;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks;
|
||||
import ca.uhn.fhir.i18n.Msg;
|
||||
import ca.uhn.fhir.rest.annotation.Delete;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
|
@ -41,7 +42,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
|||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
public class ResponseValidatingInterceptorDstu3Test {
|
||||
public class ResponseValidatingInterceptorDstu3Test extends BaseValidationTestWithInlineMocks {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResponseValidatingInterceptorDstu3Test.class);
|
||||
public static IBaseResource myReturnResource;
|
||||
private static final FhirContext ourCtx = FhirContext.forDstu3Cached();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ca.uhn.fhir.rest.server;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.fhirpath.BaseValidationTestWithInlineMocks;
|
||||
import ca.uhn.fhir.i18n.Msg;
|
||||
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
|
@ -43,7 +44,7 @@ import static org.hamcrest.Matchers.startsWith;
|
|||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
public class ResponseValidatingInterceptorR4Test {
|
||||
public class ResponseValidatingInterceptorR4Test extends BaseValidationTestWithInlineMocks {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResponseValidatingInterceptorR4Test.class);
|
||||
@RegisterExtension
|
||||
static HttpClientExtension ourClient = new HttpClientExtension();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue