/** * Return a java date object for the given TS * * @param ts TS to parse * @return date object or null * @throws HL7Exception */ private Date getDatetime(TS ts) throws HL7Exception { Date datetime = null; DTM value = ts.getTime(); if (value.getYear() == 0 || value.getValue() == null) { return null; } try { datetime = getDate(value.getYear(), value.getMonth(), value.getDay(), value.getHour(), value.getMinute(), value .getSecond()); } catch (DataTypeException e) { } return datetime; }
if (value != null) { Date valueDate = getDate(value.getYear(), value.getMonth(), value.getDay(), value.getHour(), value .getMinute(), value.getSecond());