public EmergencyEpisodeForTriageLiteVo getEmergencyEpisode(EpisodeOfCareRefVo episodeOfCare) { if (episodeOfCare == null || episodeOfCare.getID_EpisodeOfCare() == null) return null; String query = "SELECT emerEpisode FROM EmergencyEpisode AS emerEpisode LEFT JOIN emerEpisode.episodeOfCare AS epis WHERE epis.id = :EPIS"; return EmergencyEpisodeForTriageLiteVoAssembler.create((EmergencyEpisode) getDomainFactory().findFirst(query, "EPIS", episodeOfCare.getID_EpisodeOfCare())); }