Exemple #1
0
        public void readReport(string path)
        {
            bool             secondLine  = false;
            FileStream       fs          = File.Open(path, FileMode.Open, FileAccess.Read);
            IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(fs);

            do
            {
                while (excelReader.Read())
                {
                    if (secondLine == true)
                    {
                        if (excelReader.GetString(1) != null)
                        {
                            string       prsDetails = excelReader.GetString(1);
                            DateTime     date       = excelReader.GetDateTime(7);
                            string       detection  = excelReader.GetString(10);
                            string       icdLine    = excelReader.GetString(11);
                            compoundInfo temporary  = new compoundInfo(prsDetails, icdLine, date, detection);
                            if (findDuplicatesPatients(temporary) == false)
                            {
                                patients.Add(temporary);
                                ConsoleOutputPatINF(temporary);
                            }
                        }
                    }
                    secondLine = true;
                }
            } while (excelReader.NextResult());
            fs.Close();
        }
Exemple #2
0
 private bool findDuplicatesPatients(compoundInfo temporary)
 {
     foreach (compoundInfo item in patients)
     {
         if (item.NAME == temporary.NAME && item.SURNAME == temporary.SURNAME && item.DATE == temporary.DATE && item.PROCEDURECELL == temporary.PROCEDURECELL)
         {
             return(true);
         }
         else
         {
             continue;
         }
     }
     return(false);
 }
Exemple #3
0
 private void ConsoleOutputPatINF(compoundInfo tmp)
 {
     Console.WriteLine("*** Wczytano linie o pacjencie {0} {1} z datą wizyty {2} i procedurami {3}", tmp.NAME, tmp.SURNAME, tmp.DATE, tmp.PROCEDURECELL);
 }