Exemplo n.º 1
0
 public override void LoadData(string filePath)
 {
     string[] data = File.ReadAllLines(filePath);
     foreach (var dataLine in data.Skip(1))
     {
         var sourceRepo = new SourceRepository();
         var patientRepo = new PatientRepository();
         var phenotypeRepo = new PhenotypeRepository();
         var fields = dataLine.Split(Delimiter);
         var source = sourceRepo.AddSource(fields[5], string.Empty);
         var file = AddResultFile(filePath, source);
         var patient = patientRepo.AddPatient(fields[0], fields[1], fields[2], fields[3], DateTime.Parse(fields[4]));
         phenotypeRepo.AddResult(patient, file, fields[6], fields[7], fields[8], fields[9], DateTime.Parse(fields[10]));
     }
 }
Exemplo n.º 2
0
        public override void LoadData(string filePath)
        {
            string[] data = File.ReadAllLines(filePath);
            foreach (var dataLine in data.Skip(1))
            {
                var patientRepo = new PatientRepository();
                var variantRepo = new VariantRepository();
                var sourceRepo = new SourceRepository();

                var fields = dataLine.Split(Delimiter);
                var patient = patientRepo.AddPatient(fields[0], fields[1], fields[2], fields[3], DateTime.Parse(fields[4]));
                var resultedOn = DateTime.Parse(fields[5]);
                var lab = fields[6];
                List<StarVariantResult> stars = new List<StarVariantResult>();
                stars.Add(new StarVariantResult() { Gene = "CYP2C19", Result = fields[7] });
                stars.Add(new StarVariantResult() { Gene = "CYP2C9", Result = fields[8] });
                stars.Add(new StarVariantResult() { Gene = "VKORC1", Result = fields[9] });

                var source = sourceRepo.AddSource(lab, string.Empty);
                var file = AddResultFile(filePath, source);
                variantRepo.AddStarVariants(patient, file, resultedOn, stars);
            }
        }