private void open() { clearScreen(); if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull()) { RACPMedicationVo voRACPMedicationVo = domain.getMedicationForCareContext(form.getGlobalContext().Core.getCurrentCareContext()); form.getLocalContext().setRACPMedicationVo(voRACPMedicationVo); if(voRACPMedicationVo!=null) { populateScreen(voRACPMedicationVo); } } form.setMode(FormMode.VIEW);// WDEV-13437 }
private void populateMedicationFromGrid(RACPMedicationVo medicationVo) { RACPMedicationStatusVoCollection collRACPMedicationStatusVo = new RACPMedicationStatusVoCollection(); for (int i = 0; i < form.grdMeds().getRows().size(); i++) { grdMedsRow row = form.grdMeds().getRows().get(i); RACPMedicationStatusVo voRACPMedicationStatus = new RACPMedicationStatusVo(); voRACPMedicationStatus.setMedication(row.getcolMed()); voRACPMedicationStatus.setMedicationStatus(row.getcolStatus()); collRACPMedicationStatusVo.add(voRACPMedicationStatus); } if(collRACPMedicationStatusVo.size()>0) medicationVo.setRAPCMedicationList(collRACPMedicationStatusVo); else medicationVo.setRAPCMedicationList(null); }
private void populateScreen(RACPMedicationVo voRACPMedicationVo) { if(voRACPMedicationVo.getRAPCMedicationListIsNotNull()){ RACPMedicationStatusVoCollection collRACPMedication = voRACPMedicationVo.getRAPCMedicationList(); form.grdMeds().getRows().clear(); for (int i = 0; i < collRACPMedication.size(); i++) { RACPMedicationStatusVo voRACPMedication = collRACPMedication.get(i); grdMedsRow row = form.grdMeds().getRows().newRow(); row.setcolMed(voRACPMedication.getMedication()); row.setcolStatus(voRACPMedication.getMedicationStatus()); } } form.txtOther().setValue(voRACPMedicationVo.getMedicationNotes()); }
private boolean save() { if(isRACPCComplete())// WDEV-13662 return false; RACPMedicationVo voRACPMedication = populateDataFromScreen(form.getLocalContext().getRACPMedicationVo()); String[] arrErrors = voRACPMedication.validate(); if (arrErrors != null) { engine.showErrors(arrErrors); return false; } try { voRACPMedication = domain.saveMedicationVo(voRACPMedication); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return false; } form.getLocalContext().setRACPMedicationVo(voRACPMedication); return true; }