class CDAHelper {

	public static String getDatatypesValue(Integer datatypeId,Obs obs)
	{
		String value = "";
		if(datatypeId!=null && obs!=null)
		{
		switch(datatypeId)
		{
		case 1:
			long longvalue=Math.round(obs.getValueNumeric());
			int intvalue=(int)longvalue;
			value=String.valueOf(intvalue);
			break;
			
		case 2:
			value = obs.getValueCoded().getDisplayString();
			break;

		case 3:
			value = obs.getValueText();
			break;

		case 6:
			value =removeDirtyValue( obs.getValueDate().toString());
			break;

		case 7:
			
			value = obs.getValueTime().toString();
			break;

		case 8:
			
			value = obs.getValueDatetime().toString();
			break;

		case 10:
			value = obs.getValueAsBoolean().toString();
			break;

		case 13:
			value = obs.getValueComplex();
			break;
		}
		}
		return value;
	}

}