Incremental progress on large ValueSet expansion.

This commit is contained in:
Diederik Muylwyk 2019-09-05 15:54:45 -04:00
parent 655222fcac
commit 6fa9658b24
2 changed files with 8 additions and 8 deletions

View File

@ -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<TermValueSet> 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

View File

@ -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;