ca.uhn.hl7v2.model.primitive
Class DT

java.lang.Object
  extended by ca.uhn.hl7v2.model.AbstractType
      extended by ca.uhn.hl7v2.model.AbstractPrimitive
          extended by ca.uhn.hl7v2.model.primitive.DT
All Implemented Interfaces:
Primitive, Type, java.io.Serializable
Direct Known Subclasses:
DT, DT, DT, DT, DT, DT, DT, DT

public abstract class DT
extends AbstractPrimitive

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:
Serialized Form

Constructor Summary
DT(Message theMessage)
           
 
Method Summary
 int getDay()
          Returns the day as an integer.
 int getMonth()
          Returns the month as an integer.
 java.lang.String getValue()
          Returns a String representation of the value of this field.
 int getYear()
          Returns the year as an integer.
 void setValue(java.lang.String theValue)
          Sets the value of this Primitive, first performing validation as specified by getMessage().getValidationContext().
 void setYearMonthDayPrecision(int yr, int mnth, int dy)
           
 void setYearMonthPrecision(int yr, int mnth)
           
 void setYearPrecision(int yr)
           
 
Methods inherited from class ca.uhn.hl7v2.model.AbstractPrimitive
clear, encode, parse, toString
 
Methods inherited from class ca.uhn.hl7v2.model.AbstractType
getExtraComponents, getMessage, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ca.uhn.hl7v2.model.Type
getExtraComponents, getMessage, getName
 

Constructor Detail

DT

public DT(Message theMessage)
Parameters:
theMessage - message to which this Type belongs
Method Detail

setValue

public void setValue(java.lang.String theValue)
              throws DataTypeException
Description copied from class: AbstractPrimitive
Sets the value of this Primitive, first performing validation as specified by getMessage().getValidationContext(). No validation is performed if getMessage() returns null.

Specified by:
setValue in interface Primitive
Overrides:
setValue in class AbstractPrimitive
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:
AbstractPrimitive.setValue(java.lang.String)

getValue

public java.lang.String getValue()
Description copied from interface: Primitive
Returns a String representation of the value of this field.

Specified by:
getValue in interface Primitive
Overrides:
getValue in class AbstractPrimitive
See Also:
AbstractPrimitive.getValue()

setYearPrecision

public void setYearPrecision(int yr)
                      throws DataTypeException
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:
CommonDT.setYearPrecision(int)

setYearMonthPrecision

public void setYearMonthPrecision(int yr,
                                  int mnth)
                           throws DataTypeException
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:
CommonDT.setYearMonthPrecision(int, int)

setYearMonthDayPrecision

public void setYearMonthDayPrecision(int yr,
                                     int mnth,
                                     int dy)
                              throws DataTypeException
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:
CommonDT.setYearMonthDayPrecision(int, int, int)

getYear

public int getYear()
            throws DataTypeException
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

public int getMonth()
             throws DataTypeException
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

public int getDay()
           throws DataTypeException
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.


Copyright © 2001-2011 University Health Network. All Rights Reserved.