Test now passes.

This commit is contained in:
Kevin Hartmann 2021-04-30 15:17:22 -04:00
parent b3afe41de8
commit e8ac24b4df
1 changed files with 10 additions and 1 deletions

View File

@ -52,6 +52,7 @@ import com.google.gson.JsonElement;
import org.apache.commons.lang3.Validate;
import org.hl7.fhir.instance.model.api.IBase;
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.r4.model.Identifier;
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));
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 {
ourLog.info("Updating existing resource matching {}", map.toNormalizedQueryString(myFhirContext));