
Package org.hl7.fhir.dstu2.model
Class DateType
- All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement
,Serializable
,org.hl7.fhir.instance.model.api.IBase
,org.hl7.fhir.instance.model.api.IBaseDatatype
,org.hl7.fhir.instance.model.api.IBaseElement
,org.hl7.fhir.instance.model.api.IBaseHasExtensions
,org.hl7.fhir.instance.model.api.IPrimitiveType<Date>
Represents a FHIR date datatype. Valid precisions values for this type are:
TemporalPrecisionEnum.YEAR
TemporalPrecisionEnum.MONTH
TemporalPrecisionEnum.DAY
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ca.uhn.fhir.model.api.TemporalPrecisionEnum
The default precision for this type -
Constructor Summary
ConstructorsConstructorDescriptionDateType()
ConstructorConstructor which accepts a date as a string in FHIR formatConstructor which accepts a date value and uses theDEFAULT_PRECISION
for this typeConstructor which accepts a date value and a precision value. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
fhirType()
protected ca.uhn.fhir.model.api.TemporalPrecisionEnum
Returns the default precision for this datatypestatic DateType
Creates a new instance by parsing an HL7 v3 format date time stringstatic InstantType
today()
Methods inherited from class org.hl7.fhir.dstu2.model.BaseDateTimeType
add, after, before, encode, getPrecision, getTime, getTimeZone, getValueAsString, isTimeZoneZulu, isToday, parse, setOffsetMinutes, setPrecision, setTimeZone, setTimeZoneZulu, setValue, setValue, setValueAsString, setValueAsV3String, toCalendar, toHumanDisplay, toHumanDisplayLocalTimezone
Methods inherited from class org.hl7.fhir.dstu2.model.PrimitiveType
asStringValue, equalsDeep, equalsShallow, fromStringValue, getValue, getValueAsString, hashCode, hasValue, isEmpty, isPrimitive, primitiveValue, toString, typedCopy, updateStringValue
Methods inherited from class org.hl7.fhir.dstu2.model.Element
addChild, addExtension, addExtension, addExtension, copyValues, getExtension, getExtensionByUrl, getExtensionsByUrl, getExtensionString, getId, getIdElement, hasExtension, hasExtension, hasId, hasIdElement, listChildren, setId, setIdElement, setProperty
Methods inherited from class org.hl7.fhir.dstu2.model.Base
castToAddress, castToAnnotation, castToAttachment, castToBase64Binary, castToBoolean, castToCode, castToCodeableConcept, castToCoding, castToContactPoint, castToDate, castToDateTime, castToDecimal, castToDuration, castToElementDefinition, castToExtension, castToHumanName, castToId, castToIdentifier, castToInstant, castToInteger, castToMarkdown, castToMeta, castToMoney, castToNarrative, castToOid, castToPeriod, castToPositiveInt, castToQuantity, castToRange, castToRatio, castToReference, castToResource, castToSampledData, castToSignature, castToSimpleQuantity, castToString, castToTime, castToTiming, castToUnsignedInt, castToUri, children, compareDeep, compareDeep, compareDeep, compareValues, compareValues, equals, getChildByName, getFormatCommentsPost, getFormatCommentsPre, getUserData, getUserInt, getUserString, hasFormatComment, hasType, hasUserData, isMetadataBased, listChildrenByName, setUserData, setUserDataINN
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.hl7.fhir.instance.model.api.IBase
getFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, setUserData
Methods inherited from interface org.hl7.fhir.instance.model.api.IBaseElement
getUserData, setUserData
Methods inherited from interface org.hl7.fhir.instance.model.api.IBaseHasExtensions
addExtension, getExtension, hasExtension
-
Field Details
-
DEFAULT_PRECISION
The default precision for this type
-
-
Constructor Details
-
DateType
public DateType()Constructor -
DateType
Constructor which accepts a date value and uses theDEFAULT_PRECISION
for this type -
DateType
Constructor which accepts a date value and a precision value. Valid precisions values for this type are:TemporalPrecisionEnum.YEAR
TemporalPrecisionEnum.MONTH
TemporalPrecisionEnum.DAY
- Throws:
DataFormatException
- If the specified precision is not allowed for this type
-
DateType
Constructor which accepts a date as a string in FHIR format- Throws:
DataFormatException
- If the precision in the date string is not allowed for this type
-
-
Method Details
-
getDefaultPrecisionForDatatype
Returns the default precision for this datatype- Specified by:
getDefaultPrecisionForDatatype
in classBaseDateTimeType
- See Also:
-
copy
- Specified by:
copy
in classPrimitiveType<Date>
-
today
-
parseV3
Creates a new instance by parsing an HL7 v3 format date time string -
fhirType
-