@Override public String getValueAsString() { return getValue(); }
@Override public String toString() { return getValue(); }
/** * Gets the value(s) for <b>versionId</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted * </p> */ public String getVersionId() { return getVersionIdElement().getValue(); }
/** * Copies the value from the given IdDt to <code>this</code> IdDt. It is generally not neccesary to use this method but it is provided for consistency with the rest of the API. * * @deprecated */ @Deprecated //override deprecated method @Override public void setId(IdDt theId) { setValue(theId.getValue()); }
/** * Gets the value(s) for <b>identity</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * An internal reference to the definition of a mapping * </p> */ public String getIdentity() { return getIdentityElement().getValue(); }
/** * Gets the value(s) for <b>key</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality * </p> */ public String getKey() { return getKeyElement().getValue(); }
/** * Gets the value(s) for <b>identity</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * An internal reference to the definition of a mapping * </p> */ public String getIdentity() { return getIdentityElement().getValue(); }
@Override public boolean isEmpty() { return super.isBaseEmpty() && isBlank(getValue()); }
/** * Gets the value(s) for <b>key</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality * </p> */ public String getKey() { return getKeyElement().getValue(); }
@Override public void applyTo(IBaseResource theResouce) { if (theResouce == null) { throw new NullPointerException("theResource can not be null"); } else if (theResouce instanceof IResource) { ((IResource) theResouce).setId(new IdDt(getValue())); } else if (theResouce instanceof IAnyResource) { ((IAnyResource) theResouce).setId(getValue()); } else { throw new IllegalArgumentException("Unknown resource class type, does not implement IResource or extend Resource"); } }
@Override public String toString() { ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); b.append("resPid", myResource.getIdDt().toUnqualifiedVersionless().getValue()); b.append("paramName", myParamName); b.append("present", myPresent); return b.build(); }
@Override public <T extends IBaseResource> T vread(final Class<T> theType, IdDt theId) { if (theId.hasVersionIdPart() == false) { throw new IllegalArgumentException(myContext.getLocalizer().getMessage(I18N_NO_VERSION_ID_FOR_VREAD, theId.getValue())); } return doReadOrVRead(theType, theId, true, null, null, false, null, null, null, null); }
@Override String doGetValueAsQueryToken(FhirContext theContext) { if (isBlank(myId.getResourceType())) { return myId.getValue(); // e.g. urn:asdjd or 123 or cid:wieiuru or #1 } else { if (isBlank(getChain())) { return getResourceType() + "/" + myId.getIdPart(); } return myId.getIdPart(); } }
protected void expungeHistoricalVersion(Long theNextVersionId) { ResourceHistoryTable version = myResourceHistoryTableDao.findById(theNextVersionId).orElseThrow(IllegalArgumentException::new); ourLog.info("Deleting resource version {}", version.getIdDt().getValue()); myResourceHistoryTagDao.deleteAll(version.getTags()); myResourceHistoryTableDao.delete(version); }
protected void expungeHistoricalVersionsOfId(Long theResourceId, AtomicInteger theRemainingCount) { ResourceTable resource = myResourceTableDao.findById(theResourceId).orElseThrow(IllegalArgumentException::new); Pageable page = PageRequest.of(0, theRemainingCount.get()); Slice<Long> versionIds = myResourceHistoryTableDao.findForResourceId(page, resource.getId(), resource.getVersion()); ourLog.debug("Found {} versions of resource {} to expunge", versionIds.getNumberOfElements(), resource.getIdDt().getValue()); for (Long nextVersionId : versionIds) { expungeHistoricalVersion(nextVersionId); if (theRemainingCount.decrementAndGet() <= 0) { return; } } }
public static HttpGetClientInvocation createReadInvocation(FhirContext theContext, IIdType theId, String theResourceName) { return new HttpGetClientInvocation(theContext, new IdDt(theResourceName, theId.getIdPart()).getValue()); }
@Override public void reindex(T theResource, ResourceTable theEntity) { ourLog.debug("Indexing resource {} - PID {}", theEntity.getIdDt().getValue(), theEntity.getId()); if (theResource != null) { CURRENTLY_REINDEXING.put(theResource, Boolean.TRUE); } updateEntity(null, theResource, theEntity, theEntity.getDeleted(), true, false, theEntity.getUpdatedDate(), true, false); if (theResource != null) { CURRENTLY_REINDEXING.put(theResource, null); } }
private void populateBundleEntryFullUrl(IResource next, Entry entry) { if (next.getId().hasBaseUrl()) { entry.setFullUrl(next.getId().toVersionless().getValue()); } else { if (isNotBlank(myBase) && next.getId().hasIdPart()) { IdDt id = next.getId().toVersionless(); id = id.withServerBase(myBase, myContext.getResourceDefinition(next).getName()); entry.setFullUrl(id.getValue()); } } }