private PatientAllergyEDischargeVo includeValueChangedForCareContext(PatientAllergyEDischargeVo voAllergy, boolean bInclude) { boolean bFound = false; for (int i = 0 ; voAllergy.getIncludeAllergyInDischargeReportsIsNotNull() && i < voAllergy.getIncludeAllergyInDischargeReports().size() ; i++) { IncludeAllergyInDischargeReportsVo voInclude = voAllergy.getIncludeAllergyInDischargeReports().get(i); if (voInclude.getCareContextIsNotNull() && voInclude.getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext())) { bFound = true; voInclude.setIncludeInReport(bInclude); voAllergy.getIncludeAllergyInDischargeReports().set(i, voInclude); } } if ( !bFound ) setAllergyIncludeInfo(voAllergy, bInclude); return voAllergy; }
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); }