/** * * @param patientGoalsCollection */ private void populateGrid(PatientGoalVoCollection patientGoalsCollection) { // Clear grid form.grdTarget().getRows().clear(); // If the PatientGoal collection is null terminate function if (patientGoalsCollection == null) return; // Add each PatientGoal to the grid for (int i = 0; i < patientGoalsCollection.size(); i++) { PatientGoalVo patientGoal = patientGoalsCollection.get(i); // Skip null records if (patientGoal == null) continue; setPatientGoalRow(form.grdTarget().getRows().newRow(), patientGoal); } }
/** * Function used to list all PatientGoals based on a CareContext */ public PatientGoalVoCollection listPatientGoals(CareContextRefVo careContextRef) { // Check for a valid CareContext if (careContextRef == null || !careContextRef.getID_CareContextIsNotNull()) { throw new DomainRuntimeException("Major logical error - Provide a care context to search patient goals"); } // Define filter criteria IMSCriteria criteria = new IMSCriteria(PatientGoal.class, getDomainFactory()); criteria.equal("this.careContext.id", careContextRef.getID_CareContext()); // Return corresponding PatientGoal collection return PatientGoalVoAssembler.createPatientGoalVoCollectionFromPatientGoal(criteria.find()); }