private void prePopulateSportsGrd() { PlanOfActionCollection collPlanOfAction = LookupHelper.getPlanOfAction(domain.getLookupService()); form.getLocalContext().setPlanOfActionCollection(collPlanOfAction); form.grdPlan().populateTree(collPlanOfAction); form.grdPlan().expandAll(); loadAdviceToPatientGrid(false); loadAdviceToGPGrid(false); }
private boolean hasSelectedItem(PlanOfAction action, PlanOfAction primaryPlan, PlanOfActionCollection secondaryPlans) { form.getLocalContext().setHasSelectedItem(false); searchHierarchyForPrimary( action, primaryPlan); if(!form.getLocalContext().getHasSelectedItem()) for (int i = 0; i < secondaryPlans.size(); i++) searchHierarchyForSecondary( action, secondaryPlans.get(i)); return form.getLocalContext().getHasSelectedItem(); }
private PlanOfActionCollection populateSecondaryPlansFromGrd(grdPlanRowCollection collRows, PlanOfActionCollection voPlanOfActionColl) { if(collRows==null) collRows = form.grdPlan().getRows(); for (int i = 0; i < collRows.size(); i++) { GenForm.grdPlanRow rowParent = collRows.get(i); if(rowParent.getRows().size()==0){ if(rowParent.getcolSecondary()) voPlanOfActionColl.add(rowParent.getcolPlan()); } else{ for (int j = 0; j < rowParent.getRows().size(); j++) { GenForm.grdPlanRow rowChild = rowParent.getRows().get(j); PlanOfAction voPlanOfAction = rowChild.getcolPlan(); if(rowChild.getcolSecondary()) voPlanOfActionColl.add(voPlanOfAction); if(rowChild.getRows().size()>0) populateSecondaryPlansFromGrd(rowChild.getRows(), voPlanOfActionColl); } } } return voPlanOfActionColl; }
private void populatePlanGrid(PlanOfAction primaryPlan, PlanOfActionCollection secondaryPlans) { form.grdPlan().getRows().clear(); PlanOfActionCollection collPlanOfAction = form.getLocalContext().getPlanOfActionCollection(); for (int i = 0; i < collPlanOfAction.size(); i++) { if(collPlanOfAction.get(i).getParent()==null && hasSelectedItem(collPlanOfAction.get(i), primaryPlan, secondaryPlans)) putItemHierarchyOnGrid(collPlanOfAction.get(i), form.grdPlan().getRows().newRow()); } setSelectedPlans(); form.grdPlan().expandAll(); }