Package ca.uhn.hl7v2.model.primitive
Class DT
java.lang.Object
ca.uhn.hl7v2.model.AbstractType
ca.uhn.hl7v2.model.AbstractPrimitive
ca.uhn.hl7v2.model.primitive.DT
- All Implemented Interfaces:
Primitive,Type,Visitable,Serializable
Represents an HL7 DT (date) datatype.
- Version:
- $Revision: 1.1 $ updated on $Date: 2007-02-19 02:24:51 $ by $Author: jamesagnew $
- Author:
- Neal Acharya, Bryan Tripp
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetDay()Returns the day as an integer.intgetMonth()Returns the month as an integer.getValue()Returns a String representation of the value of this field.intgetYear()Returns the year as an integer.voidSets the value of this Primitive, first performing validation as specified bygetMessage().getValidationContext().voidsetYearMonthDayPrecision(int yr, int mnth, int dy) voidsetYearMonthPrecision(int yr, int mnth) voidsetYearPrecision(int yr) Methods inherited from class ca.uhn.hl7v2.model.AbstractPrimitive
accept, clear, encode, isEmpty, parse, toStringMethods inherited from class ca.uhn.hl7v2.model.AbstractType
getExtraComponents, getMessage, getName, provideLocationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ca.uhn.hl7v2.model.Type
getExtraComponents, getMessage, getNameMethods inherited from interface ca.uhn.hl7v2.model.Visitable
provideLocation
-
Constructor Details
-
DT
- Parameters:
theMessage- message to which this Type belongs
-
-
Method Details
-
setValue
Description copied from class:AbstractPrimitiveSets the value of this Primitive, first performing validation as specified bygetMessage().getValidationContext(). No validation is performed if getMessage() returns null.Note: as of the next HAPI release, the ValidationContext will be retrieved from getParser().getValidationContext(), which ultimately is the ValidationContext of the active HapiContext.
- Specified by:
setValuein interfacePrimitive- Overrides:
setValuein classAbstractPrimitive- Parameters:
theValue- the value to be set- Throws:
DataTypeException- if the value is incorrectly formatted and either validation is enabled for this primitive or detail setters / getters have been called, forcing further parsing.- See Also:
-
getValue
Description copied from interface:PrimitiveReturns a String representation of the value of this field.- Specified by:
getValuein interfacePrimitive- Overrides:
getValuein classAbstractPrimitive- Returns:
- a String representation of the value of this field
- See Also:
-
setYearPrecision
- Throws:
DataTypeException- if the value is incorrectly formatted. If validation is enabled, this exception should be thrown at setValue(), but if not, detailed parsing may be deferred until this method is called.- See Also:
-
setYearMonthPrecision
- Throws:
DataTypeException- if the value is incorrectly formatted. If validation is enabled, this exception should be thrown at setValue(), but if not, detailed parsing may be deferred until this method is called.- See Also:
-
setYearMonthDayPrecision
- Throws:
DataTypeException- if the value is incorrectly formatted. If validation is enabled, this exception should be thrown at setValue(), but if not, detailed parsing may be deferred until this method is called.- See Also:
-
getYear
Returns the year as an integer.- Throws:
DataTypeException- if the value is incorrectly formatted. If validation is enabled, this exception should be thrown at setValue(), but if not, detailed parsing may be deferred until this method is called.
-
getMonth
Returns the month as an integer.- Throws:
DataTypeException- if the value is incorrectly formatted. If validation is enabled, this exception should be thrown at setValue(), but if not, detailed parsing may be deferred until this method is called.
-
getDay
Returns the day as an integer.- Throws:
DataTypeException- if the value is incorrectly formatted. If validation is enabled, this exception should be thrown at setValue(), but if not, detailed parsing may be deferred until this method is called.
-