public ims.clinical.vo.RACPPastMedicalHistoryVo getRACPPastMedicalHistoryForrefCareContext(CareContextRefVo refCareContextRefVo) { if (refCareContextRefVo == null) throw new CodingRuntimeException("Cannot get RACPSymptomRiskFactorsVo for null ClinicalContactRefVo"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" from RACPPastMedicalHistory pmh where "); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); hql.append(" pmh.careContext.id = :ccId"); markers.add("ccId"); values.add(refCareContextRefVo.getID_CareContext()); List listRACPPastMedicalHistory = factory.find(hql.toString(), markers,values); if(listRACPPastMedicalHistory != null && listRACPPastMedicalHistory.size() > 0) { RACPPastMedicalHistoryVoCollection voColl = RACPPastMedicalHistoryVoAssembler.createRACPPastMedicalHistoryVoCollectionFromRACPPastMedicalHistory(listRACPPastMedicalHistory); if(voColl != null && voColl.size() > 0) return voColl.get(0); } return null; }