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>
public class DateType extends BaseDateTimeType
Represents a FHIR date datatype. Valid precisions values for this type are:TemporalPrecisionEnum.YEARTemporalPrecisionEnum.MONTHTemporalPrecisionEnum.DAY
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ca.uhn.fhir.model.api.TemporalPrecisionEnumDEFAULT_PRECISIONThe default precision for this type
-
Constructor Summary
Constructors Constructor Description DateType()ConstructorDateType(String theDate)Constructor which accepts a date as a string in FHIR formatDateType(Date theDate)Constructor which accepts a date value and uses theDEFAULT_PRECISIONfor this typeDateType(Date theDate, ca.uhn.fhir.model.api.TemporalPrecisionEnum thePrecision)Constructor which accepts a date value and a precision value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DateTypecopy()StringfhirType()protected ca.uhn.fhir.model.api.TemporalPrecisionEnumgetDefaultPrecisionForDatatype()Returns the default precision for this datatypestatic DateTypeparseV3(String theV3String)Creates a new instance by parsing an HL7 v3 format date time stringstatic InstantTypetoday()-
Methods inherited from class org.hl7.fhir.dstu2.model.BaseDateTimeType
add, after, before, encode, getPrecision, getTime, getTimeZone, 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, copyValues, getExtension, 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
-
-
-
-
Field Detail
-
DEFAULT_PRECISION
public static final ca.uhn.fhir.model.api.TemporalPrecisionEnum DEFAULT_PRECISION
The default precision for this type
-
-
Constructor Detail
-
DateType
public DateType()
Constructor
-
DateType
public DateType(Date theDate)
Constructor which accepts a date value and uses theDEFAULT_PRECISIONfor this type
-
DateType
public DateType(Date theDate, ca.uhn.fhir.model.api.TemporalPrecisionEnum thePrecision)
Constructor which accepts a date value and a precision value. Valid precisions values for this type are:TemporalPrecisionEnum.YEARTemporalPrecisionEnum.MONTHTemporalPrecisionEnum.DAY
- Throws:
ca.uhn.fhir.parser.DataFormatException- If the specified precision is not allowed for this type
-
-
Method Detail
-
getDefaultPrecisionForDatatype
protected ca.uhn.fhir.model.api.TemporalPrecisionEnum getDefaultPrecisionForDatatype()
Returns the default precision for this datatype- Specified by:
getDefaultPrecisionForDatatypein classBaseDateTimeType- See Also:
DEFAULT_PRECISION
-
copy
public DateType copy()
- Specified by:
copyin classPrimitiveType<Date>
-
today
public static InstantType today()
-
parseV3
public static DateType parseV3(String theV3String)
Creates a new instance by parsing an HL7 v3 format date time string
-
-