Test fixes

This commit is contained in:
James Agnew 2019-09-19 11:33:33 -04:00
parent 4115a4bb6d
commit a5a0fca065
2 changed files with 15 additions and 4 deletions

View File

@ -1770,11 +1770,18 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc,
public void storeNewCodeSystemVersionIfNeeded(CodeSystem theCodeSystem, ResourceTable theResourceEntity) {
if (theCodeSystem != null && isNotBlank(theCodeSystem.getUrl())) {
String codeSystemUrl = theCodeSystem.getUrl();
if (theCodeSystem.getContent() == CodeSystem.CodeSystemContentMode.COMPLETE || theCodeSystem.getContent() == null
// || theCodeSystem.getContent() == CodeSystem.CodeSystemContentMode.NOTPRESENT
) {
if (theCodeSystem.getContent() == CodeSystem.CodeSystemContentMode.COMPLETE || theCodeSystem.getContent() == null || theCodeSystem.getContent() == CodeSystem.CodeSystemContentMode.NOTPRESENT) {
ourLog.info("CodeSystem {} has a status of {}, going to store concepts in terminology tables", theResourceEntity.getIdDt().getValue(), theCodeSystem.getContentElement().getValueAsString());
// If this is a not-present codesystem, we don't want to store a new version if one
// already exists, since that will wipe out the existing concepts
if (theCodeSystem.getContent() == CodeSystem.CodeSystemContentMode.NOTPRESENT) {
TermCodeSystem codeSystem = myCodeSystemDao.findByCodeSystemUri(theCodeSystem.getUrl());
if (codeSystem != null) {
return;
}
}
Long codeSystemResourcePid = getCodeSystemResourcePid(theCodeSystem.getIdElement());
TermCodeSystemVersion persCs = new TermCodeSystemVersion();
@ -1784,6 +1791,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc,
ourLog.info("Code system has {} concepts", persCs.getConcepts().size());
storeNewCodeSystemVersion(codeSystemResourcePid, codeSystemUrl, theCodeSystem.getName(), theCodeSystem.getVersion(), persCs);
}
}
}

View File

@ -91,8 +91,11 @@ public class FhirResourceDaoR4CacheWarmingTest extends BaseJpaR4Test {
p2.addName().setFamily("Smith");
myPatientDao.update(p2);
Thread.sleep(2000);
myCacheWarmingSvc.performWarmingPass();
Thread.sleep(1000);
ourLog.info("About to perform search");
SearchParameterMap params = new SearchParameterMap();
params.add("name", new StringParam("smith"));
IBundleProvider result = myPatientDao.search(params);