Iterator<String> familyList = patient.getClinicalHistoryProxy().getFamilyBackground(2).iterator();
Iterator<String> medicinesList = patient.getClinicalHistoryProxy().getPatientMedicines(2).iterator();
Iterator<String> pathologiesList = patient.getClinicalHistoryProxy().getPatientPathologies(2).iterator();
Iterator<String> surgeriesList = patient.getClinicalHistoryProxy().getPatientSurgeries(2).iterator();
Report report = new Report();
String family = "";
while (familyList.hasNext()) {
family = family.concat((family.isEmpty() ? "" : ". ") + familyList.next());
}
report.setBackgroundFamily(family.isEmpty() ? "" : "Antecendentes Familiares: " + family);
String medicine = "";
while (medicinesList.hasNext()) {
medicine = medicine.concat((medicine.isEmpty() ? "" : ". ") + medicinesList.next());
}
report.setBackgroundMedicines(medicine.isEmpty() ? "" : "Medicamentos: " + medicine);
String pathology = "";
while (pathologiesList.hasNext()) {
pathology = pathology.concat((pathology.isEmpty() ? "" : ". ") + pathologiesList.next());
}
report.setBackgroundPathologies(pathology.isEmpty() ? "" : EntityDescriptions.PATHOLOGIES + ": " + pathology);
String surgeries = "";
while (surgeriesList.hasNext()) {
surgeries = surgeries.concat((surgeries.isEmpty() ? "" : ". ") + surgeriesList.next());
}
report.setBackgroundSurgeries(surgeries.isEmpty()?"":EntityDescriptions.SURGERIES + ": " +surgeries);
analisys.setReport(report);
return analisys;
}