public class IdDt extends UriDt implements IIdType
Description: A whole number in the range 0 to 2^64-1 (optionally represented in hex), a uuid, an oid, or any other combination of lowercase letters, numerals, "-" and ".", with a length limit of 36 characters.
regex: [a-z-Z0-9\-\.]{1,36}
| Constructor and Description |
|---|
IdDt()
Create a new empty ID
|
IdDt(BigDecimal thePid)
Create a new ID, using a BigDecimal input.
|
IdDt(long theId)
Create a new ID using a long
|
IdDt(String theValue)
Create a new ID using a string.
|
IdDt(String theResourceType,
BigDecimal theIdPart)
Constructor
|
IdDt(String theResourceType,
Long theIdPart)
Constructor
|
IdDt(String theResourceType,
String theId)
Constructor
|
IdDt(String theResourceType,
String theId,
String theVersionId)
Constructor
|
IdDt(String theBaseUrl,
String theResourceType,
String theId,
String theVersionId)
Constructor
|
IdDt(UriDt theUrl)
Creates an ID based on a given URL
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyTo(IBaseResource theResouce) |
BigDecimal |
asBigDecimal()
Deprecated.
Use
getIdPartAsBigDecimal() instead (this method was deprocated because its name is ambiguous) |
boolean |
equals(Object theArg0) |
boolean |
equalsIgnoreBase(IdDt theId)
Returns true if this IdDt matches the given IdDt in terms of resource type and ID, but ignores the URL base
|
String |
getBaseUrl()
Returns the portion of this resource ID which corresponds to the server base URL.
|
String |
getIdPart()
Returns only the logical ID part of this ID.
|
BigDecimal |
getIdPartAsBigDecimal()
Returns the unqualified portion of this ID as a big decimal, or
null if the value is null |
Long |
getIdPartAsLong()
Returns the unqualified portion of this ID as a
Long, or null if the value is null |
String |
getResourceType() |
String |
getValue()
Returns the value of this ID.
|
String |
getValueAsString() |
String |
getVersionIdPart() |
Long |
getVersionIdPartAsLong()
Returns the version ID part of this ID (e.g.
|
boolean |
hasBaseUrl()
Returns true if this ID has a base url
|
int |
hashCode() |
boolean |
hasIdPart()
Returns
true if this ID contains an actual ID part. |
boolean |
hasResourceType() |
boolean |
hasVersionIdPart() |
boolean |
isAbsolute()
Returns
true if this ID contains an absolute URL (in other words, a URL starting with "http://" or "https://" |
boolean |
isEmpty() |
boolean |
isIdPartValid()
Returns
true if the ID part of this object is valid according to the FHIR rules for valid IDs. |
boolean |
isIdPartValidLong()
Returns
true if the ID part of this object contains
only numbers |
boolean |
isLocal()
Returns
true if the ID is a local reference (in other words,
it begins with the '#' character) |
static boolean |
isValidLong(String id) |
boolean |
isVersionIdPartValidLong()
Returns
true if the version ID part of this object contains
only numbers |
static IdDt |
newRandomUuid()
Construct a new ID with with form "urn:uuid:[UUID]" where [UUID] is a new, randomly
created UUID generated by
UUID.randomUUID() |
static IdDt |
of(IBaseResource theResouce)
Retrieves the ID from the given resource instance
|
void |
setId(IdDt theId)
Deprecated.
|
IIdType |
setParts(String theBaseUrl,
String theResourceType,
String theIdPart,
String theVersionIdPart)
Sets the value of this ID by combining all of the individual parts.
|
IdDt |
setValue(String theValue)
Set the value
|
void |
setValueAsString(String theValue)
Set the value
|
String |
toString() |
IdDt |
toUnqualified()
Returns a new IdDt containing this IdDt's values but with no server base URL if one is present in this IdDt.
|
IdDt |
toUnqualifiedVersionless() |
IdDt |
toVersionless() |
IdDt |
withResourceType(String theResourceName)
Returns a copy of this object, but with a different
resource type
(or if this object does not have a resource type currently, returns a copy of this object with
the given resource type). |
IdDt |
withServerBase(String theServerBase,
String theResourceType)
Returns a view of this ID as a fully qualified URL, given a server base and resource name (which will only be used if the ID does not already contain those respective parts).
|
IdDt |
withVersion(String theVersion)
Creates a new instance of this ID which is identical, but refers to the specific version of this resource ID noted by theVersion.
|
hasValue, readExternal, updateStringValue, writeExternalgetElementSpecificId, getId, setElementSpecificId, setIdaddUndeclaredExtension, addUndeclaredExtension, addUndeclaredExtension, getAllUndeclaredExtensions, getFormatCommentsPost, getFormatCommentsPre, getUndeclaredExtensions, getUndeclaredExtensionsByUrl, getUndeclaredModifierExtensions, hasFormatComment, isBaseEmptyclone, finalize, getClass, notify, notifyAll, wait, wait, waithasValuefhirType, getFormatCommentsPost, getFormatCommentsPre, hasFormatCommentpublic IdDt()
public IdDt(BigDecimal thePid)
BigDecimal.toPlainString() to generate the string representation.public IdDt(long theId)
public IdDt(String theValue)
Description: A whole number in the range 0 to 2^64-1 (optionally represented in hex), a uuid, an oid, or any other combination of lowercase letters, numerals, "-" and ".", with a length limit of 36 characters.
regex: [a-z0-9\-\.]{1,36}
public IdDt(String theResourceType, BigDecimal theIdPart)
theResourceType - The resource type (e.g. "Patient")theIdPart - The ID (e.g. "123")public IdDt(String theResourceType, Long theIdPart)
theResourceType - The resource type (e.g. "Patient")theIdPart - The ID (e.g. "123")public IdDt(String theResourceType, String theId)
theResourceType - The resource type (e.g. "Patient")theId - The ID (e.g. "123")public IdDt(String theResourceType, String theId, String theVersionId)
theResourceType - The resource type (e.g. "Patient")theId - The ID (e.g. "123")theVersionId - The version ID ("e.g. "456")public IdDt(String theBaseUrl, String theResourceType, String theId, String theVersionId)
theBaseUrl - The server base URL (e.g. "http://example.com/fhir")theResourceType - The resource type (e.g. "Patient")theId - The ID (e.g. "123")theVersionId - The version ID ("e.g. "456")public void applyTo(IBaseResource theResouce)
@Deprecated public BigDecimal asBigDecimal()
getIdPartAsBigDecimal() instead (this method was deprocated because its name is ambiguous)public boolean equalsIgnoreBase(IdDt theId)
public String getBaseUrl()
http://example.com/fhir/Patient/123 the base URL would be
http://example.com/fhir.
This method may return null if the ID contains no base (e.g. "Patient/123")
getBaseUrl in interface IIdTypepublic String getIdPart()
public BigDecimal getIdPartAsBigDecimal()
null if the value is nullNumberFormatException - If the value is not a valid BigDecimalpublic Long getIdPartAsLong()
Long, or null if the value is nullgetIdPartAsLong in interface IIdTypeNumberFormatException - If the value is not a valid Longpublic String getResourceType()
getResourceType in interface IIdTypepublic String getValue()
getIdPart() to get just the ID portion.getValue in interface IPrimitiveDatatype<String>getValue in interface IIdTypegetValue in interface IPrimitiveType<String>getValue in class BasePrimitive<String>getIdPart()public IdDt setValue(String theValue) throws DataFormatException
Description: A whole number in the range 0 to 2^64-1 (optionally represented in hex), a uuid, an oid, or any other combination of lowercase letters, numerals, "-" and ".", with a length limit of 36 characters.
regex: [a-z0-9\-\.]{1,36}
setValue in interface IPrimitiveDatatype<String>setValue in interface IIdTypesetValue in interface IPrimitiveType<String>setValue in class BasePrimitive<String>DataFormatExceptionpublic String getValueAsString()
getValueAsString in interface IPrimitiveDatatype<String>getValueAsString in interface IPrimitiveType<String>getValueAsString in class BasePrimitive<String>public void setValueAsString(String theValue) throws DataFormatException
Description: A whole number in the range 0 to 2^64-1 (optionally represented in hex), a uuid, an oid, or any other combination of lowercase letters, numerals, "-" and ".", with a length limit of 36 characters.
regex: [a-z0-9\-\.]{1,36}
setValueAsString in interface IPrimitiveDatatype<String>setValueAsString in interface IPrimitiveType<String>setValueAsString in class BasePrimitive<String>DataFormatExceptionpublic String getVersionIdPart()
getVersionIdPart in interface IIdTypepublic Long getVersionIdPartAsLong()
IIdTypeLong.getVersionIdPartAsLong in interface IIdTypepublic boolean hasBaseUrl()
hasBaseUrl in interface IIdTypegetBaseUrl()public boolean hasIdPart()
IIdTypetrue if this ID contains an actual ID part. For example, the ID part is
the '123' in the following ID: http://example.com/fhir/Patient/123/_history/55public boolean hasResourceType()
hasResourceType in interface IIdTypepublic boolean hasVersionIdPart()
hasVersionIdPart in interface IIdTypepublic boolean isAbsolute()
true if this ID contains an absolute URL (in other words, a URL starting with "http://" or "https://"isAbsolute in interface IIdTypepublic boolean isEmpty()
public boolean isIdPartValid()
IIdTypetrue if the ID part of this object is valid according to the FHIR rules for valid IDs.
The FHIR specification states:
Any combination of upper or lower case ASCII letters ('A'..'Z', and 'a'..'z', numerals ('0'..'9'), '-' and '.', with a length limit of 64 characters. (This might be an integer, an un-prefixed OID, UUID or any other identifier pattern that meets these constraints.) regex: [A-Za-z0-9\-\.]{1,64}
isIdPartValid in interface IIdTypepublic boolean isIdPartValidLong()
IIdTypetrue if the ID part of this object contains
only numbersisIdPartValidLong in interface IIdTypepublic boolean isLocal()
true if the ID is a local reference (in other words,
it begins with the '#' character)public boolean isVersionIdPartValidLong()
IIdTypetrue if the version ID part of this object contains
only numbersisVersionIdPartValidLong in interface IIdType@Deprecated public void setId(IdDt theId)
this IdDt. It is generally not neccesary to use this method but it is provided for consistency with the rest of the API.setId in interface IIdentifiableElementsetId in class BaseIdentifiableElementpublic IIdType setParts(String theBaseUrl, String theResourceType, String theIdPart, String theVersionIdPart)
IIdType
Required parameters: The following rules apply to the parameters of this method (in this case, populated means
a non-empty string and not populated means null or an empty string)
public String toString()
toString in class BasePrimitive<String>public IdDt toUnqualified()
toUnqualified in interface IIdTypepublic IdDt toUnqualifiedVersionless()
toUnqualifiedVersionless in interface IIdTypepublic IdDt toVersionless()
toVersionless in interface IIdTypepublic IdDt withResourceType(String theResourceName)
IIdTyperesource type
(or if this object does not have a resource type currently, returns a copy of this object with
the given resource type).
Note that if this object represents a local reference (e.g. #foo) or
a URN (e.g. urn:oid:1.2.3.4) this method will simply return a copy
of this object with no modifications.
withResourceType in interface IIdTypepublic IdDt withServerBase(String theServerBase, String theResourceType)
withServerBase in interface IIdTypetheServerBase - The server base (e.g. "http://example.com/fhir")theResourceType - The resource name (e.g. "Patient")public IdDt withVersion(String theVersion)
withVersion in interface IIdTypetheVersion - The actual version string, e.g. "1". If theVersion is blank or null, returns the same as toVersionless()}public static boolean isValidLong(String id)
public static IdDt newRandomUuid()
UUID.randomUUID()public static IdDt of(IBaseResource theResouce)
Copyright © 2014–2019 University Health Network. All rights reserved.