Package org.hl7.fhir.r4.model
Class DateTimeType
java.lang.Object
org.hl7.fhir.r4.model.Base
org.hl7.fhir.r4.model.Element
org.hl7.fhir.r4.model.Type
org.hl7.fhir.r4.model.PrimitiveType<Date>
org.hl7.fhir.r4.model.BaseDateTimeType
org.hl7.fhir.r4.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>
Represents a FHIR dateTime datatype. Valid precisions values for this type
are:
TemporalPrecisionEnum.YEAR
TemporalPrecisionEnum.MONTH
TemporalPrecisionEnum.DAY
TemporalPrecisionEnum.SECOND
TemporalPrecisionEnum.MILLI
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ca.uhn.fhir.model.api.TemporalPrecisionEnum
The default precision for this type -
Constructor Summary
ConstructorDescriptionConstructorDateTimeType
(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
Modifier and TypeMethodDescriptioncopy()
fhirType()
getAsV3()
protected ca.uhn.fhir.model.api.TemporalPrecisionEnum
Returns the default precision for this datatypeint
int
getTzMin()
boolean
boolean
static DateTimeType
now()
Returns a new instance of DateTimeType with the current system time and SECOND precision and the system local time zonestatic DateTimeType
Creates a new instance by parsing an HL7 v3 format date time stringstatic DateTimeType
today()
Methods inherited from class org.hl7.fhir.r4.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, toHumanDisplayLocalTimezone
Methods inherited from class org.hl7.fhir.r4.model.PrimitiveType
asStringValue, equalsDeep, equalsShallow, forceStringValue, fromStringValue, getProperty, getTypesForProperty, getValue, getValueAsString, hashCode, hasPrimitiveValue, hasValue, isEmpty, isPrimitive, makeProperty, primitiveValue, readExternal, removeChild, setProperty, setProperty, toString, typedCopy, updateStringValue, writeExternal
Methods inherited from class org.hl7.fhir.r4.model.Element
addChild, addExtension, addExtension, addExtension, copyExtensions, copyNewExtensions, copyValues, getExtension, getExtensionByUrl, getExtensionFirstRep, getExtensionsByUrl, getExtensionsByUrl, getExtensionString, getId, getIdBase, getIdElement, getNamedProperty, hasExtension, hasExtension, hasExtension, hasExtension, hasId, hasIdElement, isDisallowExtensions, listChildren, noExtensions, removeExtension, setDisallowExtensions, setExtension, setId, setIdBase, setIdElement
Methods inherited from class org.hl7.fhir.r4.model.Base
castToAddress, castToAnnotation, castToAttachment, castToBase64Binary, castToBoolean, castToCanonical, castToCode, castToCodeableConcept, castToCoding, castToContactDetail, castToContactPoint, castToContributor, castToDataRequirement, castToDate, castToDateTime, castToDecimal, castToDosage, castToDuration, castToElementDefinition, castToExpression, castToExtension, castToHumanName, castToId, castToIdentifier, castToInstant, castToInteger, castToMarkdown, castToMarketingStatus, castToMeta, castToMoney, castToNarrative, castToOid, castToParameterDefinition, castToPeriod, castToPopulation, castToPositiveInt, castToProdCharacteristic, castToProductShelfLife, castToQuantity, castToRange, castToRatio, castToReference, castToRelatedArtifact, castToResource, castToSampledData, castToSignature, castToSimpleQuantity, castToString, castToSubstanceAmount, castToTime, castToTiming, castToTriggerDefinition, castToType, castToUnsignedInt, castToUri, castToUrl, castToUsageContext, castToXhtml, castToXhtmlString, children, clearUserData, compareDeep, compareDeep, compareDeep, compareDeep, compareValues, compareValues, copyValues, equals, getChildByName, getFormatCommentsPost, getFormatCommentsPre, getNamedProperty, getUserData, getUserInt, getUserString, getXhtml, 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
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
-
DateTimeType
public DateTimeType()Constructor -
DateTimeType
Create a new DateTimeDt with seconds precision and the local time zone -
DateTimeType
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
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
Constructor
-
-
Method Details
-
now
Returns a new instance of DateTimeType with the current system time and SECOND precision and the system local time zone -
getDefaultPrecisionForDatatype
Returns the default precision for this datatype- Specified by:
getDefaultPrecisionForDatatype
in classBaseDateTimeType
- See Also:
-
copy
- Specified by:
copy
in classPrimitiveType<Date>
-
parseV3
Creates a new instance by parsing an HL7 v3 format date time string -
today
-
getTzSign
-
getTzHour
-
getTzMin
-
fhirType
-
getAsV3
-
isDateTime
- Overrides:
isDateTime
in classBaseDateTimeType
-