private void populateScreen(PlinthWorkVo voPlinth) { if(voPlinth == null) return; form.qmbAuthoringCP().newRow(voPlinth.getAuthoringCP(), voPlinth.getAuthoringCP().toString()); form.qmbAuthoringCP().setValue(voPlinth.getAuthoringCP()); form.dtimAuthoring().setValue(voPlinth.getAuthoringDateTime()); if(voPlinth.getAnalysis() != null && voPlinth.getAnalysis().size()>0) populateAnalysisGrid(voPlinth.getAnalysis()); if(voPlinth.getTreatment() != null) populateTreatmentGrid(voPlinth.getTreatment()); if(voPlinth.getActivities() != null) populateActivitiesGrid(voPlinth.getActivities()); }
public PlinthWorkVo getPlinthWorkByClinicalContact(ClinicalContactRefVo voClinicalContactRef) { if (voClinicalContactRef == null) throw new RuntimeException("Cannot get PlinthWorkVo for null ClinicalContactRefVo"); String hql = "from PlinthWork c where c.clinicalContact = :clinicalContact order by c.systemInformation.creationDateTime desc"; //wdev-13560 DomainFactory factory = getDomainFactory(); List list = factory.find(hql, new String[]{"clinicalContact"}, new Object[]{(ClinicalContact) getDomainFactory().getDomainObject(voClinicalContactRef)}); //List list = ims.therapies.treatment.domain.objects.PlinthWork.listPlinthWorkByClinicalContact(getDomainFactory(), (ClinicalContact) getDomainFactory().getDomainObject(voClinicalContactRef)); if (list == null || list.size() == 0) return null; //else if (list.size() > 1) // throw new CodingRuntimeException("More than one Plinth Work found for the current Clinical Contact"); PlinthWorkVoCollection coll = PlinthWorkVoAssembler.createPlinthWorkVoCollectionFromPlinthWork(list); if(coll!=null && coll.size()>0) return coll.get(0); return null; }
public void savePlinthWork(PlinthWorkVo voPlinthWork) throws StaleObjectException, UniqueKeyViolationException { if(voPlinthWork == null) throw new DomainRuntimeException("Cannot save null Plinth Work"); // Ensure the value object has been validated if (!voPlinthWork.isValidated()) throw new DomainRuntimeException("Plinth Work has not been validated"); DomainFactory factory = getDomainFactory(); PlinthWork doPlinthWork = PlinthWorkVoAssembler.extractPlinthWork(factory, voPlinthWork); factory.save(doPlinthWork); }