/** * Get the current Remedial record for the Clinical Contact */ public ims.therapies.vo.RemedialVo getRemedialVoByClinicalContact(ClinicalContactRefVo voClinicalContactRef) { //return RemedialVoAssembler.create(Remedial.getRemedialFromClinicalContact(getDomainFactory(), voClinicalContactRef.getID_ClinicalContact())); //WDEV-15078 if(voClinicalContactRef == null || voClinicalContactRef.getID_ClinicalContact()==null ) throw new CodingRuntimeException("Can not get RemedialVo value on null ClinicalContact."); StringBuffer hql = new StringBuffer(); hql.append("select remedial from Remedial as remedial "); hql.append("where remedial.clinicalContact.id = :clinicalId "); DomainFactory factory = getDomainFactory(); List<?> list = factory.find(hql.toString(), new String[] {"clinicalId"}, new Object[] {voClinicalContactRef.getID_ClinicalContact()}); if (list!=null && list.size()>0) { return RemedialVoAssembler.createRemedialVoCollectionFromRemedial(list).get(0); } return null; }
public RemedialVo saveRemedialVo(RemedialVo voRemedial) throws StaleObjectException { // Ensure the value object has been validated if (!voRemedial.isValidated()) throw new DomainRuntimeException("Remedial has not been validated"); DomainFactory factory = getDomainFactory(); Remedial doRemedial = RemedialVoAssembler.extractRemedial(factory, voRemedial); factory.save(doRemedial); return RemedialVoAssembler.create(doRemedial); }
public RemedialVo getRemedial(RemedialRefVo remedialRef) { if (remedialRef==null || remedialRef.getID_Remedial()==null) { throw new CodingRuntimeException("Cannot get Remedial on null Id for Remedial "); } DomainFactory factory = getDomainFactory(); Remedial domainRemedial = (Remedial)factory.getDomainObject(Remedial.class, remedialRef.getID_Remedial()); return RemedialVoAssembler.create(domainRemedial); }