class CDAHelper {

	public static IVL_TS  buildEffectiveTimeinIVL(Date d , Date d1)
	{
		IVL_TS effectiveTime = DatatypesFactory.eINSTANCE.createIVL_TS();
		SimpleDateFormat s = new SimpleDateFormat("yyyyMMddhhmmss");
		String creationDate;
		IVXB_TS low = DatatypesFactory.eINSTANCE.createIVXB_TS();
		IVXB_TS high = DatatypesFactory.eINSTANCE.createIVXB_TS();
		if(d!=null)
		{
		creationDate = s.format(d);
		low.setValue(creationDate);
		}
		else
			low.setNullFlavor(NullFlavor.UNK);
		
		effectiveTime.setLow(low);
		if(d1!=null)
		{
		high.setValue(s.format(d1));
		}
		else
			high.setNullFlavor(NullFlavor.UNK);
		effectiveTime.setHigh(high);
		return effectiveTime;
	}

}