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 52a9c8a81f1..bb3f5f7144f 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 @@ -360,11 +360,14 @@ public abstract class BaseHapiTerminologySvc implements IHapiTerminologySvc { Collection parentLinks = myConceptParentChildLinkDao.findAllWithChild(theConceptPid); if (parentLinks.isEmpty()) { myChildToParentPidCache.put(theConceptPid, -1L); + ourLog.info("Found {} parent concepts of concept {} (cache has {})", 0, theConceptPid, myChildToParentPidCache.size()); return; } else { for (Long next : parentLinks) { myChildToParentPidCache.put(theConceptPid, next); } + int parentCount = myChildToParentPidCache.get(theConceptPid).size(); + ourLog.info("Found {} parent concepts of concept {} (cache has {})", parentCount, theConceptPid, myChildToParentPidCache.size()); } } @@ -376,9 +379,6 @@ public abstract class BaseHapiTerminologySvc implements IHapiTerminologySvc { createParentsString(theParentsBuilder, nextParent); } - int parentCount = myChildToParentPidCache.get(theConceptPid).size(); - ourLog.info("Found {} parent concepts of concept {} (cache has {})", parentCount, theConceptPid, myChildToParentPidCache.size()); - } @Override @@ -390,8 +390,8 @@ public abstract class BaseHapiTerminologySvc implements IHapiTerminologySvc { ourLog.info("Clearing parent concept cache"); myNextReindexPass = System.currentTimeMillis() + DateUtils.MILLIS_PER_MINUTE; myChildToParentPidCache = null; - return; } + return; } if (myChildToParentPidCache == null) {