protected void onFormOpen() throws ims.framework.exceptions.FormOpenException { CarePlanTemplateInterventionCollection coll = form.getGlobalContext().COE.getCarePlanTemplateInterventions(); if (coll != null) { GenForm.gridActionsRow row; form.gridActions().getRows().clear(); for (int i=0; i<coll.size(); i++) { CarePlanTemplateIntervention interv = coll.get(i); //27/10/2004 - Sinead request - don't display the inactive if(interv.getActiveIsNotNull() && interv.getActive().booleanValue()) { interv.setIntervention(interv.getIntervention()); row = form.gridActions().getRows().newRow(); row.setColActions(interv.getIntervention()); row.setValue(interv); } } } }
public CarePlanTemplateInterventionCollection getCarePlanTemplateActions(ims.nursing.vo.CarePlanTemplate voCarePlanTemplate) { DomainFactory factory = getDomainFactory(); CarePlanTemplate templ = (CarePlanTemplate) factory.getDomainObject(CarePlanTemplate.class, voCarePlanTemplate.getID_CarePlanTemplate()); return (CarePlanTemplateInterventionAssembler.createCarePlanTemplateInterventionCollectionFromCarePlanTemplateIntervention(templ.getInterventions())); }
private void displayInterventions() { form.gridInterventions().setValue(null); if (form.getLocalContext().getcarePlanTemplate() != null) { CarePlanTemplateInterventionCollection voCptInterColl; if ((voCptInterColl = form.getLocalContext().getcarePlanTemplate().getInterventions()) != null) { voCptInterColl.sort(); // clear and add to grid form.gridInterventions().getRows().clear(); GenForm.gridInterventionsRow row; for (int i = 0; i < voCptInterColl.size(); i++) { CarePlanTemplateIntervention voCpInt = voCptInterColl.get(i); if (form.chkActiveOnly().getValue() == true) { // show active interventions only if (voCpInt.getActiveIsNotNull() && voCpInt.getActive().booleanValue()) { row = form.gridInterventions().getRows().newRow(); // Intervention row.setValue(voCpInt); row.setColManOpt(voCpInt.getInterventionType()); row.setColIntervention(voCpInt.getIntervention()); row.setColActive(voCpInt.getActive().booleanValue()); } } else { // show all interventions row = form.gridInterventions().getRows().newRow(); // Intervention row.setValue(voCpInt); row.setColManOpt(voCpInt.getInterventionType()); row.setColIntervention(voCpInt.getIntervention()); row.setColActive(voCpInt.getActive().booleanValue()); row.setDateInactive(voCpInt.getDateInactive()); if (voCpInt.getActive().booleanValue() == false) row.setReadOnly(true); } } if (form.getLocalContext().getSelectedIntervention() != null) form.gridInterventions().setValue(form.getLocalContext().getSelectedIntervention()); } } }
private void newCarePlanAction() { // Pass in the Collection of unused careplan template actions CarePlanTemplateInterventionCollection coll = null; CarePlanTemplate voCPT = new CarePlanTemplate(); if (form.getLocalContext().getCarePlan().getTemplate() != null) { voCPT.setID_CarePlanTemplate(form.getLocalContext().getCarePlan().getTemplate().getID_CarePlanTemplate()); coll = domain.getCarePlanTemplateActions(voCPT); // Loop through the collection, removing those already specified on // the grid // Can only check on description?? if (coll != null ) { CarePlanTemplateInterventionCollection newColl = new CarePlanTemplateInterventionCollection(); int p = 0; for (int i = 0; i < coll.size(); i++) { boolean rowFound = false; CarePlanTemplateIntervention interv = coll.get(i); for (int j = 0; form.getLocalContext().getCarePlan().getInterventionsIsNotNull() && j < form.getLocalContext().getCarePlan().getInterventions().size(); j++) { if (form.getLocalContext().getCarePlan().getInterventions().get(j).getDescription().equals(interv.getIntervention())) { rowFound = true; break; } } if (!rowFound) { newColl.add(interv); p++; } } form.getGlobalContext().COE.setCarePlanTemplateInterventions(newColl); } } engine.open(form.getForms().Nursing.CarePlanAddAction); }