private Manipulation CreateNewManipulation(IClinicsData data, string currentReportDate, DataRow row, Patient currentPatient) { var procedureName = row["Procedure"].ToString(); var specialistUin = row["SpecialistUIN"].ToString(); var information = row["Information"].ToString(); var specialist = data .Specialists.All() .Where(s => s.Uin == specialistUin) .FirstOrDefault(); var procedure = data .Procedures.All() .Where(pr => pr.Name == procedureName) .FirstOrDefault(); Manipulation currentManipulation = new Manipulation() { Id = Guid.NewGuid(), PatientId = currentPatient.Id, SpecialistId = specialist.Id, ProcedureId = procedure.Id, Information = information, Date = DateTime.ParseExact(currentReportDate, "dd-MM-yyyy", CultureInfo.InvariantCulture) }; return currentManipulation; }
private Patient CreateNewPatient(DataRow row) { var patientNumber = row["PatientNumber"].ToString(); var abreviature = row["Abreviature"].ToString(); var age = row["Age"].ToString(); var gender = row["Gender"].ToString(); Patient currentPatient = new Patient() { Id = Guid.NewGuid(), PatientNumber = patientNumber, Abreviature = abreviature, Age = int.Parse(age), Gender = gender }; return currentPatient; }