public ims.therapies.vo.ThermalVo saveThermalDetails(ims.therapies.vo.ThermalVo voThermal) throws StaleObjectException, UniqueKeyViolationException { if(voThermal == null) throw new DomainRuntimeException("Cannot save null Thermal record"); // Ensure the value object has been validated if (!voThermal.isValidated()) throw new DomainRuntimeException("Thermal Record has not been validated"); /* WDEV-13649if(voThermal.getID_Thermal() == null) { List list = Thermal.listThermalByClinicalContact(getDomainFactory(), (ims.core.admin.domain.objects.ClinicalContact) getDomainFactory().getDomainObject(voThermal.getClinicalContact())); if (list != null && list.size() > 0) throw new StaleObjectException((Thermal)list.get(0)); }*/ DomainFactory factory = getDomainFactory(); Thermal domThermal = ThermalVoAssembler.extractThermal(factory, voThermal); factory.save(domThermal); return ThermalVoAssembler.create(domThermal); }
public ThermalVo getThermalDetailsByClinicalContact(ClinicalContactRefVo voClinicalContactRef) { if (voClinicalContactRef == null) throw new RuntimeException("Cannot get ThermalVo for null ClinicalContactRefVo"); List list = Thermal.listThermalByClinicalContact(getDomainFactory(), (ims.core.admin.domain.objects.ClinicalContact) getDomainFactory().getDomainObject(voClinicalContactRef)); if (list == null || list.size() == 0) return null; // WDEV-13649else if (list.size() > 1) // WDEV-13649 throw new CodingRuntimeException("More than one Thermal found for the current Clinical Contact"); return ThermalVoAssembler.createThermalVoCollectionFromThermal(list).get(0); }
public ThermalVo getThermal(ThermalRefVo thermal) { if(thermal == null || thermal.getID_Thermal() == null) throw new CodingRuntimeException("Can not get Thermal on null Id."); return ThermalVoAssembler.create((Thermal) getDomainFactory().getDomainObject(Thermal.class, thermal.getID_Thermal())); }