Exemple #1
0
        public static void MakeReport(FileInfo fileIn)
        {
            Report report = new Report();
            report.LoadDCMFile(fileIn.FullName, Config.sSRBegin);

            int accessionNumber = report.GetAccessionNumber();
            string tempFullPath = Path.Combine(Config.tempPath, accessionNumber.ToString());

            Utilities.Folders.CheckIfNotExistAndCreate(tempFullPath);
            Utilities.Folders.Copy(Config.templatePath, tempFullPath, true);

            foreach (string contentFile in Properties.Settings.Default.contentFiles)
            {
                report.ReplaceValuesOnFile(contentFile);
            }

            FileInfo fileOut =
                new FileInfo(CrapFixer.CrapFixer.AmbulatorioReportPath(
                    Config.fileOutPath, accessionNumber + ".doc"));

            if (fileOut.Exists) { fileOut.Delete(); }

            Console.WriteLine("Creating report: {0}", fileOut);
            Utilities.Zippit.MakeZip(fileIn.FullName, fileOut.FullName);

            Directory.Delete(fileOut.DirectoryName, true);
        }
Exemple #2
0
        public static void MakeReport(FileInfo fileIn)
        {
            Report report = new Report();

            report.LoadDCMFile(fileIn.FullName, Config.sSRBegin);

            int    accessionNumber = report.GetAccessionNumber();
            string tempFullPath    = Path.Combine(Config.tempPath, accessionNumber.ToString());

            Utilities.Folders.CheckIfNotExistAndCreate(tempFullPath);
            Utilities.Folders.Copy(Config.templatePath, tempFullPath, true);

            foreach (string contentFile in Properties.Settings.Default.contentFiles)
            {
                report.ReplaceValuesOnFile(contentFile);
            }

            FileInfo fileOut =
                new FileInfo(CrapFixer.CrapFixer.AmbulatorioReportPath(
                                 Config.fileOutPath, accessionNumber + ".doc"));

            if (fileOut.Exists)
            {
                fileOut.Delete();
            }

            Console.WriteLine("Creating report: {0}", fileOut);
            Utilities.Zippit.MakeZip(fileIn.FullName, fileOut.FullName);

            Directory.Delete(fileOut.DirectoryName, true);
        }