private async static Task RunAnonymization(Options options) { try { InitializeAnonymizerLogging(options.IsVerbose); var dataProcessor = new FhirResourceDataProcessor(options.ConfigurationFilePath); if (dataProcessor.IsSameDirectory(options.InputFolder, options.OutputFolder)) { throw new Exception("Input and output folders are the same! Please choose another folder."); } Directory.CreateDirectory(options.OutputFolder); if (options.IsBulkData) { await dataProcessor.AnonymizeBulkDataFolder(options.InputFolder, options.OutputFolder, options.IsRecursive, options.ValidateInput, options.ValidateOutput).ConfigureAwait(false); } else { await dataProcessor.AnonymizeFolder(options.InputFolder, options.OutputFolder, options.IsRecursive, options.ValidateInput, options.ValidateOutput).ConfigureAwait(false); } } finally { // Dispose to flush logs DisposeAnonymizerLogging(); } }
private static void RunAnonymization(Options options) { InitializeAnonymizerLogging(options.IsVerbose); var dataProcessor = new FhirResourceDataProcessor(options.ConfigurationFilePath); if (dataProcessor.IsSameDirectory(options.InputFolder, options.OutputFolder)) { throw new Exception("Input and output folders are the same! Please choose another folder."); } Directory.CreateDirectory(options.OutputFolder); if (options.IsBulkData) { dataProcessor.AnonymizeBulkDataFolder(options.InputFolder, options.OutputFolder, options.IsRecursive); } else { dataProcessor.AnonymizeFolder(options.InputFolder, options.OutputFolder, options.IsRecursive); } }