public EpisodeOfCareRefVo getEpisodeOfCareRef(CatsReferralRefVo referral) { if (referral == null || referral.getID_CatsReferral() == null) throw new CodingRuntimeException("Logical error - referral is null or missing ID"); String hql = "from EpisodeOfCare as ep where (ep.id in (select cr.careContext.episodeOfCare.id from CatsReferral as cr where cr.id = :refID))"; ArrayList<String> paramNames = new ArrayList<String>(); paramNames.add("refID"); ArrayList<Object> paramValues = new ArrayList<Object>(); paramValues.add(referral.getID_CatsReferral()); DomainFactory factory = getDomainFactory(); return EpisodeofCareLiteVoAssembler.create((EpisodeOfCare) factory.find(hql, paramNames, paramValues).get(0)); }
public EpisodeofCareLiteVo getEpisodeOfCare(String pasEpisodeId) { DomainFactory factory=getDomainFactory(); ArrayList<String> objects=new ArrayList <String>(); objects.add("careContexts"); objects.add("pasEvent"); IMSCriteria imsc=new IMSCriteria(EpisodeOfCare.class,objects,factory); imsc.equal("pasEvent.pasEpisodeId", pasEpisodeId); List episodes=imsc.find(); if (episodes.size()>0) return EpisodeofCareLiteVoAssembler.create((EpisodeOfCare)episodes.get(0)); return null; }