/** * @see AbstractPrimitive#getValue */ public String getValue() { String result = super.getValue(); if (myDetail != null) { result = myDetail.getValue(); } return result; }
/** * @see AbstractPrimitive#getValue */ public String getValue() { String result = super.getValue(); if (myDetail != null) { result = myDetail.getValue(); } return result; }
/** * Returns a string value representing the input Gregorian Calendar object in * an Hl7 Date Format. */ public static String toHl7DTFormat(GregorianCalendar cal) throws DataTypeException { String val = ""; try { //set the input cal object so that it can report errors //on it's value cal.setLenient(false); int calYear = cal.get(GregorianCalendar.YEAR); int calMonth = cal.get(GregorianCalendar.MONTH) + 1; int calDay = cal.get(GregorianCalendar.DAY_OF_MONTH); CommonDT dt = new CommonDT(); dt.setYearMonthDayPrecision(calYear, calMonth, calDay); val = dt.getValue(); } //end try catch (DataTypeException e) { throw e; } //end catch catch (Exception e) { throw new DataTypeException( e ); } //end catch return val; } //end method
/** * Returns a string value representing the input Gregorian Calendar object in * an Hl7 Date Format. */ public static String toHl7DTFormat(GregorianCalendar cal) throws DataTypeException { String val = ""; try { //set the input cal object so that it can report errors //on it's value cal.setLenient(false); int calYear = cal.get(GregorianCalendar.YEAR); int calMonth = cal.get(GregorianCalendar.MONTH) + 1; int calDay = cal.get(GregorianCalendar.DAY_OF_MONTH); CommonDT dt = new CommonDT(); dt.setYearMonthDayPrecision(calYear, calMonth, calDay); val = dt.getValue(); } //end try catch (DataTypeException e) { throw e; } //end catch catch (Exception e) { throw new DataTypeException( e ); } //end catch return val; } //end method