/** * saves Standing */ public StandingSessionVo save(ims.therapies.vo.StandingSessionVo voStandingSession) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException { if(!voStandingSession.isValidated()) throw new DomainRuntimeException("This Standing Session has not been validated"); if (voStandingSession.getID_StandingSession() == null && getStandingSessionByClinicalContact(voStandingSession.getClinicalContact()) != null) throw new UniqueKeyViolationException("The screen will be refreshed."); DomainFactory factory = getDomainFactory(); StandingSession doStanding = StandingSessionVoAssembler.extractStandingSession(factory, voStandingSession); factory.save(doStanding); return StandingSessionVoAssembler.create(doStanding); }
public StandingSessionVo getStandingSessionByClinicalContact(ClinicalContactRefVo voClinicalContactRef) { if(voClinicalContactRef == null) throw new CodingRuntimeException("Standing Session Filter not provided for get call. "); String hql = new String("from StandingSession s where s.clinicalContact.id = :CLINICAL_CONTACT_ID"); java.util.List list = getDomainFactory().find(hql, "CLINICAL_CONTACT_ID", voClinicalContactRef.getID_ClinicalContact()); StandingSessionVoCollection vo = StandingSessionVoAssembler.createStandingSessionVoCollectionFromStandingSession(list); if(vo!=null && vo.size()>0 ) return vo.get(0); else return null; }
public StandingSessionVo getStanding(StandingSessionRefVo standing) { if(standing == null || standing.getID_StandingSession() == null) throw new CodingRuntimeException("Cannot get StandingSession on null Id."); return StandingSessionVoAssembler.create((StandingSession) getDomainFactory().getDomainObject(StandingSession.class, standing.getID_StandingSession())); }