Ks 20210512 value set expansion id (#2654)

* tested and fixed

* changelog
This commit is contained in:
Ken Stevens 2021-05-12 21:38:29 -04:00 committed by GitHub
parent 1fe51d1ca2
commit 316e7e0d6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View File

@ -0,0 +1,5 @@
---
type: fix
issue: 2654
title: "The id of ValueSet resources in ValueSet expansions was null. This has been corrected. The id of the expanded
value set is now the same as the id of the value set that was expanded."

View File

@ -420,6 +420,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
}
ValueSet valueSet = new ValueSet();
valueSet.setId(theValueSetToExpand.getId());
valueSet.setStatus(Enumerations.PublicationStatus.ACTIVE);
valueSet.setCompose(theValueSetToExpand.getCompose());
valueSet.setExpansion(accumulator);
@ -1765,7 +1766,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
return null;
});
ourLog.info("Pre-expanded ValueSet[{}] with URL[{}] - Saved {} concepts in {}", valueSet.getId(), valueSet.getUrl(), accumulator.getConceptsSaved(), sw.toString());
ourLog.info("Pre-expanded ValueSet[{}] with URL[{}] - Saved {} concepts in {}", valueSet.getId(), valueSet.getUrl(), accumulator.getConceptsSaved(), sw);
} catch (Exception e) {
ourLog.error("Failed to pre-expand ValueSet: " + e.getMessage(), e);

View File

@ -8,7 +8,6 @@ import ca.uhn.fhir.jpa.entity.TermConcept;
import ca.uhn.fhir.jpa.entity.TermConceptParentChildLink.RelationshipTypeEnum;
import ca.uhn.fhir.jpa.entity.TermValueSet;
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation;
import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum;
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc;
@ -706,6 +705,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
.execute();
ourLog.info("Expanded: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expanded));
assertEquals(1, expanded.getExpansion().getContains().size());
assertNotNull(expanded.getId());
}
@Test
@ -791,7 +791,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
TermValueSet termValueSet = optionalValueSetByUrl.get();
assertSame(optionalValueSetByResourcePid.get(), termValueSet);
ourLog.info("ValueSet:\n" + termValueSet.toString());
ourLog.info("ValueSet:\n" + termValueSet);
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
assertEquals(theValueSetName, termValueSet.getName());
assertEquals(0, termValueSet.getConcepts().size());
@ -809,7 +809,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
TermValueSet termValueSet = optionalValueSetByUrl.get();
assertSame(optionalValueSetByResourcePid.get(), termValueSet);
ourLog.info("ValueSet:\n" + termValueSet.toString());
ourLog.info("ValueSet:\n" + termValueSet);
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
assertEquals(theValueSetName, termValueSet.getName());
assertEquals(theCodeSystem.getConcept().size(), termValueSet.getConcepts().size());