|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.uhn.hl7v2.model.primitive.CommonDT
public class CommonDT
This class contains functionality used by the DT class in the version 2.3.0, 2.3.1, and 2.4 packages Note: The class description below has been excerpted from the Hl7 2.4 documentation. Sectional references made below also refer to the same documentation. Format: YYYY[MM[DD]] In prior versions of HL7, this data type was always specified to be in the format YYYYMMDD. In the current and future versions, the precision of a date may be expressed by limiting the number of digits used with the format specification YYYY[MM[DD]]. Thus, YYYY is used to specify a precision of "year," YYYYMM specifies a precision of "month," and YYYYMMDD specifies a precision of "day." By site-specific agreement, YYYYMMDD may be used where backward compatibility must be maintained. Examples: |19880704| |199503|
Constructor Summary | |
---|---|
CommonDT()
Constructs a DT datatype with fields initialzed to zero and value initialized to null. |
|
CommonDT(java.lang.String val)
Constructs a DT object with the given value. |
Method Summary | |
---|---|
int |
getDay()
Returns the day as an integer. |
int |
getMonth()
Returns the month as an integer. |
java.lang.String |
getValue()
Returns the HL7 DT string value. |
int |
getYear()
Returns the year as an integer. |
void |
setValue(java.lang.String val)
This method takes in a string HL7 date value and performs validations then sets the value field. |
void |
setYearMonthDayPrecision(int yr,
int mnth,
int dy)
This method takes in integer values for the year and month and day and performs validations, it then sets the value in the object formatted as an HL7 date value with year&month&day precision (YYYYMMDD). |
void |
setYearMonthPrecision(int yr,
int mnth)
This method takes in integer values for the year and month and performs validations, it then sets the value field formatted as an HL7 date value with year&month precision (YYYYMM). |
void |
setYearPrecision(int yr)
This method takes in an integer value for the year and performs validations, it then sets the value field formatted as an HL7 date. |
static java.lang.String |
toHl7DTFormat(java.util.GregorianCalendar cal)
Returns a string value representing the input Gregorian Calendar object in an Hl7 Date Format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommonDT()
public CommonDT(java.lang.String val) throws DataTypeException
DataTypeException
Method Detail |
---|
public void setValue(java.lang.String val) throws DataTypeException
DataTypeException
public void setYearPrecision(int yr) throws DataTypeException
DataTypeException
public void setYearMonthPrecision(int yr, int mnth) throws DataTypeException
DataTypeException
public void setYearMonthDayPrecision(int yr, int mnth, int dy) throws DataTypeException
DataTypeException
public java.lang.String getValue()
public int getYear()
public int getMonth()
public int getDay()
public static java.lang.String toHl7DTFormat(java.util.GregorianCalendar cal) throws DataTypeException
DataTypeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |