
Package org.hl7.fhir.dstu3.model
Class DateTimeType
- java.lang.Object
-
- org.hl7.fhir.dstu3.model.Base
-
- org.hl7.fhir.dstu3.model.Element
-
- org.hl7.fhir.dstu3.model.Type
-
- org.hl7.fhir.dstu3.model.PrimitiveType<Date>
-
- org.hl7.fhir.dstu3.model.BaseDateTimeType
-
- org.hl7.fhir.dstu3.model.DateTimeType
-
- 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>
public class DateTimeType extends BaseDateTimeType
Represents a FHIR dateTime datatype. Valid precisions values for this type are:TemporalPrecisionEnum.YEAR
TemporalPrecisionEnum.MONTH
TemporalPrecisionEnum.DAY
TemporalPrecisionEnum.SECOND
TemporalPrecisionEnum.MILLI
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ca.uhn.fhir.model.api.TemporalPrecisionEnum
DEFAULT_PRECISION
The default precision for this type
-
Constructor Summary
Constructors Constructor Description DateTimeType()
ConstructorDateTimeType(String theValue)
Create a new instance using a string date/timeDateTimeType(Calendar theCalendar)
ConstructorDateTimeType(Date theDate)
Create a new DateTimeDt with seconds precision and the local time zoneDateTimeType(Date theDate, ca.uhn.fhir.model.api.TemporalPrecisionEnum thePrecision)
Constructor which accepts a date value and a precision value.DateTimeType(Date theDate, ca.uhn.fhir.model.api.TemporalPrecisionEnum thePrecision, TimeZone theTimezone)
Constructor which accepts a date value, precision value, and time zone.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DateTimeType
copy()
String
fhirType()
protected ca.uhn.fhir.model.api.TemporalPrecisionEnum
getDefaultPrecisionForDatatype()
Returns the default precision for this datatypeint
getTzHour()
int
getTzMin()
boolean
getTzSign()
static DateTimeType
now()
Returns a new instance of DateTimeType with the current system time and SECOND precision and the system local time zonestatic DateTimeType
parseV3(String theV3String)
Creates a new instance by parsing an HL7 v3 format date time stringstatic DateTimeType
today()
-
Methods inherited from class org.hl7.fhir.dstu3.model.BaseDateTimeType
add, after, before, 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, setValueAsV3String, setYear, toCalendar, toHumanDisplay, toHumanDisplayLocalTimezone
-
Methods inherited from class org.hl7.fhir.dstu3.model.PrimitiveType
asStringValue, equalsDeep, equalsShallow, fromStringValue, getProperty, getValue, getValueAsString, hashCode, hasPrimitiveValue, hasValue, isEmpty, isPrimitive, primitiveValue, readExternal, setProperty, setProperty, toString, typedCopy, updateStringValue, writeExternal
-
Methods inherited from class org.hl7.fhir.dstu3.model.Element
addChild, addExtension, addExtension, addExtension, copyValues, getExtension, getExtensionFirstRep, getExtensionsByUrl, getExtensionString, getId, getIdBase, getIdElement, getNamedProperty, getTypesForProperty, hasExtension, hasExtension, hasId, hasIdElement, listChildren, makeProperty, setExtension, setId, setIdBase, setIdElement
-
Methods inherited from class org.hl7.fhir.dstu3.model.Base
castToAddress, castToAnnotation, castToAttachment, castToBase64Binary, castToBoolean, castToCode, castToCodeableConcept, castToCoding, castToContactDetail, castToContactPoint, castToContributor, castToDataRequirement, castToDate, castToDateTime, castToDecimal, castToDosage, castToDuration, castToElementDefinition, castToExtension, castToHumanName, castToId, castToIdentifier, castToInstant, castToInteger, castToMarkdown, castToMeta, castToMoney, castToNarrative, castToOid, castToParameterDefinition, castToPeriod, castToPositiveInt, castToQuantity, castToRange, castToRatio, castToReference, castToRelatedArtifact, castToResource, castToSampledData, castToSignature, castToSimpleQuantity, castToString, castToTime, castToTiming, castToTriggerDefinition, castToType, castToUnsignedInt, castToUri, castToUsageContext, castToXhtml, castToXhtmlString, children, clearUserData, compareDeep, compareDeep, compareDeep, compareValues, compareValues, equals, getChildByName, getFormatCommentsPost, getFormatCommentsPre, getNamedProperty, getUserData, getUserInt, getUserString, hasFormatComment, hasType, hasUserData, isBooleanPrimitive, isMetadataBased, isResource, listChildrenByName, 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
-
DateTimeType
public DateTimeType()
Constructor
-
DateTimeType
public DateTimeType(Date theDate)
Create a new DateTimeDt with seconds precision and the local time zone
-
DateTimeType
public DateTimeType(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.YEAR
TemporalPrecisionEnum.MONTH
TemporalPrecisionEnum.DAY
TemporalPrecisionEnum.SECOND
TemporalPrecisionEnum.MILLI
- Throws:
DataFormatException
- If the specified precision is not allowed for this type
-
DateTimeType
public DateTimeType(String theValue)
Create a new instance using a string date/time- Throws:
DataFormatException
- If the specified precision is not allowed for this type
-
DateTimeType
public DateTimeType(Date theDate, ca.uhn.fhir.model.api.TemporalPrecisionEnum thePrecision, TimeZone theTimezone)
Constructor which accepts a date value, precision value, and time zone. Valid precisions values for this type are:TemporalPrecisionEnum.YEAR
TemporalPrecisionEnum.MONTH
TemporalPrecisionEnum.DAY
TemporalPrecisionEnum.SECOND
TemporalPrecisionEnum.MILLI
-
DateTimeType
public DateTimeType(Calendar theCalendar)
Constructor
-
-
Method Detail
-
now
public static DateTimeType now()
Returns a new instance of DateTimeType with the current system time and SECOND precision and the system local time zone
-
getDefaultPrecisionForDatatype
protected ca.uhn.fhir.model.api.TemporalPrecisionEnum getDefaultPrecisionForDatatype()
Returns the default precision for this datatype- Specified by:
getDefaultPrecisionForDatatype
in classBaseDateTimeType
- See Also:
DEFAULT_PRECISION
-
copy
public DateTimeType copy()
- Specified by:
copy
in classPrimitiveType<Date>
-
parseV3
public static DateTimeType parseV3(String theV3String)
Creates a new instance by parsing an HL7 v3 format date time string
-
today
public static DateTimeType today()
-
getTzSign
public boolean getTzSign()
-
getTzHour
public int getTzHour()
-
getTzMin
public int getTzMin()
-
-