private static boolean payloadContainsNoPlaceholderReferences(FhirContext theCtx, IBaseResource theNewPayload) { List<ResourceReferenceInfo> refs = theCtx.newTerser().getAllResourceReferences(theNewPayload); for (ResourceReferenceInfo next : refs) { String ref = next.getResourceReference().getReferenceElement().getValue(); if (isBlank(ref)) { IBaseResource resource = next.getResourceReference().getResource(); if (resource != null) { ref = resource.getIdElement().getValue(); } } if (isNotBlank(ref)) { if (ref.startsWith("#")) { continue; } if (ref.startsWith("urn:uuid:")) { throw new AssertionError("Reference at " + next.getName() + " is invalid: " + ref); } } } return true; }
if (isBlank(nextRef) && nextValue.getResource() != null) { IBaseResource nextTarget = nextValue.getResource(); nextTargetId = nextTarget.getIdElement().toUnqualifiedVersionless(); if (!nextTargetId.hasResourceType()) {
String resourceType = nextRef.getResourceType(); if (nextRef.isLocal()) { IBaseResource resource = nextRefInfo.getResourceReference().getResource(); if (resource instanceof ValueSet) { theWorkerCtx.getValueSets().put(nextRef.getValue(), (ValueSet) resource);
continue; IBaseResource nextRes = (IBaseResource) nextRefInfo.getResourceReference().getResource(); if (nextRes != null) { if (nextRes.getIdElement().hasIdPart()) {
if (isBlank(ref.getIdPart())) { String reference = ref.getValue(); if (theRef.getResource() != null) { IIdType containedId = getContainedResources().getResourceId(theRef.getResource()); if (containedId != null && !containedId.isEmpty()) { if (containedId.isLocal()) { IIdType refId = theRef.getResource().getIdElement(); if (refId != null) { if (refId.hasIdPart()) { } else { if (!refId.hasResourceType()) { refId = refId.withResourceType(myContext.getResourceDefinition(theRef.getResource()).getName()); if (!ref.hasResourceType() && !ref.isLocal() && theRef.getResource() != null) { ref = ref.withResourceType(myContext.getResourceDefinition(theRef.getResource()).getName());
IBaseResource nextRes = (IBaseResource) nextRef.getResource(); if (nextRes != null) { if (nextRes.getIdElement().hasIdPart()) {
if (nextId.isEmpty() && nextValue.getResource() != null) { nextId = nextValue.getResource().getIdElement();
IBaseResource target = ((IBaseReference) theElement).getResource(); if (target != null) { if (target.getIdElement().hasIdPart() == false || target.getIdElement().isLocal()) {
IBaseResource resource = next.getResource(); if (resource == null && next.getReferenceElement().isLocal()) { if (theContained.hasExistingIdToContainedResource()) { IBaseResource resource = next.getResource(); if (resource != null) { if (resource.getIdElement().isEmpty() || resource.getIdElement().isLocal()) {
IAnyResource nextRes = (IAnyResource) nextRefInfo.getResourceReference().getResource(); if (nextRes != null) { if (nextRes.getIdElement().hasIdPart()) {
continue; IResource nextRes = (IResource) nextRefInfo.getResourceReference().getResource(); if (nextRes != null) { if (nextRes.getId().hasIdPart()) {
IAnyResource nextRes = (IAnyResource) nextRef.getResource(); if (nextRes != null) { if (nextRes.getIdElement().hasIdPart()) {
IAnyResource nextRes = (IAnyResource) nextRef.getResource(); if (nextRes != null) { if (nextRes.getIdElement().hasIdPart()) {
IAnyResource nextRes = (IAnyResource) nextRefInfo.getResourceReference().getResource(); if (nextRes != null) { if (nextRes.getIdElement().hasIdPart()) {
String resourceType = nextRef.getResourceType(); if (nextRef.isLocal()) { IBaseResource resource = nextRefInfo.getResourceReference().getResource(); if (resource instanceof ValueSet) { theWorkerCtx.getValueSets().put(nextRef.getValue(), (ValueSet) resource);
if (isBlank(ref.getIdPart())) { String reference = ref.getValue(); if (theRef.getResource() != null) { IIdType containedId = getContainedResources().getResourceId(theRef.getResource()); if (containedId != null && !containedId.isEmpty()) { if (containedId.isLocal()) { IIdType refId = theRef.getResource().getIdElement(); if (refId != null) { if (refId.hasIdPart()) { } else { if (!refId.hasResourceType()) { refId = refId.withResourceType(myContext.getResourceDefinition(theRef.getResource()).getName()); if (!ref.hasResourceType() && !ref.isLocal() && theRef.getResource() != null) { ref = ref.withResourceType(myContext.getResourceDefinition(theRef.getResource()).getName());
IBaseResource nextRes = (IBaseResource) nextRef.getResource(); if (nextRes != null) { if (nextRes.getIdElement().hasIdPart()) {
IBaseResource resource = next.getResource(); if (resource == null && next.getReferenceElement().isLocal()) { if (theContained.hasExistingIdToContainedResource()) { IBaseResource resource = next.getResource(); if (resource != null) { if (resource.getIdElement().isEmpty() || resource.getIdElement().isLocal()) {
continue; IResource nextRes = (IResource) nextRefInfo.getResourceReference().getResource(); if (nextRes != null) { if (nextRes.getId().hasIdPart()) {
IAnyResource nextRes = (IAnyResource) nextRef.getResource(); if (nextRes != null) { if (nextRes.getIdElement().hasIdPart()) {