public TTAMedicationAndPharmacyVo getTTAMedicationAndPharmacy(CareContextRefVo careContextRefvo) { if(careContextRefvo == null) throw new CodingRuntimeException("CareContextRefVo is null"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" from TTAMedicationAndPharmacy tta where tta.careContext.id = :careContextId"); ArrayList<String> markers = new ArrayList<String>(); markers.add("careContextId"); ArrayList<Serializable> values = new ArrayList<Serializable>(); values.add(careContextRefvo.getID_CareContext()); List list = factory.find(hql.toString(), markers,values); if(list != null && list.size() > 0) { TTAMedicationAndPharmacyVoCollection voColl = TTAMedicationAndPharmacyVoAssembler.createTTAMedicationAndPharmacyVoCollectionFromTTAMedicationAndPharmacy(list); if(voColl != null && voColl.size() > 0) return voColl.get(0); } return null; }