/** * save a Bobath record * @throws UniqueKeyViolationException */ public BobathVo saveBoBath(BobathVo voBobath) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException { if(!voBobath.isValidated()) throw new DomainRuntimeException("BoBath Value Object has not been validated"); if (voBobath.getID_Bobath() == null && getBoBath(voBobath.getClinicalContact()) != null) throw new UniqueKeyViolationException("The screen will be refreshed."); DomainFactory factory = getDomainFactory(); Bobath doBobath = BobathVoAssembler.extractBobath(factory,voBobath); factory.save(doBobath); return BobathVoAssembler.create(doBobath); }
/** * get Bobath record for a clinical contact */ public BobathVo getBoBath(ims.core.vo.ClinicalContactShortVo voClinicalContact) { if(voClinicalContact == null) throw new CodingRuntimeException("Bobath Filter not provided for get call. "); String hql = new String("from Bobath b where b.clinicalContact.id = :CLINICAL_CONTACT_ID"); BobathVoCollection bobaths = BobathVoAssembler.createBobathVoCollectionFromBobath(getDomainFactory().find(hql, "CLINICAL_CONTACT_ID", voClinicalContact.getID_ClinicalContact())); if (bobaths.size() > 0) return bobaths.get(0); return null; }
public BobathVo getBoBathById(BobathRefVo recordID) { if( recordID == null) return null; Bobath doBobath = (Bobath)getDomainFactory().getDomainObject(Bobath.class, recordID.getID_Bobath()); return BobathVoAssembler.create(doBobath); }