class HibernateConditionDAO implements ConditionDAO {

	@Override
	public List<Condition> getActiveConditions(Patient patient) {
		Query query = sessionFactory.getCurrentSession().createQuery(
				"from Condition c where c.patient.patientId = :patientId and c.voided = false and c.endDate is null order "
						+ "by c.onsetDate desc");
		query.setInteger("patientId", patient.getId());
		return query.list();
	}

}