Test now passes.
This commit is contained in:
parent
b3afe41de8
commit
e8ac24b4df
|
@ -52,6 +52,7 @@ import com.google.gson.JsonElement;
|
||||||
import org.apache.commons.lang3.Validate;
|
import org.apache.commons.lang3.Validate;
|
||||||
import org.hl7.fhir.instance.model.api.IBase;
|
import org.hl7.fhir.instance.model.api.IBase;
|
||||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||||
|
import org.hl7.fhir.instance.model.api.IIdType;
|
||||||
import org.hl7.fhir.instance.model.api.IPrimitiveType;
|
import org.hl7.fhir.instance.model.api.IPrimitiveType;
|
||||||
import org.hl7.fhir.r4.model.Identifier;
|
import org.hl7.fhir.r4.model.Identifier;
|
||||||
import org.hl7.fhir.utilities.npm.IPackageCacheManager;
|
import org.hl7.fhir.utilities.npm.IPackageCacheManager;
|
||||||
|
@ -329,8 +330,16 @@ public class PackageInstallerSvcImpl implements IPackageInstallerSvc {
|
||||||
|
|
||||||
ourLog.info("Creating new resource matching {}", map.toNormalizedQueryString(myFhirContext));
|
ourLog.info("Creating new resource matching {}", map.toNormalizedQueryString(myFhirContext));
|
||||||
theOutcome.incrementResourcesInstalled(myFhirContext.getResourceType(theResource));
|
theOutcome.incrementResourcesInstalled(myFhirContext.getResourceType(theResource));
|
||||||
createResource(dao, theResource);
|
|
||||||
|
|
||||||
|
IIdType id = theResource.getIdElement();
|
||||||
|
|
||||||
|
if (id.isEmpty()) {
|
||||||
|
createResource(dao, theResource);
|
||||||
|
ourLog.info("Created resource with new id");
|
||||||
|
} else {
|
||||||
|
updateResource(dao, theResource);
|
||||||
|
ourLog.info("Created resource with existing id");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
ourLog.info("Updating existing resource matching {}", map.toNormalizedQueryString(myFhirContext));
|
ourLog.info("Updating existing resource matching {}", map.toNormalizedQueryString(myFhirContext));
|
||||||
|
|
Loading…
Reference in New Issue