private PatientAlertEDischargeVo includeValueChangedForCareContext(PatientAlertEDischargeVo voAlert, boolean bInclude) { boolean bFound = false; for (int i = 0 ; voAlert.getIncludeAlertInDischargeReportsIsNotNull() && i < voAlert.getIncludeAlertInDischargeReports().size() ; i++) { IncludeAlertInDischargeReportsVo voInclude = voAlert.getIncludeAlertInDischargeReports().get(i); if (voInclude.getCareContextIsNotNull() && voInclude.getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext())) { bFound = true; voInclude.setIncludeInReport(bInclude); voAlert.getIncludeAlertInDischargeReports().set(i, voInclude); } } if ( !bFound ) setAlertIncludeInfo(voAlert, bInclude); return voAlert; }
private void setAlertIncludeInfo(PatientAlertEDischargeVo voAlert, boolean bInclude) { IncludeAlertInDischargeReportsVo voNewInclude = new IncludeAlertInDischargeReportsVo(); voNewInclude.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voNewInclude.setAlert(voAlert); voNewInclude.setIncludeInReport(bInclude); if (voAlert.getIncludeAlertInDischargeReports() == null) voAlert.setIncludeAlertInDischargeReports(new IncludeAlertInDischargeReportsVoCollection()); voAlert.getIncludeAlertInDischargeReports().add(voNewInclude); }