private boolean isAtLeastOneComorbRelevant(PatientDiagnosisEDischargeListVoCollection collComorbidities, CareContextRefVo careContextRef) { if (collComorbidities == null) return false; for (PatientDiagnosisEDischargeListVo comorbidity : collComorbidities) { if (comorbidity.getCoMorbidityForEpisodeOfCares() != null) { for (EpisodeOfCareCoMorbidityVo episodeComorbidity : comorbidity.getCoMorbidityForEpisodeOfCares()) { if (episodeComorbidity.getIsActive() && episodeComorbidity.getCareContext().getID_CareContext().equals(careContextRef.getID_CareContext())) //WDEV-20265 return true; } } } return false; }
private PatientDiagnosisEDischargeListVo relevant(PatientDiagnosisEDischargeListVo voPatientComorb, boolean bRelevant) { boolean bFound = false; for (int i = 0; voPatientComorb.getCoMorbidityForEpisodeOfCaresIsNotNull() && i < voPatientComorb.getCoMorbidityForEpisodeOfCares().size(); i++) { EpisodeOfCareCoMorbidityVo voRelevant = voPatientComorb.getCoMorbidityForEpisodeOfCares().get(i); if (voRelevant.getCareContextIsNotNull() && voRelevant.getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext())) { if (voRelevant.getIsActiveIsNotNull() && voRelevant.getIsActive().equals(bRelevant)) return null; bFound = true; voRelevant.setIsActive(bRelevant); voPatientComorb.getCoMorbidityForEpisodeOfCares().set(i,voRelevant); } } if (!bFound) { EpisodeOfCareCoMorbidityVo voNewRelevant = new EpisodeOfCareCoMorbidityVo(); voNewRelevant.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voNewRelevant.setAuthoringInformation(voPatientComorb.getAuthoringInfo()); voNewRelevant.setDiagnosis(voPatientComorb); voNewRelevant.setIsActive(bRelevant); if (voPatientComorb.getCoMorbidityForEpisodeOfCares() == null) voPatientComorb.setCoMorbidityForEpisodeOfCares(new EpisodeOfCareCoMorbidityVoCollection()); voPatientComorb.getCoMorbidityForEpisodeOfCares().add(voNewRelevant); } return voPatientComorb; }