diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvcImpl.java index 10c0581765c..9e7a901e31f 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvcImpl.java @@ -1750,7 +1750,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc, } catch (FHIRException fe) { throw new InternalErrorException(fe); } - myConceptMapDao.save(termConceptMap); + termConceptMap = myConceptMapDao.save(termConceptMap); int codesSaved = 0; if (theConceptMap.hasGroup()) { @@ -1793,7 +1793,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc, termConceptMapGroupElementTarget.setEquivalence(elementTarget.getEquivalence()); myConceptMapGroupElementTargetDao.save(termConceptMapGroupElementTarget); - if (codesSaved++ % 250 == 0) { + if (++codesSaved % 250 == 0) { ourLog.info("Have saved {} codes in ConceptMap", codesSaved); myConceptMapGroupElementTargetDao.flush(); } @@ -1815,7 +1815,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc, throw new UnprocessableEntityException(msg); } - ourLog.info("Done storing TermConceptMap."); + ourLog.info("Done storing TermConceptMap[{}]", termConceptMap.getId()); } @Scheduled(fixedDelay = 600000) // 10 minutes. @@ -1932,7 +1932,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc, Optional optionalExistingTermValueSetByUrl = myValueSetDao.findByUrl(url); if (!optionalExistingTermValueSetByUrl.isPresent()) { - myValueSetDao.save(termValueSet); + termValueSet = myValueSetDao.save(termValueSet); } else { TermValueSet existingTermValueSet = optionalExistingTermValueSetByUrl.get(); @@ -1946,7 +1946,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc, throw new UnprocessableEntityException(msg); } - ourLog.info("Done storing TermValueSet."); + ourLog.info("Done storing TermValueSet[{}]", termValueSet.getId()); } @Override diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ValueSetConceptAccumulator.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ValueSetConceptAccumulator.java index 5c7fd8911f4..f4299d4be9b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ValueSetConceptAccumulator.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ValueSetConceptAccumulator.java @@ -106,7 +106,7 @@ public class ValueSetConceptAccumulator implements IValueSetConceptAccumulator { myValueSetConceptDao.save(concept); myValueSetDao.save(myTermValueSet.incrementTotalConcepts()); - if (myConceptsSaved++ % 250 == 0) { // TODO: DM 2019-08-23 - This message never appears in the log. Fix it! + if (++myConceptsSaved % 250 == 0) { ourLog.info("Have pre-expanded {} concepts in ValueSet[{}]", myConceptsSaved, myTermValueSet.getUrl()); } @@ -131,8 +131,8 @@ public class ValueSetConceptAccumulator implements IValueSetConceptAccumulator { myValueSetConceptDesignationDao.save(designation); myValueSetDao.save(myTermValueSet.incrementTotalConceptDesignations()); - if (myDesignationsSaved++ % 250 == 0) { // TODO: DM 2019-08-23 - This message never appears in the log. Fix it! - ourLog.info("Have pre-expanded {} designations for Concept[{}|{}] in ValueSet[{}]", myDesignationsSaved, theConcept.getSystem(), theConcept.getCode(), myTermValueSet.getUrl()); + if (++myDesignationsSaved % 250 == 0) { + ourLog.debug("Have pre-expanded {} designations for Concept[{}|{}] in ValueSet[{}]", myDesignationsSaved, theConcept.getSystem(), theConcept.getCode(), myTermValueSet.getUrl()); } return designation;