
Package org.hl7.fhir.r5.model
Class DateType
- All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement,Externalizable,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.YEARTemporalPrecisionEnum.MONTHTemporalPrecisionEnum.DAY
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.hl7.fhir.r5.model.Base
Base.ProfileSource, Base.ValidationInfo, Base.ValidationMode, Base.ValidationReason -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ca.uhn.fhir.model.api.TemporalPrecisionEnumThe default precision for this type -
Constructor Summary
ConstructorsConstructorDescriptionDateType()ConstructorDateType(int theYear, int theMonth, int theDay) Constructor which accepts a date value and uses theDEFAULT_PRECISIONfor this type.Constructor which accepts a date as a string in FHIR formatConstructor which accepts a date value and uses theDEFAULT_PRECISIONfor this type.Constructor which accepts a date value and uses theDEFAULT_PRECISIONfor this typeConstructor which accepts a date value and a precision value. -
Method Summary
Modifier and TypeMethodDescriptioncopy()fhirType()protected ca.uhn.fhir.model.api.TemporalPrecisionEnumReturns the default precision for this datatypebooleanstatic DateTypeCreates a new instance by parsing an HL7 v3 format date time stringstatic InstantTypetoday()Methods inherited from class org.hl7.fhir.r5.model.BaseDateTimeType
add, after, before, compareTimes, dateTimeValue, encode, equalsUsingFhirPathRules, fpValue, getDay, getHour, getMillis, getMinute, getMonth, getNanos, getPrecision, getSecond, getSecondsMilli, getTimeZone, getValueAsCalendar, getValueAsString, getYear, hasTime, isTimeZoneZulu, isToday, parse, setDay, setHour, setMillis, setMinute, setMonth, setNanos, setPrecision, setSecond, setTimeZone, setTimeZoneZulu, setValue, setValue, setValueAsString, setValueAsV3String, setYear, toCalendar, toHumanDisplay, toHumanDisplay, toHumanDisplayLocalTimezoneMethods inherited from class org.hl7.fhir.r5.model.PrimitiveType
asStringValue, canHavePrimitiveValue, equalsDeep, equalsShallow, forceStringValue, fromStringValue, getProperty, getTypesForProperty, getValue, getValueAsString, hashCode, hasPrimitiveValue, hasValue, isEmpty, isPrimitive, makeProperty, matches, primitiveValue, readExternal, removeChild, setProperty, setProperty, toString, typedCopy, updateStringValue, writeExternalMethods inherited from class org.hl7.fhir.r5.model.DataType
copyValues, getTranslation, isTranslatableMethods inherited from class org.hl7.fhir.r5.model.Element
addChild, addExtension, addExtension, addExtension, copyExtensions, copyNewExtensions, copyValues, getExtension, getExtensionByUrl, getExtensionByUrl, getExtensionFirstRep, getExtensionsByUrl, getExtensionsByUrl, getExtensionString, getExtensionString, getExtensionValue, getFHIRPublicationVersion, getId, getIdBase, getIdElement, getNamedProperty, getStandardsStatus, hasExtension, hasExtension, hasExtension, hasExtension, hasId, hasIdElement, isDisallowExtensions, listChildren, noExtensions, removeExtension, setDisallowExtensions, setExtension, setId, setIdBase, setIdElement, setStandardsStatusMethods inherited from class org.hl7.fhir.r5.model.Base
addDefinition, addFormatCommentsPost, addFormatCommentsPre, addValidationMessage, children, clearUserData, compareDeep, compareDeep, compareDeep, compareDeep, compareValues, compareValues, copyFormatComments, copyUserData, copyValues, equals, executeFunction, getChildByName, getChildValueByName, getFormatCommentsPost, getFormatCommentsPre, getNamedProperty, getUserData, getUserInt, getUserString, getValidationInfo, getValidationMessages, getXhtml, hasFormatComment, hasFormatCommentPost, hasFormatCommentPre, hasType, hasUserData, hasValidated, hasValidationInfo, hasValidationMessages, isBooleanPrimitive, isCopyUserData, isMetadataBased, isResource, listChildrenByName, listChildrenByName, setCopyUserData, setUserData, setUserDataINN, setXhtmlMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hl7.fhir.instance.model.api.IBase
getFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, setUserDataMethods inherited from interface org.hl7.fhir.instance.model.api.IBaseElement
getUserData, setUserDataMethods 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_PRECISIONfor this type -
DateType
Constructor which accepts a date value and a precision value. Valid precisions values for this type are:TemporalPrecisionEnum.YEARTemporalPrecisionEnum.MONTHTemporalPrecisionEnum.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
-
DateType
Constructor which accepts a date value and uses theDEFAULT_PRECISIONfor this type. -
DateType
Constructor which accepts a date value and uses theDEFAULT_PRECISIONfor this type.Use caution when using this constructor: The month is 0-indexed but the day is 1-indexed in order to match the bahaviour of the Java
Calendartype.- Parameters:
theYear- The year, e.g. 2015theMonth- The month, e.g. 0 for JanuarytheDay- The day (1 indexed) e.g. 1 for the first day of the month
-
-
Method Details
-
getDefaultPrecisionForDatatype
Returns the default precision for this datatype- Specified by:
getDefaultPrecisionForDatatypein classBaseDateTimeType- See Also:
-
copy
- Specified by:
copyin classPrimitiveType<Date>
-
today
-
parseV3
Creates a new instance by parsing an HL7 v3 format date time string -
fhirType
-
isDateTime
- Overrides:
isDateTimein classBaseDateTimeType- Returns:
- true if the type is date|dateTime|instant, and the primitive value is a date/time of some precision
-