public PatientEdischargeBatchVo getPatientEdischargeBatchViaCareContext(CareContextRefVo careContext) { DomainFactory factory = getDomainFactory(); List lst = factory.find("select p from CareContext as cc left join cc.episodeOfCare as eoc left join eoc.careSpell as cs left join cs.patient as p where (cc.id = :idCareContext)", new String[]{"idCareContext"}, new Object[]{careContext.getID_CareContext()}); if (lst != null && lst.size() > 0) return PatientEdischargeBatchVoAssembler.create((ims.core.patient.domain.objects.Patient) lst.get(0)); return null; }