diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvc.java index bb3f5f7144f..d897943edf6 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvc.java @@ -396,6 +396,17 @@ public abstract class BaseHapiTerminologySvc implements IHapiTerminologySvc { if (myChildToParentPidCache == null) { myChildToParentPidCache = ArrayListMultimap.create(); + + ourLog.info("Filling terminology parent/child cache"); + int count = 0; + for (TermConceptParentChildLink next : myConceptParentChildLinkDao.findAll()) { + myChildToParentPidCache.put(next.getChildPid(), next.getParentPid()); + if (count++ % 1000 == 0) { + ourLog.info("Loaded {} links", count); + } + } + ourLog.info("Done filling terminology parent/child cache"); + } ourLog.info("Indexing {} / {} concepts", concepts.getContent().size(), concepts.getTotalElements()); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderInterceptorDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderInterceptorDstu3Test.java index e243fe1cc0c..0def3218b67 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderInterceptorDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderInterceptorDstu3Test.java @@ -88,15 +88,14 @@ public class ResourceProviderInterceptorDstu3Test extends BaseResourceProviderDs } @Test - public void testCreateResource() throws IOException { + public void testCreateResource() throws IOException, ServletException { String methodName = "testCreateResource"; Patient pt = new Patient(); pt.addName().setFamily(methodName); String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt); - verify(myServerInterceptor, never()).incomingRequestPreHandled(any(RestOperationTypeEnum.class), any(ActionRequestDetails.class)); - verify(myDaoInterceptor, never()).incomingRequestPreHandled(any(RestOperationTypeEnum.class), any(ActionRequestDetails.class)); + resetServerInterceptor(); HttpPost post = new HttpPost(ourServerBase + "/Patient"); post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); @@ -127,7 +126,7 @@ public class ResourceProviderInterceptorDstu3Test extends BaseResourceProviderDs } @Test - public void testCreateResourceInTransaction() throws IOException { + public void testCreateResourceInTransaction() throws IOException, ServletException { String methodName = "testCreateResourceInTransaction"; Patient pt = new Patient(); @@ -143,7 +142,7 @@ public class ResourceProviderInterceptorDstu3Test extends BaseResourceProviderDs String resource = myFhirCtx.newXmlParser().encodeResourceToString(bundle); - verify(myServerInterceptor, never()).incomingRequestPreHandled(any(RestOperationTypeEnum.class), any(ActionRequestDetails.class)); + resetServerInterceptor(); HttpPost post = new HttpPost(ourServerBase + "/"); post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));