private MedicationFormVoCollection populateFRUDataFromScreen() { MedicationFormVoCollection result = new MedicationFormVoCollection(); for (int i = 0 ; i < form.lyrDetails().tabFRU().dyngrdFRU().getRows().size() ; i++) { Object value = form.lyrDetails().tabFRU().dyngrdFRU().getRows().get(i).getValue(); if (value instanceof MedicationFormVo) { MedicationFormVo x = (MedicationFormVo) value; x.setFormRoutes(getRoutes(form.lyrDetails().tabFRU().dyngrdFRU().getRows().get(i).getRows())); if (x.getFormIsNotNull() || x.getFormRoutesIsNotNull()) { result.add(x); } } } if (result.size()==0) return null; return result; }
private void removeSelectedRow() { DynamicGridRow row = form.lyrDetails().tabFRU().dyngrdFRU().getSelectedRow(); if (row == null) return; Object rowValue =row.getValue(); DynamicGridRow parent = row.getParent(); form.lyrDetails().tabFRU().dyngrdFRU().getRows().remove(row); if (rowValue instanceof MedicationFormVo) rebindFormRows(); else if (rowValue instanceof MedicationRouteVo) rebindRouteRows(parent); else if (rowValue instanceof MedicationUnitVo) rebindUnitRows(parent); }
private void rebindFormRows() { DynamicGridRowCollection rows = form.lyrDetails().tabFRU().dyngrdFRU().getRows(); DoseFormIndicatorCollection mForms = ims.clinical.vo.lookups.LookupHelper.getDoseFormIndicator(this.domain.getLookupService()); for (int i = 0 ; i < rows.size() ; i++) { if (rows.get(i).getValue() instanceof MedicationFormVo) { MedicationFormVo x = (MedicationFormVo) rows.get(i).getValue(); if (!x.getFormIsNotNull()) continue; mForms.remove(x.getForm()); } } for (int i = 0 ; i < rows.size() ; i++) { DynamicGridCell cell = rows.get(i).getCells().get(form.lyrDetails().tabFRU().dyngrdFRU().getColumns().getByIdentifier(COL_MAIN)); Object back = cell.getValue(); cell.getItems().clear(); if (back!=null) cell.getItems().newItem(back); for (int j = 0 ; j < mForms.size() ;j++) cell.getItems().newItem(mForms.get(j)); cell.setValue(back); } }