public ims.therapies.vo.ElectrotherapyTENSVo saveElectrotherapyTens(ims.therapies.vo.ElectrotherapyTENSVo voElectrotherapyTens) throws StaleObjectException, UniqueKeyViolationException { // Ensure the value object has been validated if (!voElectrotherapyTens.isValidated()) throw new DomainRuntimeException("ElectrotherapyTens Record has not been validated"); if (voElectrotherapyTens.getID_ElectrotherapyTENS() == null && getElectrotherapyTens(voElectrotherapyTens.getClinicalContact()) != null) throw new UniqueKeyViolationException("The screen will be refreshed."); DomainFactory factory = getDomainFactory(); ElectrotherapyTENS domElectrotherapyTens = ElectrotherapyTENSVoAssembler.extractElectrotherapyTENS(factory, voElectrotherapyTens); factory.save(domElectrotherapyTens); return ElectrotherapyTENSVoAssembler.create(domElectrotherapyTens); }
public ims.therapies.vo.ElectrotherapyTENSVo getElectrotherapyTens(ims.core.vo.ClinicalContactShortVo voClinicalContactShort) { if(voClinicalContactShort == null || voClinicalContactShort.getID_ClinicalContact() == null) throw new DomainRuntimeException("Contact not provided for get call. "); DomainFactory factory = getDomainFactory(); ElectrotherapyTENSVo voElectrotherapyTENS = new ElectrotherapyTENSVo(); java.util.List electrotherapyTENSList = factory.find("from ElectrotherapyTENS EctTENS where EctTENS.clinicalContact.id = :contactId", new String[]{"contactId"}, new Object[]{voClinicalContactShort.getID_ClinicalContact()}); ElectrotherapyTENSVoCollection coll = ElectrotherapyTENSVoAssembler.createElectrotherapyTENSVoCollectionFromElectrotherapyTENS(electrotherapyTENSList);// WDEV-13592 if (coll != null && coll.size()>0)// WDEV-13592 voElectrotherapyTENS = coll.get(0); // WDEV-13592 else voElectrotherapyTENS = null; return voElectrotherapyTENS; }
public ElectrotherapyTENSVo getElectrotherapyTensByRef(ElectrotherapyTENSRefVo electroTherapyTENS) { if(electroTherapyTENS == null || electroTherapyTENS.getID_ElectrotherapyTENS() == null) throw new CodingRuntimeException("Cannot get ElectroTherapyTENS on null Id."); return ElectrotherapyTENSVoAssembler.create((ElectrotherapyTENS) getDomainFactory().getDomainObject(ElectrotherapyTENS.class, electroTherapyTENS.getID_ElectrotherapyTENS())); }