|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.uhn.hl7v2.model.primitive.CommonTM
public class CommonTM
This class contains functionality used by the TM 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: HH[MM[SS[.S[S[S[S]]]]]][+/-ZZZZ] In prior versions of HL7, this data type was always specified to be in the format HHMM[SS[.SSSS]][+/-ZZZZ] using a 24 hour clock notation. In the current and future versions, the precision of a time may be expressed by limiting the number of digits used with the format specification as shown above. By site-specific agreement, HHMM[SS[.SSSS]][+/-ZZZZ] may be used where backward compatibility must be maintained. Thus, HH is used to specify a precision of "hour," HHMM is used to specify a precision of "minute," HHMMSS is used to specify a precision of seconds, and HHMMSS.SSSS is used to specify a precision of ten-thousandths of a second. In each of these cases, the time zone is an optional component. The fractional seconds could be sent by a transmitter who requires greater precision than whole seconds. Fractional representations of minutes, hours or other higher-order units of time are not permitted. Note: The time zone [+/-ZZZZ], when used, is restricted to legally-defined time zones and is represented in HHMM format. The time zone of the sender may be sent optionally as an offset from the coordinated universal time (previously known as Greenwich Mean Time). Where the time zone is not present in a particular TM field but is included as part of the date/time field in the MSH segment, the MSH value will be used as the default time zone. Otherwise, the time is understood to refer to the local time of the sender. Midnight is represented as 0000. Examples:|235959+1100| 1 second before midnight in a time zone eleven hours ahead of Universal Coordinated Time (i.e., east of Greenwich). |0800| Eight AM, local time of the sender. |093544.2312| 44.2312 seconds after Nine thirty-five AM, local time of sender. |13| 1pm (with a precision of hours), local time of sender.
Constructor Summary | |
---|---|
CommonTM()
Constructs a TM datatype with fields initialzed to zero and the value set to null. |
|
CommonTM(java.lang.String val)
Constructs a TM object with the given value. |
Method Summary | |
---|---|
float |
getFractSecond()
Returns the fractional second value as a float. |
int |
getGMTOffset()
Returns the GMT offset value as an integer, -99 if not set. |
int |
getHour()
Returns the hour as an integer. |
int |
getMinute()
Returns the minute as an integer. |
int |
getSecond()
Returns the second as an integer. |
java.lang.String |
getValue()
Returns the HL7 TM string value. |
void |
setHourMinSecondPrecision(int hr,
int min,
float sec)
This method takes in integer values for the hour, minute, seconds, and fractional seconds (going to the tenthousandths precision). |
void |
setHourMinutePrecision(int hr,
int min)
This method takes in integer values for the hour and minute and performs validations, it then sets the value field formatted as an HL7 time value with hour&minute precision (HHMM). |
void |
setHourPrecision(int hr)
This method takes in an integer value for the hour and performs validations, it then sets the value field formatted as an HL7 time value with hour precision (HH). |
void |
setOffset(int signedOffset)
This method takes in the four digit (signed) GMT offset and sets the offset field |
void |
setValue(java.lang.String val)
This method takes in a string HL7 Time value and performs validations then sets the value field. |
static java.lang.String |
toHl7TMFormat(java.util.GregorianCalendar cal)
Returns a string value representing the input Gregorian Calendar object in an Hl7 Time Format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommonTM()
public CommonTM(java.lang.String val) throws DataTypeException
DataTypeException
Method Detail |
---|
public void setValue(java.lang.String val) throws DataTypeException
DataTypeException
public void setHourPrecision(int hr) throws DataTypeException
DataTypeException
public void setHourMinutePrecision(int hr, int min) throws DataTypeException
DataTypeException
public void setHourMinSecondPrecision(int hr, int min, float sec) throws DataTypeException
DataTypeException
public void setOffset(int signedOffset) throws DataTypeException
DataTypeException
public java.lang.String getValue()
public int getHour()
public int getMinute()
public int getSecond()
public float getFractSecond()
public int getGMTOffset()
public static java.lang.String toHl7TMFormat(java.util.GregorianCalendar cal) throws DataTypeException
DataTypeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |