class HibernateDiagnosisDAO implements DiagnosisDAO {

	@Override
	public List<Diagnosis> getDiagnoses(Encounter encounter){
		Query query = sessionFactory.getCurrentSession().createQuery(
			"from Diagnosis d where d.encounter.encounterId = :encounterId order by dateCreated desc");
		query.setInteger("encounterId", encounter.getId());
		return query.list();	
	}

}