Java Code Examples for ims.framework.utils.Date.clone()

The following are Jave code examples for showing how to use clone() of the ims.framework.utils.Date class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File: DailyPatientProgressImpl.java   Source Code and License Vote up 4 votes
public PatientAssessmentListVoCollection listPatientAssessments(CareContextRefVo careContextRefVo, UserDefinedAssessmentType assessmentType, Date dteDateFrom, Date dteDateTo)
{
	if(careContextRefVo == null || careContextRefVo.getID_CareContext() == null)
		throw new RuntimeException("Cannot list PatientAssessments for null CareContextRefVo");
	
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer(" from PatientAssessment pa where pa.careContext.id =:RefId");
	ArrayList values  = new ArrayList();
	ArrayList params  = new ArrayList();

	values.add(careContextRefVo.getID_CareContext());
	params.add("RefId");
	
	if(assessmentType != null)
	{
		hql.append(" and ");
		hql.append("pa.assessmentData.userAssessment.assessmentType =:assType");
		values.add(getDomLookup(assessmentType));
		params.add("assType");	
	}
	if(dteDateFrom != null)
	{
		hql.append(" and ");
		hql.append(" pa.authoringInformation.authoringDateTime >= :dateFrom ");
		params.add("dateFrom");
		values.add(dteDateFrom.getDate());
	}
	if(dteDateTo != null)
	{
		hql.append(" and ");
		hql.append(" pa.authoringInformation.authoringDateTime <= :dateTo ");
		params.add("dateTo");
		Date d = (Date)dteDateTo.clone();
		values.add(d.addDay(1).getDate());
	}
			
	hql.append(" order by pa.authoringInformation.authoringDateTime desc");
	
	List list = factory.find(hql.toString(), params, values);
	return PatientAssessmentListVoAssembler.createPatientAssessmentListVoCollectionFromPatientAssessment(list).sort();
	
}