public boolean save() throws PresentationLogicException { NeedsAssessmentEditVo currentInstance = populateInstanceData(form.getLocalContext().getSelectedInstance()); String[] errors = currentInstance.validate(validateUIRules()); if(errors != null && errors.length > 0) { engine.showErrors(errors); return false; } try { form.getLocalContext().setSelectedInstance(domain.save(currentInstance)); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return false; } return true; }
public void populateInstanceControls(NeedsAssessmentEditVo value) throws PresentationLogicException { clearInstanceControls(); form.getLocalContext().setSelectedInstance(value); form.getGlobalContext().SpinalInjuries.setNeedsAssessmentComponentScoreCollection(value == null ? null : value.getComponentScore()); form.getGlobalContext().Core.setNeedsAssessmentId(value.getID_NeedsAssessment());//WDEV-15537 if(value == null) return; this.form.cmbIsNAC().setValue(value.getNeedAssessmentNumberIsNotNull() ? value.getNeedAssessmentNumber() : null); this.form.ansSummarySheet().setValue(value.getAttachBookletToSummarySheetIsNotNull() ? value.getAttachBookletToSummarySheet() : null); this.form.ansBooklet().setValue(value.getHadBookletIsNotNull() ? value.getHadBooklet() : null); this.form.qmbHCP().clear(); if(value.getAuthoringHCPIsNotNull()) { this.form.qmbHCP().newRow(value.getAuthoringHCP(), getHCPName(value.getAuthoringHCP())); this.form.qmbHCP().setValue(value.getAuthoringHCP()); } this.form.dteStarted().setValue(value.getDateStarted()); this.form.dteMeetingDate().setValue(value.getGoalPlanMeetingDate()); this.form.dteMobilisation().setValue(value.getMobilisationDate()); if(value.getPatientUserDefinedObject() != null && value.getPatientUserDefinedObject().getPatientAssessments() != null) { for(int x = 0; x < value.getPatientUserDefinedObject().getPatientAssessments().size(); x++) { PatientAssessmentListVo assessment = value.getPatientUserDefinedObject().getPatientAssessments().get(x); addPatientAssessment(assessment); } } }
public ims.core.vo.NeedsAssessmentEditVo save(ims.core.vo.NeedsAssessmentEditVo record) throws StaleObjectException { if(record == null) throw new DomainRuntimeException("Invalid need assessment record to save"); if(!record.isValidated()) throw new DomainRuntimeException("Needs assessment record not validated"); DomainFactory factory = getDomainFactory(); NeedsAssessment domainRecord = NeedsAssessmentEditVoAssembler.extractNeedsAssessment(factory, record); factory.save(domainRecord); return NeedsAssessmentEditVoAssembler.create(domainRecord); }
public NeedsAssessmentEditVo get(NeedsAssessmentRefVo record) { if(record == null || record.getID_NeedsAssessment() == null) throw new DomainRuntimeException("Invalid need assessment record to get"); return NeedsAssessmentEditVoAssembler.create((NeedsAssessment)getDomainFactory().getDomainObject(NeedsAssessment.class, record.getID_NeedsAssessment())); }