public CareContextMinVo getCareContextByPasEvent(PASEventRefVo pasEvent) { if(pasEvent == null || !pasEvent.getID_PASEventIsNotNull()) throw new CodingRuntimeException("Cannot get Care Context on null Pas Event."); DomainFactory factory = getDomainFactory(); List<?> careContext = factory.find("from CareContext as cc where cc.pasEvent.id = :PasEventId order by cc.systemInformation.creationDateTime desc ", new String[] {"PasEventId"}, new Object[] {pasEvent.getID_PASEvent()}); if(careContext == null || careContext.size() == 0) return null; return CareContextMinVoAssembler.create((CareContext) careContext.get(0)); }