public class DateDt extends BaseDateTimeDt
Note on using Java Date objects: This type stores the date as a Java Date. Note that the Java Date has more precision (millisecond precision), and does not store a timezone. As such, it could potentially cause issues. For example, if a Date contains the number of milliseconds at midnight in a timezone across the date line from your location, it might refer to a different date than intended.
As such, it is recommended to use the Calendar or int,int,int constructors
| Modifier and Type | Field and Description |
|---|---|
static TemporalPrecisionEnum |
DEFAULT_PRECISION
The default precision for this type
|
| Constructor and Description |
|---|
DateDt()
Constructor
|
DateDt(Calendar theCalendar)
Constructor which accepts a date value and uses the
DEFAULT_PRECISION for this type. |
DateDt(Date theDate)
Constructor which accepts a date value and uses the
DEFAULT_PRECISION for this type. |
DateDt(Date theDate,
TemporalPrecisionEnum thePrecision)
Constructor which accepts a date value and a precision value.
|
DateDt(int theYear,
int theMonth,
int theDay)
Constructor which accepts a date value and uses the
DEFAULT_PRECISION for this type. |
DateDt(String theDate)
Constructor which accepts a date as a string in FHIR format
|
| Modifier and Type | Method and Description |
|---|---|
protected TemporalPrecisionEnum |
getDefaultPrecisionForDatatype()
Returns the default precision for this datatype
|
protected boolean |
isPrecisionAllowed(TemporalPrecisionEnum thePrecision)
To be implemented by subclasses to indicate whether the given precision is allowed by this type
|
encode, getDay, getHour, getMillis, getMinute, getMonth, getNanos, getPrecision, getSecond, getTimeZone, getValueAsCalendar, getYear, isTimeZoneZulu, isToday, parse, setDay, setHour, setMillis, setMinute, setMonth, setNanos, setPrecision, setSecond, setTimeZone, setTimeZoneZulu, setValue, setValue, setValueAsString, setYear, toHumanDisplay, toHumanDisplayLocalTimezoneequals, getValue, getValueAsString, hashCode, hasValue, isEmpty, readExternal, toString, updateStringValue, writeExternalgetElementSpecificId, getId, setElementSpecificId, setId, setIdaddUndeclaredExtension, addUndeclaredExtension, addUndeclaredExtension, getAllUndeclaredExtensions, getFormatCommentsPost, getFormatCommentsPre, getUndeclaredExtensions, getUndeclaredExtensionsByUrl, getUndeclaredModifierExtensions, hasFormatComment, isBaseEmptyclone, finalize, getClass, notify, notifyAll, wait, wait, waitfhirType, getFormatCommentsPost, getFormatCommentsPre, hasFormatCommentpublic static final TemporalPrecisionEnum DEFAULT_PRECISION
public DateDt()
public DateDt(Calendar theCalendar)
DEFAULT_PRECISION for this type.public DateDt(Date theDate)
DEFAULT_PRECISION for this type.
Please see the note on timezones on the class documentation for considerations
when using this constructor!public DateDt(Date theDate, TemporalPrecisionEnum thePrecision)
class documentation for considerations
when using this constructor!DataFormatException - If the specified precision is not allowed for this typepublic DateDt(int theYear, int theMonth, int theDay)
DEFAULT_PRECISION for this type.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 monthpublic DateDt(String theDate)
DataFormatException - If the precision in the date string is not allowed for this typeprotected TemporalPrecisionEnum getDefaultPrecisionForDatatype()
getDefaultPrecisionForDatatype in class BaseDateTimeDtDEFAULT_PRECISIONprotected boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision)
BaseDateTimeDtisPrecisionAllowed in class BaseDateTimeDtCopyright © 2014–2019 University Health Network. All rights reserved.