public EmergencyPatientPresentingProblemsVo getEmergencyPresentingProblems(CareContextRefVo careContextRef) { if(careContextRef == null || careContextRef.getID_CareContext() == null) throw new CodingRuntimeException("No Care context Supplied"); DomainFactory factory = getDomainFactory(); List problems = factory.find("from PresProblemsProceduresPerformed p where p.careContext.id = :careContextId", new String[]{"careContextId"},new Object[]{careContextRef.getID_CareContext()}); if(problems.size() > 1) throw new DomainRuntimeException("More than 1 record found for current Care context !"); return problems.size() == 0 ? null : EmergencyPatientPresentingProblemsVoAssembler.create((PresProblemsProceduresPerformed)problems.get(0)); }