} //end constructor /// <summary> 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 Time Stamp value with year&month&day precision (YYYYMMDD). /// /// </summary> public virtual void setDatePrecision(int yr, int mnth, int dy) { try { //create date object if there isn't one if (dt == null) { dt = new CommonDT(); } //set the value of the date object to the input date value dt.setYearMonthDayPrecision(yr, mnth, dy); //clear the time value object tm = null; } //end try catch (DataTypeException e) { throw e; } //end catch catch (System.Exception e) { throw new DataTypeException("An unexpected exception ocurred", e); } //end catch } //end method
} //end method /// <summary> Returns a string value representing the input Gregorian Calendar object in /// an Hl7 Date Format. /// </summary> public static System.String toHl7DTFormat(System.Globalization.GregorianCalendar cal) { System.String val = ""; try { //set the input cal object so that it can report errors //on it's value //UPGRADE_ISSUE: Method 'java.util.Calendar.setLenient' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javautilCalendarsetLenient_boolean'" // UPGRADE_ISSUE: Commented out:cal.setLenient(false); //UPGRADE_TODO: Method 'java.util.Calendar.get' was converted to 'SupportClass.CalendarManager.Get' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilCalendarget_int'" int calYear = SupportClass.CalendarManager.manager.Get(cal, SupportClass.CalendarManager.YEAR); //UPGRADE_TODO: Method 'java.util.Calendar.get' was converted to 'SupportClass.CalendarManager.Get' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilCalendarget_int'" int calMonth = SupportClass.CalendarManager.manager.Get(cal, SupportClass.CalendarManager.MONTH) + 1; //UPGRADE_TODO: Method 'java.util.Calendar.get' was converted to 'SupportClass.CalendarManager.Get' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilCalendarget_int'" int calDay = SupportClass.CalendarManager.manager.Get(cal, SupportClass.CalendarManager.DAY_OF_MONTH); CommonDT dt = new CommonDT(); dt.setYearMonthDayPrecision(calYear, calMonth, calDay); val = dt.Value; } //end try catch (DataTypeException e) { throw e; } //end catch catch (System.Exception e) { throw new DataTypeException("An unexpected exception ocurred", e); } //end catch return(val); } //end method
/// <summary> Returns a string value representing the input Gregorian Calendar object in /// an Hl7 Date Format. /// </summary> public static System.String toHl7DTFormat(System.Globalization.GregorianCalendar cal) { System.String val = ""; try { //set the input cal object so that it can report errors //on it's value //UPGRADE_ISSUE: Method 'java.util.Calendar.setLenient' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javautilCalendarsetLenient_boolean'" // UPGRADE_ISSUE: Commented out:cal.setLenient(false); //UPGRADE_TODO: Method 'java.util.Calendar.get' was converted to 'SupportClass.CalendarManager.Get' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilCalendarget_int'" int calYear = SupportClass.CalendarManager.manager.Get(cal, SupportClass.CalendarManager.YEAR); //UPGRADE_TODO: Method 'java.util.Calendar.get' was converted to 'SupportClass.CalendarManager.Get' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilCalendarget_int'" int calMonth = SupportClass.CalendarManager.manager.Get(cal, SupportClass.CalendarManager.MONTH) + 1; //UPGRADE_TODO: Method 'java.util.Calendar.get' was converted to 'SupportClass.CalendarManager.Get' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilCalendarget_int'" int calDay = SupportClass.CalendarManager.manager.Get(cal, SupportClass.CalendarManager.DAY_OF_MONTH); CommonDT dt = new CommonDT(); dt.setYearMonthDayPrecision(calYear, calMonth, calDay); val = dt.Value; } //end try catch (DataTypeException e) { throw e; } //end catch catch (System.Exception e) { throw new DataTypeException("An unexpected exception ocurred", e); } //end catch return val; }