@Override public String toString() { ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); b.append("name", myName); b.append("resource", myResource.getReferenceElement()); return b.build(); }
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; }
String nextRef = nextComponent.getReference().getReferenceElement().toUnqualifiedVersionless().getValue(); RuntimeSearchParam componentTarget = idToRuntimeSearchParam.get(nextRef); if (componentTarget != null) {
IBaseResource nextCandidateSource = subResourceList.get(i); for (ResourceReferenceInfo nextRef : ctx.newTerser().getAllResourceReferences(nextCandidateSource)) { String nextRefResourceType = nextRef.getResourceReference().getReferenceElement().getResourceType(); String nextRefIdPart = nextRef.getResourceReference().getReferenceElement().getIdPart(); if (isBlank(nextRefResourceType) || isBlank(nextRefIdPart)) { nextRef.getResourceReference().setResource(null);
String nextRef = nextRefInfo.getResourceReference().getReferenceElement().getValue(); if (isNotBlank(nextRef) && !sent.contains(nextRef)) { missingRef = nextRef;
IIdType referencedId = nextRef.getReferenceElement(); if (!isBlank(referencedId.getResourceType())) { if (!isLogicalReference(referencedId)) {
for (ResourceReferenceInfo nextRef : refs) { nextRef.getResourceReference().setResource(null); String value = nextRef.getResourceReference().getReferenceElement().toUnqualifiedVersionless().getValue(); if (!qualIds.contains(value) && !nextRef.getResourceReference().getReferenceElement().isLocal()) { ourLog.info("Discarding unknown reference: {}", value); nextRef.getResourceReference().getReferenceElement().setValue(null); } else { goodRefs++;
IIdType nextRef = nextRefInfo.getResourceReference().getReferenceElement(); String resourceType = nextRef.getResourceType(); if (nextRef.isLocal()) {
List<IBaseReference> allRefs = terser.getAllPopulatedChildElementsOfType(theResource, IBaseReference.class); for (IBaseReference nextRef : allRefs) { IIdType nextId = nextRef.getReferenceElement(); String nextIdText = nextId.getValue(); if (nextIdText == null) {
String value = nextRef.getResourceReference().getReferenceElement().toUnqualifiedVersionless().getValue(); if (!qualIds.contains(value) && !nextRef.getResourceReference().getReferenceElement().isLocal()) { ourLog.info("Discarding unknown reference: {}", value); nextRef.getResourceReference().getReferenceElement().setValue(null); } else { goodRefs++;
IIdType nextTargetId = nextValue.getReferenceElement(); String nextRef = nextTargetId.toUnqualifiedVersionless().getValue();
String value = nextRef.getResourceReference().getReferenceElement().toUnqualifiedVersionless().getValue(); if (!qualIds.contains(value) && !nextRef.getResourceReference().getReferenceElement().isLocal()) { ourLog.info("Discarding unknown reference: {}", value); nextRef.getResourceReference().getReferenceElement().setValue(null); } else { goodRefs++;
IBaseReference nextRef = (IBaseReference) next; String refText = determineReferenceText(nextRef, theCompositeChildElement); if (!StringUtils.equals(refText, nextRef.getReferenceElement().getValue())) {
private static void copy(FhirContext theCtx, IGenericClient theTarget, String theResType, List<IBaseResource> theQueued, Set<String> theSent, Bundle theReceived) { for (Bundle.BundleEntryComponent nextEntry : theReceived.getEntry()) { Resource nextResource = nextEntry.getResource(); nextResource.setId(theResType + "/" + "CR-" + nextResource.getIdElement().getIdPart()); boolean haveUnsentReference = false; for (ResourceReferenceInfo nextRefInfo : theCtx.newTerser().getAllResourceReferences(nextResource)) { IIdType nextRef = nextRefInfo.getResourceReference().getReferenceElement(); if (nextRef.hasIdPart()) { String newRef = nextRef.getResourceType() + "/" + "CR-" + nextRef.getIdPart(); ourLog.info("Changing reference {} to {}", nextRef.getValue(), newRef); nextRefInfo.getResourceReference().setReference(newRef); if (!theSent.contains(newRef)) { haveUnsentReference = true; } } } if (haveUnsentReference) { ourLog.info("Queueing {} for delivery after", nextResource.getId()); theQueued.add(nextResource); continue; } IIdType newId = theTarget .update() .resource(nextResource) .execute() .getId(); ourLog.info("Copied resource {} and got ID {}", nextResource.getId(), newId); theSent.add(nextResource.getIdElement().toUnqualifiedVersionless().getValue()); } }
for (IBaseReference next : allReferences) { IBaseResource resource = next.getResource(); if (resource == null && next.getReferenceElement().isLocal()) { if (theContained.hasExistingIdToContainedResource()) { IBaseResource potentialTarget = theContained.getExistingIdToContainedResource().remove(next.getReferenceElement().getValue()); if (potentialTarget != null) { theContained.addContained(next.getReferenceElement(), potentialTarget); containResourcesForEncoding(theContained, potentialTarget, theTarget);
return; nextId = nextValue.getReferenceElement();
List<ResourceReferenceInfo> refs = t.getAllResourceReferences(theResource); for (ResourceReferenceInfo nextRef : refs) { IIdType refId = nextRef.getResourceReference().getReferenceElement(); if (refId != null && refId.hasBaseUrl()) { if (getConfig().getTreatBaseUrlsAsLocal().contains(refId.getBaseUrl())) {
if (topicExts.size() > 0) { IBaseReference ref = (IBaseReference) topicExts.get(0).getValueAsPrimitive(); if (!"EventDefinition".equals(ref.getReferenceElement().getResourceType())) { throw new PreconditionFailedException("Topic reference must be an EventDefinition");
private String determineReferenceText(IBaseReference theRef, CompositeChildElement theCompositeChildElement) { IIdType ref = theRef.getReferenceElement(); if (isBlank(ref.getIdPart())) { String reference = ref.getValue();
String securityContextRef = securityContext.getReferenceElement().getValue(); if (isNotBlank(securityContextRef)) { response.addHeader(Constants.HEADER_X_SECURITY_CONTEXT, securityContextRef);