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) { } catch (FHIRException fe) {
throw new InternalErrorException(fe); throw new InternalErrorException(fe);
} }
myConceptMapDao.save(termConceptMap); termConceptMap = myConceptMapDao.save(termConceptMap);
int codesSaved = 0; int codesSaved = 0;
if (theConceptMap.hasGroup()) { if (theConceptMap.hasGroup()) {
@ -1793,7 +1793,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc,
termConceptMapGroupElementTarget.setEquivalence(elementTarget.getEquivalence()); termConceptMapGroupElementTarget.setEquivalence(elementTarget.getEquivalence());
myConceptMapGroupElementTargetDao.save(termConceptMapGroupElementTarget); myConceptMapGroupElementTargetDao.save(termConceptMapGroupElementTarget);
if (codesSaved++ % 250 == 0) { if (++codesSaved % 250 == 0) {
ourLog.info("Have saved {} codes in ConceptMap", codesSaved); ourLog.info("Have saved {} codes in ConceptMap", codesSaved);
myConceptMapGroupElementTargetDao.flush(); myConceptMapGroupElementTargetDao.flush();
} }
@ -1815,7 +1815,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc,
throw new UnprocessableEntityException(msg); throw new UnprocessableEntityException(msg);
} }
ourLog.info("Done storing TermConceptMap."); ourLog.info("Done storing TermConceptMap[{}]", termConceptMap.getId());
} }
@Scheduled(fixedDelay = 600000) // 10 minutes. @Scheduled(fixedDelay = 600000) // 10 minutes.
@ -1932,7 +1932,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc,
Optional<TermValueSet> optionalExistingTermValueSetByUrl = myValueSetDao.findByUrl(url); Optional<TermValueSet> optionalExistingTermValueSetByUrl = myValueSetDao.findByUrl(url);
if (!optionalExistingTermValueSetByUrl.isPresent()) { if (!optionalExistingTermValueSetByUrl.isPresent()) {
myValueSetDao.save(termValueSet); termValueSet = myValueSetDao.save(termValueSet);
} else { } else {
TermValueSet existingTermValueSet = optionalExistingTermValueSetByUrl.get(); TermValueSet existingTermValueSet = optionalExistingTermValueSetByUrl.get();
@ -1946,7 +1946,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc,
throw new UnprocessableEntityException(msg); throw new UnprocessableEntityException(msg);
} }
ourLog.info("Done storing TermValueSet."); ourLog.info("Done storing TermValueSet[{}]", termValueSet.getId());
} }
@Override @Override

View File

@ -106,7 +106,7 @@ public class ValueSetConceptAccumulator implements IValueSetConceptAccumulator {
myValueSetConceptDao.save(concept); myValueSetConceptDao.save(concept);
myValueSetDao.save(myTermValueSet.incrementTotalConcepts()); 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()); ourLog.info("Have pre-expanded {} concepts in ValueSet[{}]", myConceptsSaved, myTermValueSet.getUrl());
} }
@ -131,8 +131,8 @@ public class ValueSetConceptAccumulator implements IValueSetConceptAccumulator {
myValueSetConceptDesignationDao.save(designation); myValueSetConceptDesignationDao.save(designation);
myValueSetDao.save(myTermValueSet.incrementTotalConceptDesignations()); myValueSetDao.save(myTermValueSet.incrementTotalConceptDesignations());
if (myDesignationsSaved++ % 250 == 0) { // TODO: DM 2019-08-23 - This message never appears in the log. Fix it! if (++myDesignationsSaved % 250 == 0) {
ourLog.info("Have pre-expanded {} designations for Concept[{}|{}] in ValueSet[{}]", myDesignationsSaved, theConcept.getSystem(), theConcept.getCode(), myTermValueSet.getUrl()); ourLog.debug("Have pre-expanded {} designations for Concept[{}|{}] in ValueSet[{}]", myDesignationsSaved, theConcept.getSystem(), theConcept.getCode(), myTermValueSet.getUrl());
} }
return designation; return designation;