/** * Sets the value for <b>versionId</b> () * * <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 MetaDt setVersionId( String theId) { myVersionId = new IdDt(theId); return this; }
/** * Sets the value for <b>reference</b> (Relative, internal or absolute URL reference) * * <p> * <b>Definition:</b> * A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources * </p> */ public ResourceReferenceDt setReference( String theId) { myReference = new IdDt(theId); return this; }
@Override public IPatchExecutable withId(String theId) { if (theId == null) { throw new NullPointerException("theId can not be null"); } if (isBlank(theId)) { throw new NullPointerException("theId must not be blank and must contain an ID, found: " + theId); } myId = new IdDt(theId); return this; }
@Override public IAuthRuleFinished instance(String theId) { Validate.notBlank(theId, "theId must not be null or empty"); return instance(new IdDt(theId)); }
/** * Constructor which accepts a reference directly (this can be an ID, a partial/relative URL or a complete/absolute * URL) * * @param theId * The reference itself */ public ResourceReferenceDt(String theId) { setReference(new IdDt(theId)); }
@Override public IReadExecutable withIdAndVersion(String theId, String theVersion) { Validate.notBlank(theId, "The ID can not be blank"); myId = new IdDt(myType.getName(), theId, theVersion); return this; }
@Override public IReadExecutable withId(Long theId) { Validate.notNull(theId, "The ID can not be null"); myId = new IdDt(myType.getName(), theId); return this; }
@Override public IReadExecutable withUrl(String theUrl) { myId = new IdDt(theUrl); processUrl(); return this; }
@Override public <T extends IBaseResource> T vread(Class<T> theType, String theId, String theVersionId) { IdDt resId = new IdDt(toResourceName(theType), theId, theVersionId); return vread(theType, resId); }
@Override public IdDt getIdDt() { if (myForcedPid == null) { Long id = myResourceId; return new IdDt(myResourceType + '/' + id + '/' + Constants.PARAM_HISTORY + '/' + getVersion()); } else { return new IdDt( getResourceType() + '/' + getForcedId() + '/' + Constants.PARAM_HISTORY + '/' + getVersion()); } }
@Create public MethodOutcome create(@ResourceParam final Patient patient, @ConditionalUrlParam String theConditional) { // create the patient ... return new MethodOutcome(new IdDt(1L)).setCreated(true); }
@Override public IBaseResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition, String theServerBase) { StructureDefinition retVal = new StructureDefinition(); RuntimeResourceDefinition def = theRuntimeResourceDefinition; myId = def.getId(); if (StringUtils.isBlank(myId)) { myId = theRuntimeResourceDefinition.getName().toLowerCase(); } retVal.setId(new IdDt(myId)); return retVal; }
@Override public IdDt getIdDt() { if (getForcedId() == null) { Long id = myId; return new IdDt(myResourceType + '/' + id + '/' + Constants.PARAM_HISTORY + '/' + myVersion); } else { return new IdDt(getForcedId().getResourceType() + '/' + getForcedId().getForcedId() + '/' + Constants.PARAM_HISTORY + '/' + myVersion); } }
/** * Returns a new IdDt containing this IdDt's values but with no server base URL if one is present in this IdDt. For example, if this IdDt contains the ID "http://foo/Patient/1", this method will * return a new IdDt containing ID "Patient/1". */ @Override public IdDt toUnqualified() { if (isLocal() || isUrn()) { return new IdDt(getValueAsString()); } return new IdDt(getResourceType(), getIdPart(), getVersionIdPart()); }
@Override public IdDt getIdDt() { if (getForcedId() == null) { Long id = myResourceId; return new IdDt(myResourceType + '/' + id + '/' + Constants.PARAM_HISTORY + '/' + getVersion()); } else { return new IdDt(getForcedId().getResourceType() + '/' + getForcedId().getForcedId() + '/' + Constants.PARAM_HISTORY + '/' + getVersion()); } }
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; }