private PatientDiagnosisEDischargeVo includeValueChangedForCareContext(PatientDiagnosisEDischargeVo voPatientDiagnosis, boolean bInclude) { boolean bFound = false; for (int i = 0 ; voPatientDiagnosis.getIncludeDiagnosisInDiscReportsIsNotNull() && i < voPatientDiagnosis.getIncludeDiagnosisInDiscReports().size() ; i++) { IncludeDiagnosisInDischargeReportVo voInclude = voPatientDiagnosis.getIncludeDiagnosisInDiscReports().get(i); if (voInclude.getCareContextIsNotNull() && voInclude.getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext())) { bFound = true; voInclude.setIncludeInReport(bInclude); voPatientDiagnosis.getIncludeDiagnosisInDiscReports().set(i, voInclude); } } if ( !bFound ) { IncludeDiagnosisInDischargeReportVo voNewInclude = new IncludeDiagnosisInDischargeReportVo(); voNewInclude.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voNewInclude.setDiagnosis(voPatientDiagnosis); voNewInclude.setIncludeInReport(bInclude); if (voPatientDiagnosis.getIncludeDiagnosisInDiscReports() == null) voPatientDiagnosis.setIncludeDiagnosisInDiscReports(new IncludeDiagnosisInDischargeReportVoCollection()); voPatientDiagnosis.getIncludeDiagnosisInDiscReports().add(voNewInclude); } return voPatientDiagnosis; }
private PatientDiagnosisEDischargeVo includeValueChangedForCareContext(PatientDiagnosisEDischargeVo voPatientDiagnosis, boolean bInclude) { boolean bFound = false; for (int i = 0; voPatientDiagnosis.getIncludeDiagnosisInDiscReportsIsNotNull() && i < voPatientDiagnosis.getIncludeDiagnosisInDiscReports().size(); i++) { IncludeDiagnosisInDischargeReportVo voInclude = voPatientDiagnosis.getIncludeDiagnosisInDiscReports().get(i); if (voInclude.getCareContextIsNotNull() && voInclude.getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext())) { // Include info exists and has not changed. if (voInclude.getIncludeInReportIsNotNull() && voInclude.getIncludeInReport().equals(bInclude)) return null; bFound = true; voInclude.setIncludeInReport(bInclude); voPatientDiagnosis.getIncludeDiagnosisInDiscReports().set(i, voInclude);//Don't think this is necessary as we modify the object that is already in the List } } if (!bFound) { IncludeDiagnosisInDischargeReportVo voNewInclude = new IncludeDiagnosisInDischargeReportVo(); voNewInclude.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voNewInclude.setDiagnosis(voPatientDiagnosis); voNewInclude.setIncludeInReport(bInclude); if (voPatientDiagnosis.getIncludeDiagnosisInDiscReports() == null) voPatientDiagnosis.setIncludeDiagnosisInDiscReports(new IncludeDiagnosisInDischargeReportVoCollection()); voPatientDiagnosis.getIncludeDiagnosisInDiscReports().add(voNewInclude); } return voPatientDiagnosis; }
private PatientDiagnosisEDischargeListVo includeValueChangedForCareContext(PatientDiagnosisEDischargeListVo voPatientDiagnosis, boolean bInclude) //WDEV-20511 { boolean bFound = false; for (int i = 0; voPatientDiagnosis.getIncludeDiagnosisInDiscReportsIsNotNull() && i < voPatientDiagnosis.getIncludeDiagnosisInDiscReports().size(); i++) { IncludeDiagnosisInDischargeReportVo voInclude = voPatientDiagnosis.getIncludeDiagnosisInDiscReports().get(i); if (voInclude.getCareContextIsNotNull() && voInclude.getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext())) { // Include info exists and has not changed. if (voInclude.getIncludeInReportIsNotNull() && voInclude.getIncludeInReport().equals(bInclude)) return null; bFound = true; voInclude.setIncludeInReport(bInclude); voPatientDiagnosis.getIncludeDiagnosisInDiscReports().set(i, voInclude);//Don't think this is necessary as we modify the object that is already in the List } } if (!bFound) { IncludeDiagnosisInDischargeReportVo voNewInclude = new IncludeDiagnosisInDischargeReportVo(); voNewInclude.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voNewInclude.setDiagnosis(voPatientDiagnosis); voNewInclude.setIncludeInReport(bInclude); if (voPatientDiagnosis.getIncludeDiagnosisInDiscReports() == null) voPatientDiagnosis.setIncludeDiagnosisInDiscReports(new IncludeDiagnosisInDischargeReportVoCollection()); voPatientDiagnosis.getIncludeDiagnosisInDiscReports().add(voNewInclude); } return voPatientDiagnosis; }