public void setPayloadId(IIdType thePayloadId) { myPayloadId = null; if (thePayloadId != null) { myPayloadId = thePayloadId.getValue(); } } }
public void setId(IIdType theId) { myId = null; if (theId != null) { myId = theId.getValue(); } }
/** * Constructor which creates an error message based on a given resource ID * * @param theResourceId The ID of the resource that could not be found */ public ResourceGoneException(IIdType theResourceId) { super(STATUS_CODE, "Resource " + (theResourceId != null ? theResourceId.getValue() : "") + " is gone/deleted"); }
public ActionRequestDetails(RequestDetails theRequestDetails, FhirContext theContext, String theResourceType, IIdType theId) { if (theId != null && isBlank(theId.getValue())) { myId = null; } else { myId = theId; } myResourceType = theResourceType; myContext = theContext; myRequestDetails = theRequestDetails; }
public void setIdElement(IIdType theIdElement) { myIdElement = null; if (theIdElement != null) { myIdElement = theIdElement.toUnqualifiedVersionless().getValue(); } }
public HttpPatchClientInvocation(FhirContext theContext, IIdType theId, String theContentType, String theContents) { super(theContext); myUrlPath = theId.toUnqualifiedVersionless().getValue(); myContentType = theContentType; myContents = theContents; }
@Override public IHistoryUntyped onInstance(IIdType theId) { if (theId.hasResourceType() == false) { throw new IllegalArgumentException("Resource ID does not have a resource type: " + theId.getValue()); } myId = theId; return this; }
@Override public IPatchExecutable withId(IIdType theId) { if (theId == null) { throw new NullPointerException("theId can not be null"); } if (theId.hasIdPart() == false) { throw new NullPointerException("theId must not be blank and must contain an ID, found: " + theId.getValue()); } myId = theId; return this; }
@Override public IUpdateExecutable withId(IIdType theId) { if (theId == null) { throw new NullPointerException("theId can not be null"); } if (theId.hasIdPart() == false) { throw new NullPointerException("theId must not be blank and must contain an ID, found: " + theId.getValue()); } myId = theId; return this; }
@SuppressWarnings("unchecked") public static <T extends IIdType> T convertIdToType(IIdType value, Class<T> theIdParamType) { if (value != null && !theIdParamType.isAssignableFrom(value.getClass())) { IIdType newValue = ReflectionUtil.newInstance(theIdParamType); newValue.setValue(value.getValue()); value = newValue; } return (T) value; }
@Override public IDeleteTyped resourceById(IIdType theId) { Validate.notNull(theId, "theId can not be null"); if (theId.hasResourceType() == false || theId.hasIdPart() == false) { throw new IllegalArgumentException("theId must contain a resource type and logical ID at a minimum (e.g. Patient/1234)found: " + theId.getValue()); } myId = theId; return this; }
private IBaseResource findResource(Map<String, IBaseResource> theCandidateResources, IIdType theId) { IBaseResource retVal = theCandidateResources.get(theId.toUnqualifiedVersionless().getValue()); if (retVal == null) { throw new InternalErrorException("Unknown reference in ImplementationGuide: " + theId); } return retVal; }
@Override public IDeleteTyped resource(IBaseResource theResource) { Validate.notNull(theResource, "theResource can not be null"); IIdType id = theResource.getIdElement(); Validate.notNull(id, "theResource.getIdElement() can not be null"); if (id.hasResourceType() == false || id.hasIdPart() == false) { throw new IllegalArgumentException("theResource.getId() must contain a resource type and logical ID at a minimum (e.g. Patient/1234), found: " + id.getValue()); } myId = id; return this; }
/** * Match the referenced resource if the resource has the given ID (this can be * the logical ID or the absolute URL of the resource) */ public ICriterion<ReferenceClientParam> hasId(IIdType theId) { return new StringCriterion<>(getParamName(), theId.getValue()); }
public BaseReference(IIdType theReference) { if (theReference != null) { setReference(theReference.getValue()); } else { setReference(null); } }
public boolean unregisterSubscriptionIfRegistered(IBaseResource theSubscription, String theStatusString) { if (hasSubscription(theSubscription.getIdElement()).isPresent()) { ourLog.info("Removing {} subscription {}", theStatusString, theSubscription.getIdElement().toUnqualified().getValue()); unregisterSubscription(theSubscription.getIdElement()); return true; } return false; }
public void setPayload(FhirContext theCtx, IBaseResource thePayload) { myPayload = thePayload; myPayloadString = theCtx.newJsonParser().encodeResourceToString(thePayload); myPayloadId = thePayload.getIdElement().toUnqualified().getValue(); }
public BaseResourceReferenceDt setReference(IIdType theReference) { if (theReference instanceof IdDt) { setReference((IdDt) theReference); } else if (theReference != null) { setReference(new IdDt(theReference.getValue())); } else { setReference((IdDt) null); } return this; }
private void populateBundleEntryFullUrl(IBaseResource next, BundleEntryComponent entry) { if (next.getIdElement().hasBaseUrl()) { entry.setFullUrl(next.getIdElement().toVersionless().getValue()); } else { if (isNotBlank(myBase) && next.getIdElement().hasIdPart()) { IIdType id = next.getIdElement().toVersionless(); id = id.withServerBase(myBase, myContext.getResourceDefinition(next).getName()); entry.setFullUrl(id.getValue()); } } }