private IStatementsPair FindPair(XmlInfosForPairing reference, IEnumerable <XmlInfosForPairing> analyses) { foreach (var analysis in analyses) { if (string.Equals(reference.FirstName, analysis.FirstName) && string.Equals(reference.Surname, analysis.Surname)) { return(new StatementPair(reference.FilePath, analysis.FilePath, true)); } else { return(new StatementPair(reference.FilePath, "", false)); } } throw new InvalidOperationException("Analyses can not be empty"); }
private IEnumerable <XmlInfosForPairing> GetPatientsNames(IEnumerable <string> files) { List <XmlInfosForPairing> xmlInfos = new List <XmlInfosForPairing>(); string patient = "patient"; files.ToList().ForEach(x => { var xmlInfo = new XmlInfosForPairing { FilePath = x, FirstName = XmlParser.GetValueOfAttribute(x, patient, "firstName"), Surname = XmlParser.GetValueOfAttribute(x, patient, "surname") }; xmlInfos.Add(xmlInfo); }); return(xmlInfos); }