/** * @see CommonTM#setHourPrecision(int) * @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. */ public void setHourPrecision(int hr) throws DataTypeException { getDetail().setHourPrecision(hr); }
/** * @see CommonTM#setHourPrecision(int) * @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. */ public void setHourPrecision(int hr) throws DataTypeException { getDetail().setHourPrecision(hr); }
/** * 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). */ public void setHourMinutePrecision(int hr, int min) throws DataTypeException { try { this.setHourPrecision(hr); //validate input minute value if ((min < 0) || (min > 59)) { String msg = "The minute value of the TM datatype must be >=0 and <=59"; DataTypeException e = new DataTypeException(msg); throw e; } //end if minute = min; second = 0; fractionOfSec = 0; offSet = 0; //Here the offset is not defined, we should omit showing it in the //return value from the getValue() method omitOffsetFg = true; value = value + DataTypeUtil.preAppendZeroes(min, 2); } //end try catch (DataTypeException e) { throw e; } //end catch catch (Exception e) { throw new DataTypeException(e.getMessage()); } //end catch } //end method
/** * 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). */ public void setHourMinutePrecision(int hr, int min) throws DataTypeException { try { this.setHourPrecision(hr); //validate input minute value if ((min < 0) || (min > 59)) { String msg = "The minute value of the TM datatype must be >=0 and <=59"; DataTypeException e = new DataTypeException(msg); throw e; } //end if minute = min; second = 0; fractionOfSec = 0; offSet = 0; //Here the offset is not defined, we should omit showing it in the //return value from the getValue() method omitOffsetFg = true; value = value + DataTypeUtil.preAppendZeroes(min, 2); } //end try catch (DataTypeException e) { throw e; } //end catch catch (Exception e) { throw new DataTypeException(e.getMessage()); } //end catch } //end method