private boolean findIfIncludeSetForThisCareContext(IncludeAllergyInDischargeReportsVoCollection collection) { for(int i = 0 ; collection != null && i < collection.size() ; i++) { if (collection.get(i).getCareContextIsNotNull() && collection.get(i).getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext()) && collection.get(i).getIncludeInReport()) return true; } return false; }
private void setAllergyIncludeInfo(PatientAllergyEDischargeVo voAllergy, boolean bInclude) { IncludeAllergyInDischargeReportsVo voNewInclude = new IncludeAllergyInDischargeReportsVo(); voNewInclude.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voNewInclude.setAllergy(voAllergy); voNewInclude.setIncludeInReport(bInclude); if (voAllergy.getIncludeAllergyInDischargeReports() == null) voAllergy.setIncludeAllergyInDischargeReports(new IncludeAllergyInDischargeReportsVoCollection()); voAllergy.getIncludeAllergyInDischargeReports().add(voNewInclude); }